OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/cert/internal/trust_store_nss.h" | 5 #include "net/cert/internal/trust_store_nss.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 class TrustStoreNSSTest : public testing::Test { | 30 class TrustStoreNSSTest : public testing::Test { |
31 public: | 31 public: |
32 void SetUp() override { | 32 void SetUp() override { |
33 ASSERT_TRUE(test_nssdb_.is_open()); | 33 ASSERT_TRUE(test_nssdb_.is_open()); |
34 | 34 |
35 ParsedCertificateList chain; | 35 ParsedCertificateList chain; |
36 bool unused_verify_result; | 36 bool unused_verify_result; |
37 der::GeneralizedTime unused_time; | 37 der::GeneralizedTime unused_time; |
38 std::string unused_errors; | 38 std::string unused_errors; |
39 | 39 |
40 ReadVerifyCertChainTestFromFile("key-rollover-oldchain.pem", &chain, | 40 ReadVerifyCertChainTestFromFile( |
41 &oldroot_, &unused_time, | 41 "net/data/verify_certificate_chain_unittest/key-rollover-oldchain.pem", |
42 &unused_verify_result, &unused_errors); | 42 &chain, &oldroot_, &unused_time, &unused_verify_result, &unused_errors); |
43 ASSERT_EQ(2U, chain.size()); | 43 ASSERT_EQ(2U, chain.size()); |
44 target_ = chain[0]; | 44 target_ = chain[0]; |
45 oldintermediate_ = chain[1]; | 45 oldintermediate_ = chain[1]; |
46 ASSERT_TRUE(target_); | 46 ASSERT_TRUE(target_); |
47 ASSERT_TRUE(oldintermediate_); | 47 ASSERT_TRUE(oldintermediate_); |
48 ASSERT_TRUE(oldroot_); | 48 ASSERT_TRUE(oldroot_); |
49 | 49 |
50 scoped_refptr<TrustAnchor> unused_root; | 50 scoped_refptr<TrustAnchor> unused_root; |
51 ReadVerifyCertChainTestFromFile("key-rollover-longrolloverchain.pem", | 51 ReadVerifyCertChainTestFromFile( |
52 &chain, &unused_root, &unused_time, | 52 "net/data/verify_certificate_chain_unittest/" |
53 &unused_verify_result, &unused_errors); | 53 "key-rollover-longrolloverchain.pem", |
| 54 &chain, &unused_root, &unused_time, &unused_verify_result, |
| 55 &unused_errors); |
54 ASSERT_EQ(4U, chain.size()); | 56 ASSERT_EQ(4U, chain.size()); |
55 newintermediate_ = chain[1]; | 57 newintermediate_ = chain[1]; |
56 newroot_ = TrustAnchor::CreateFromCertificateNoConstraints(chain[2]); | 58 newroot_ = TrustAnchor::CreateFromCertificateNoConstraints(chain[2]); |
57 newrootrollover_ = chain[3]; | 59 newrootrollover_ = chain[3]; |
58 ASSERT_TRUE(newintermediate_); | 60 ASSERT_TRUE(newintermediate_); |
59 ASSERT_TRUE(newroot_); | 61 ASSERT_TRUE(newroot_); |
60 ASSERT_TRUE(newrootrollover_); | 62 ASSERT_TRUE(newrootrollover_); |
61 | 63 |
62 trust_store_nss_.reset( | 64 trust_store_nss_.reset( |
63 new TrustStoreNSS(trustSSL, base::ThreadTaskRunnerHandle::Get())); | 65 new TrustStoreNSS(trustSSL, base::ThreadTaskRunnerHandle::Get())); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 &sync_matches, &req); | 239 &sync_matches, &req); |
238 ASSERT_TRUE(req); | 240 ASSERT_TRUE(req); |
239 run_loop.Run(); | 241 run_loop.Run(); |
240 ASSERT_FALSE(req); | 242 ASSERT_FALSE(req); |
241 base::RunLoop().RunUntilIdle(); | 243 base::RunLoop().RunUntilIdle(); |
242 } | 244 } |
243 | 245 |
244 } // namespace | 246 } // namespace |
245 | 247 |
246 } // namespace net | 248 } // namespace net |
OLD | NEW |