Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "net/base/cert_status_flags.h" | 9 #include "net/base/cert_status_flags.h" |
| 10 #include "net/base/cert_test_util.h" | 10 #include "net/base/cert_test_util.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 EXPECT_EQ(paypal_null_fingerprint[i], fingerprint.data[i]); | 287 EXPECT_EQ(paypal_null_fingerprint[i], fingerprint.data[i]); |
| 288 | 288 |
| 289 int flags = 0; | 289 int flags = 0; |
| 290 CertVerifyResult verify_result; | 290 CertVerifyResult verify_result; |
| 291 int error = paypal_null_cert->Verify("www.paypal.com", flags, | 291 int error = paypal_null_cert->Verify("www.paypal.com", flags, |
| 292 &verify_result); | 292 &verify_result); |
| 293 EXPECT_NE(OK, error); | 293 EXPECT_NE(OK, error); |
| 294 // Either the system crypto library should correctly report a certificate | 294 // Either the system crypto library should correctly report a certificate |
| 295 // name mismatch, or our certificate blacklist should cause us to report an | 295 // name mismatch, or our certificate blacklist should cause us to report an |
| 296 // invalid certificate. | 296 // invalid certificate. |
| 297 #if defined(OS_LINUX) || defined(OS_WIN) | 297 #if !defined(OS_MACOSX) |
|
Evan Martin
2010/05/19 11:50:11
It is weird this code doesn't happen on OS X.
| |
| 298 EXPECT_NE(0, verify_result.cert_status & | 298 EXPECT_NE(0, verify_result.cert_status & |
| 299 (CERT_STATUS_COMMON_NAME_INVALID | CERT_STATUS_INVALID)); | 299 (CERT_STATUS_COMMON_NAME_INVALID | CERT_STATUS_INVALID)); |
| 300 #endif | 300 #endif |
| 301 } | 301 } |
| 302 | 302 |
| 303 // A certificate whose AIA extension contains an LDAP URL without a host name. | 303 // A certificate whose AIA extension contains an LDAP URL without a host name. |
| 304 // This certificate will expire on 2011-09-08. | 304 // This certificate will expire on 2011-09-08. |
| 305 TEST(X509CertificateTest, UnoSoftCertParsing) { | 305 TEST(X509CertificateTest, UnoSoftCertParsing) { |
| 306 FilePath certs_dir = GetTestCertsDirectory(); | 306 FilePath certs_dir = GetTestCertsDirectory(); |
| 307 scoped_refptr<X509Certificate> unosoft_hu_cert = | 307 scoped_refptr<X509Certificate> unosoft_hu_cert = |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 513 X509Certificate::DupOSCertHandle(handle1), | 513 X509Certificate::DupOSCertHandle(handle1), |
| 514 X509Certificate::SOURCE_FROM_NETWORK, | 514 X509Certificate::SOURCE_FROM_NETWORK, |
| 515 intermediates3); | 515 intermediates3); |
| 516 | 516 |
| 517 // The cache should have returned cert2 'cause it has more intermediates: | 517 // The cache should have returned cert2 'cause it has more intermediates: |
| 518 EXPECT_EQ(cert3, cert2); | 518 EXPECT_EQ(cert3, cert2); |
| 519 } | 519 } |
| 520 #endif | 520 #endif |
| 521 | 521 |
| 522 } // namespace net | 522 } // namespace net |
| OLD | NEW |