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

Side by Side Diff: net/cert/internal/verify_certificate_chain_pkits_unittest.cc

Issue 2800993002: Add a key purpose parameter to Certificate PathBuilder. (Closed)
Patch Set: rebase Created 3 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
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 TrustAnchor::CreateFromCertificateNoConstraints(input_chain.back()); 74 TrustAnchor::CreateFromCertificateNoConstraints(input_chain.back());
75 input_chain.pop_back(); 75 input_chain.pop_back();
76 76
77 SimpleSignaturePolicy signature_policy(1024); 77 SimpleSignaturePolicy signature_policy(1024);
78 78
79 // Run all tests at the time the PKITS was published. 79 // Run all tests at the time the PKITS was published.
80 der::GeneralizedTime time = {2011, 4, 15, 0, 0, 0}; 80 der::GeneralizedTime time = {2011, 4, 15, 0, 0, 0};
81 81
82 CertPathErrors path_errors; 82 CertPathErrors path_errors;
83 bool result = VerifyCertificateChain(input_chain, trust_anchor.get(), 83 bool result = VerifyCertificateChain(input_chain, trust_anchor.get(),
84 &signature_policy, time, &path_errors); 84 &signature_policy, time,
85 KeyPurpose::ANY_EKU, &path_errors);
85 86
86 // TODO(crbug.com/634443): Test errors on failure? 87 // TODO(crbug.com/634443): Test errors on failure?
87 EXPECT_EQ(result, !path_errors.ContainsHighSeverityErrors()); 88 EXPECT_EQ(result, !path_errors.ContainsHighSeverityErrors());
88 return result; 89 return result;
89 } 90 }
90 }; 91 };
91 92
92 } // namespace 93 } // namespace
93 94
94 class PkitsTest01SignatureVerificationCustom 95 class PkitsTest01SignatureVerificationCustom
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 215
215 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests, 216 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests,
216 // PkitsTest05VerifyingPathswithSelfIssuedCertificates, 217 // PkitsTest05VerifyingPathswithSelfIssuedCertificates,
217 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs 218 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs
218 219
219 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies, 220 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies,
220 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings, 221 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings,
221 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy 222 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy
222 223
223 } // namespace net 224 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/internal/verify_certificate_chain.cc ('k') | net/cert/internal/verify_certificate_chain_typed_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698