OLD | NEW |
---|---|
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
64 | 64 |
65 // Test that TestRootCerts actually adds the appropriate trust status flags | 65 // Test that TestRootCerts actually adds the appropriate trust status flags |
66 // when requested, and that the trusted status is cleared once the root is | 66 // when requested, and that the trusted status is cleared once the root is |
67 // removed the TestRootCerts. This test acts as a canary/sanity check for | 67 // removed the TestRootCerts. This test acts as a canary/sanity check for |
68 // the results of the rest of net_unittests, ensuring that the trust status | 68 // the results of the rest of net_unittests, ensuring that the trust status |
69 // is properly being set and cleared. | 69 // is properly being set and cleared. |
70 TEST(TestRootCertsTest, OverrideTrust) { | 70 TEST(TestRootCertsTest, OverrideTrust) { |
71 #if defined(USE_NSS) || defined(OS_IOS) | 71 #if defined(USE_NSS) || defined(OS_IOS) |
72 if (NSS_VersionCheck("3.14.2") && !NSS_VersionCheck("3.15")) { | 72 if (NSS_VersionCheck("3.14.2") && !NSS_VersionCheck("3.15")) { |
73 // See http://bugzil.la/863947 for details | 73 // See http://bugzil.la/863947 for details |
74 LOG(INFO) << "Skipping test for NSS 3.14.2 - NSS 3.15"; | 74 VLOG(0) << "Skipping test for NSS 3.14.2 - NSS 3.15"; |
Ryan Sleevi
2013/11/25 01:08:32
and this
scottmg
2013/11/25 17:12:38
Done.
| |
75 return; | 75 return; |
76 } | 76 } |
77 #endif | 77 #endif |
78 | 78 |
79 TestRootCerts* test_roots = TestRootCerts::GetInstance(); | 79 TestRootCerts* test_roots = TestRootCerts::GetInstance(); |
80 ASSERT_NE(static_cast<TestRootCerts*>(NULL), test_roots); | 80 ASSERT_NE(static_cast<TestRootCerts*>(NULL), test_roots); |
81 EXPECT_TRUE(test_roots->IsEmpty()); | 81 EXPECT_TRUE(test_roots->IsEmpty()); |
82 | 82 |
83 scoped_refptr<X509Certificate> test_cert = | 83 scoped_refptr<X509Certificate> test_cert = |
84 ImportCertFromFile(GetTestCertsDirectory(), kGoodCertificateFile); | 84 ImportCertFromFile(GetTestCertsDirectory(), kGoodCertificateFile); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 // TODO(rsleevi): Add tests for revocation checking via CRLs, ensuring that | 138 // TODO(rsleevi): Add tests for revocation checking via CRLs, ensuring that |
139 // TestRootCerts properly injects itself into the validation process. See | 139 // TestRootCerts properly injects itself into the validation process. See |
140 // http://crbug.com/63958 | 140 // http://crbug.com/63958 |
141 | 141 |
142 } // namespace net | 142 } // namespace net |
OLD | NEW |