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

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

Issue 2252933002: Make TrustStore into an interface, move impl to TrustStoreInMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update cast_cert_validator_unittest.cc Created 4 years, 4 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/path_builder.h" 5 #include "net/cert/internal/path_builder.h"
6 6
7 #include "net/base/net_errors.h" 7 #include "net/base/net_errors.h"
8 #include "net/cert/internal/cert_issuer_source_static.h" 8 #include "net/cert/internal/cert_issuer_source_static.h"
9 #include "net/cert/internal/parse_certificate.h" 9 #include "net/cert/internal/parse_certificate.h"
10 #include "net/cert/internal/parsed_certificate.h" 10 #include "net/cert/internal/parsed_certificate.h"
11 #include "net/cert/internal/signature_policy.h" 11 #include "net/cert/internal/signature_policy.h"
12 #include "net/cert/internal/trust_store.h" 12 #include "net/cert/internal/trust_store_in_memory.h"
13 #include "net/cert/internal/verify_certificate_chain.h" 13 #include "net/cert/internal/verify_certificate_chain.h"
14 #include "net/der/input.h" 14 #include "net/der/input.h"
15 15
16 // Disable tests that require DSA signatures (DSA signatures are intentionally 16 // Disable tests that require DSA signatures (DSA signatures are intentionally
17 // unsupported). Custom versions of the DSA tests are defined below which expect 17 // unsupported). Custom versions of the DSA tests are defined below which expect
18 // verification to fail. 18 // verification to fail.
19 #define Section1ValidDSASignaturesTest4 DISABLED_Section1ValidDSASignaturesTest4 19 #define Section1ValidDSASignaturesTest4 DISABLED_Section1ValidDSASignaturesTest4
20 #define Section1ValidDSAParameterInheritanceTest5 \ 20 #define Section1ValidDSAParameterInheritanceTest5 \
21 DISABLED_Section1ValidDSAParameterInheritanceTest5 21 DISABLED_Section1ValidDSAParameterInheritanceTest5
22 22
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ParsedCertificateList certs; 59 ParsedCertificateList certs;
60 for (const std::string& der : cert_ders) { 60 for (const std::string& der : cert_ders) {
61 certs.push_back(ParsedCertificate::CreateFromCertificateCopy(der, {})); 61 certs.push_back(ParsedCertificate::CreateFromCertificateCopy(der, {}));
62 if (!certs.back()) { 62 if (!certs.back()) {
63 ADD_FAILURE() << "ParsedCertificate::CreateFromCertificateCopy failed"; 63 ADD_FAILURE() << "ParsedCertificate::CreateFromCertificateCopy failed";
64 return false; 64 return false;
65 } 65 }
66 } 66 }
67 // First entry in the PKITS chain is the trust anchor. 67 // First entry in the PKITS chain is the trust anchor.
68 // TODO(mattm): test with all possible trust anchors in the trust store? 68 // TODO(mattm): test with all possible trust anchors in the trust store?
69 TrustStore trust_store; 69 TrustStoreInMemory trust_store;
70 70
71 scoped_refptr<TrustAnchor> trust_anchor = 71 scoped_refptr<TrustAnchor> trust_anchor =
72 TrustAnchor::CreateFromCertificateNoConstraints(certs[0]); 72 TrustAnchor::CreateFromCertificateNoConstraints(certs[0]);
73 trust_store.AddTrustAnchor(std::move(trust_anchor)); 73 trust_store.AddTrustAnchor(std::move(trust_anchor));
74 74
75 // TODO(mattm): test with other irrelevant certs in cert_issuer_sources? 75 // TODO(mattm): test with other irrelevant certs in cert_issuer_sources?
76 CertIssuerSourceStatic cert_issuer_source; 76 CertIssuerSourceStatic cert_issuer_source;
77 for (size_t i = 1; i < cert_ders.size() - 1; ++i) 77 for (size_t i = 1; i < cert_ders.size() - 1; ++i)
78 cert_issuer_source.AddCert(certs[i]); 78 cert_issuer_source.AddCert(certs[i]);
79 79
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests, 222 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests,
223 // PkitsTest05VerifyingPathswithSelfIssuedCertificates, 223 // PkitsTest05VerifyingPathswithSelfIssuedCertificates,
224 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs 224 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs
225 225
226 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies, 226 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies,
227 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings, 227 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings,
228 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy 228 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy
229 229
230 } // namespace net 230 } // namespace net
OLDNEW
« no previous file with comments | « components/cast_certificate/cast_crl_unittest.cc ('k') | net/cert/internal/path_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698