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

Side by Side Diff: net/cert/test_root_certs_unittest.cc

Issue 206453002: Introduce USE_OPENSSL_CERTS for certificate handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final fixes and nits Created 6 years, 8 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/cert/test_root_certs.h ('k') | net/cert/x509_certificate.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/base/test_data_directory.h" 8 #include "net/base/test_data_directory.h"
9 #include "net/cert/cert_status_flags.h" 9 #include "net/cert/cert_status_flags.h"
10 #include "net/cert/cert_verify_proc.h" 10 #include "net/cert/cert_verify_proc.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 NULL, 128 NULL,
129 CertificateList(), 129 CertificateList(),
130 &restored_verify_result); 130 &restored_verify_result);
131 EXPECT_NE(OK, restored_status); 131 EXPECT_NE(OK, restored_status);
132 EXPECT_NE(0u, 132 EXPECT_NE(0u,
133 restored_verify_result.cert_status & CERT_STATUS_AUTHORITY_INVALID); 133 restored_verify_result.cert_status & CERT_STATUS_AUTHORITY_INVALID);
134 EXPECT_EQ(bad_status, restored_status); 134 EXPECT_EQ(bad_status, restored_status);
135 EXPECT_EQ(bad_verify_result.cert_status, restored_verify_result.cert_status); 135 EXPECT_EQ(bad_verify_result.cert_status, restored_verify_result.cert_status);
136 } 136 }
137 137
138 #if defined(USE_NSS) || (defined(USE_OPENSSL) && !defined(OS_ANDROID)) 138 #if defined(USE_NSS) || (defined(USE_OPENSSL_CERTS) && !defined(OS_ANDROID))
139 TEST(TestRootCertsTest, Contains) { 139 TEST(TestRootCertsTest, Contains) {
140 // Another test root certificate. 140 // Another test root certificate.
141 const char kRootCertificateFile2[] = "2048-rsa-root.pem"; 141 const char kRootCertificateFile2[] = "2048-rsa-root.pem";
142 142
143 TestRootCerts* test_roots = TestRootCerts::GetInstance(); 143 TestRootCerts* test_roots = TestRootCerts::GetInstance();
144 ASSERT_NE(static_cast<TestRootCerts*>(NULL), test_roots); 144 ASSERT_NE(static_cast<TestRootCerts*>(NULL), test_roots);
145 145
146 scoped_refptr<X509Certificate> root_cert_1 = 146 scoped_refptr<X509Certificate> root_cert_1 =
147 ImportCertFromFile(GetTestCertsDirectory(), kRootCertificateFile); 147 ImportCertFromFile(GetTestCertsDirectory(), kRootCertificateFile);
148 ASSERT_NE(static_cast<X509Certificate*>(NULL), root_cert_1.get()); 148 ASSERT_NE(static_cast<X509Certificate*>(NULL), root_cert_1.get());
(...skipping 17 matching lines...) Expand all
166 EXPECT_FALSE(test_roots->Contains(root_cert_1->os_cert_handle())); 166 EXPECT_FALSE(test_roots->Contains(root_cert_1->os_cert_handle()));
167 EXPECT_FALSE(test_roots->Contains(root_cert_2->os_cert_handle())); 167 EXPECT_FALSE(test_roots->Contains(root_cert_2->os_cert_handle()));
168 } 168 }
169 #endif 169 #endif
170 170
171 // TODO(rsleevi): Add tests for revocation checking via CRLs, ensuring that 171 // TODO(rsleevi): Add tests for revocation checking via CRLs, ensuring that
172 // TestRootCerts properly injects itself into the validation process. See 172 // TestRootCerts properly injects itself into the validation process. See
173 // http://crbug.com/63958 173 // http://crbug.com/63958
174 174
175 } // namespace net 175 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/test_root_certs.h ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698