Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: net/base/cert_verify_proc_unittest.cc

Issue 12212135: Return specific cert verification errors on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/cert_verify_proc_android.cc ('k') | net/net.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/base/cert_verify_proc_android.cc ('k') | net/net.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698