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/path_builder.h" | 5 #include "net/cert/internal/path_builder.h" |
6 | 6 |
7 #include "net/cert/internal/cert_issuer_source_static.h" | 7 #include "net/cert/internal/cert_issuer_source_static.h" |
8 #include "net/cert/internal/signature_policy.h" | 8 #include "net/cert/internal/signature_policy.h" |
9 #include "net/cert/internal/trust_store_in_memory.h" | 9 #include "net/cert/internal/trust_store_in_memory.h" |
10 #include "net/cert/internal/verify_certificate_chain_typed_unittest.h" | 10 #include "net/cert/internal/verify_certificate_chain_typed_unittest.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 CertIssuerSourceStatic intermediate_cert_issuer_source; | 30 CertIssuerSourceStatic intermediate_cert_issuer_source; |
31 for (size_t i = 1; i < chain.size(); ++i) | 31 for (size_t i = 1; i < chain.size(); ++i) |
32 intermediate_cert_issuer_source.AddCert(chain[i]); | 32 intermediate_cert_issuer_source.AddCert(chain[i]); |
33 | 33 |
34 CertPathBuilder::Result result; | 34 CertPathBuilder::Result result; |
35 // First cert in the |chain| is the target. | 35 // First cert in the |chain| is the target. |
36 CertPathBuilder path_builder(chain.front(), &trust_store, &signature_policy, | 36 CertPathBuilder path_builder(chain.front(), &trust_store, &signature_policy, |
37 time, &result); | 37 time, &result); |
38 path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source); | 38 path_builder.AddCertIssuerSource(&intermediate_cert_issuer_source); |
39 | 39 |
40 CompletionStatus rv = path_builder.Run(base::Closure()); | 40 path_builder.Run(); |
41 EXPECT_EQ(CompletionStatus::SYNC, rv); | |
42 | |
43 EXPECT_EQ(expected_result, result.HasValidPath()); | 41 EXPECT_EQ(expected_result, result.HasValidPath()); |
44 } | 42 } |
45 }; | 43 }; |
46 | 44 |
47 } // namespace | 45 } // namespace |
48 | 46 |
49 INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder, | 47 INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder, |
50 VerifyCertificateChainSingleRootTest, | 48 VerifyCertificateChainSingleRootTest, |
51 PathBuilderDelegate); | 49 PathBuilderDelegate); |
52 | 50 |
53 } // namespace net | 51 } // namespace net |
OLD | NEW |