| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/base/cert_verify_proc.h" | 5 #include "net/base/cert_verify_proc.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 const SHA1HashValue& fingerprint = | 125 const SHA1HashValue& fingerprint = |
| 126 paypal_null_cert->fingerprint(); | 126 paypal_null_cert->fingerprint(); |
| 127 for (size_t i = 0; i < 20; ++i) | 127 for (size_t i = 0; i < 20; ++i) |
| 128 EXPECT_EQ(paypal_null_fingerprint[i], fingerprint.data[i]); | 128 EXPECT_EQ(paypal_null_fingerprint[i], fingerprint.data[i]); |
| 129 | 129 |
| 130 int flags = 0; | 130 int flags = 0; |
| 131 CertVerifyResult verify_result; | 131 CertVerifyResult verify_result; |
| 132 int error = Verify(paypal_null_cert, "www.paypal.com", flags, NULL, | 132 int error = Verify(paypal_null_cert, "www.paypal.com", flags, NULL, |
| 133 &verify_result); | 133 &verify_result); |
| 134 #if defined(USE_NSS) || defined(OS_IOS) | 134 #if defined(USE_NSS) || defined(OS_IOS) || defined(OS_ANDROID) |
| 135 EXPECT_EQ(ERR_CERT_COMMON_NAME_INVALID, error); | 135 EXPECT_EQ(ERR_CERT_COMMON_NAME_INVALID, error); |
| 136 #else | 136 #else |
| 137 // TOOD(bulach): investigate why macosx and win aren't returning | 137 // TOOD(bulach): investigate why macosx and win aren't returning |
| 138 // ERR_CERT_INVALID or ERR_CERT_COMMON_NAME_INVALID. | 138 // ERR_CERT_INVALID or ERR_CERT_COMMON_NAME_INVALID. |
| 139 EXPECT_EQ(ERR_CERT_AUTHORITY_INVALID, error); | 139 EXPECT_EQ(ERR_CERT_AUTHORITY_INVALID, error); |
| 140 #endif | 140 #endif |
| 141 // Either the system crypto library should correctly report a certificate | 141 // Either the system crypto library should correctly report a certificate |
| 142 // name mismatch, or our certificate blacklist should cause us to report an | 142 // name mismatch, or our certificate blacklist should cause us to report an |
| 143 // invalid certificate. | 143 // invalid certificate. |
| 144 #if defined(USE_NSS) || defined(OS_WIN) || defined(OS_IOS) | 144 #if defined(USE_NSS) || defined(OS_WIN) || defined(OS_IOS) |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 #define MAYBE_VerifyMixed DISABLED_VerifyMixed | 996 #define MAYBE_VerifyMixed DISABLED_VerifyMixed |
| 997 #else | 997 #else |
| 998 #define MAYBE_VerifyMixed VerifyMixed | 998 #define MAYBE_VerifyMixed VerifyMixed |
| 999 #endif | 999 #endif |
| 1000 WRAPPED_INSTANTIATE_TEST_CASE_P( | 1000 WRAPPED_INSTANTIATE_TEST_CASE_P( |
| 1001 MAYBE_VerifyMixed, | 1001 MAYBE_VerifyMixed, |
| 1002 CertVerifyProcWeakDigestTest, | 1002 CertVerifyProcWeakDigestTest, |
| 1003 testing::ValuesIn(kVerifyMixedTestData)); | 1003 testing::ValuesIn(kVerifyMixedTestData)); |
| 1004 | 1004 |
| 1005 } // namespace net | 1005 } // namespace net |
| OLD | NEW |