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/verify_certificate_chain.h" | 5 #include "net/cert/internal/verify_certificate_chain.h" |
6 | 6 |
7 #include "net/cert/internal/parsed_certificate.h" | 7 #include "net/cert/internal/parsed_certificate.h" |
8 #include "net/cert/internal/signature_policy.h" | 8 #include "net/cert/internal/signature_policy.h" |
9 #include "net/cert/internal/trust_store.h" | 9 #include "net/cert/internal/trust_store.h" |
10 #include "net/der/input.h" | 10 #include "net/der/input.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 scoped_refptr<TrustAnchor> trust_anchor = | 68 scoped_refptr<TrustAnchor> trust_anchor = |
69 TrustAnchor::CreateFromCertificateNoConstraints(input_chain.back()); | 69 TrustAnchor::CreateFromCertificateNoConstraints(input_chain.back()); |
70 input_chain.pop_back(); | 70 input_chain.pop_back(); |
71 | 71 |
72 SimpleSignaturePolicy signature_policy(1024); | 72 SimpleSignaturePolicy signature_policy(1024); |
73 | 73 |
74 // Run all tests at the time the PKITS was published. | 74 // Run all tests at the time the PKITS was published. |
75 der::GeneralizedTime time = {2011, 4, 15, 0, 0, 0}; | 75 der::GeneralizedTime time = {2011, 4, 15, 0, 0, 0}; |
76 | 76 |
| 77 bool result = VerifyCertificateChain(input_chain, trust_anchor.get(), |
| 78 &signature_policy, time, &errors); |
| 79 |
77 // TODO(crbug.com/634443): Test errors on failure? | 80 // TODO(crbug.com/634443): Test errors on failure? |
78 return VerifyCertificateChain(input_chain, trust_anchor.get(), | 81 if (!result) |
79 &signature_policy, time, &errors); | 82 EXPECT_FALSE(errors.empty()); |
| 83 |
| 84 return result; |
80 } | 85 } |
81 }; | 86 }; |
82 | 87 |
83 } // namespace | 88 } // namespace |
84 | 89 |
85 class PkitsTest01SignatureVerificationCustom | 90 class PkitsTest01SignatureVerificationCustom |
86 : public PkitsTest<VerifyCertificateChainPkitsTestDelegate> {}; | 91 : public PkitsTest<VerifyCertificateChainPkitsTestDelegate> {}; |
87 | 92 |
88 // Modified version of 4.1.4 Valid DSA Signatures Test4 | 93 // Modified version of 4.1.4 Valid DSA Signatures Test4 |
89 TEST_F(PkitsTest01SignatureVerificationCustom, | 94 TEST_F(PkitsTest01SignatureVerificationCustom, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 210 |
206 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests, | 211 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests, |
207 // PkitsTest05VerifyingPathswithSelfIssuedCertificates, | 212 // PkitsTest05VerifyingPathswithSelfIssuedCertificates, |
208 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs | 213 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs |
209 | 214 |
210 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies, | 215 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies, |
211 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings, | 216 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings, |
212 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy | 217 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy |
213 | 218 |
214 } // namespace net | 219 } // namespace net |
OLD | NEW |