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/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" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 {}, &certs, &errors)) { | 67 {}, &certs, &errors)) { |
68 ADD_FAILURE() << "ParseCertificate::CreateAndAddToVector() failed:\n" | 68 ADD_FAILURE() << "ParseCertificate::CreateAndAddToVector() failed:\n" |
69 << errors.ToDebugString(); | 69 << errors.ToDebugString(); |
70 return false; | 70 return false; |
71 } | 71 } |
72 } | 72 } |
73 // First entry in the PKITS chain is the trust anchor. | 73 // First entry in the PKITS chain is the trust anchor. |
74 // TODO(mattm): test with all possible trust anchors in the trust store? | 74 // TODO(mattm): test with all possible trust anchors in the trust store? |
75 TrustStoreInMemory trust_store; | 75 TrustStoreInMemory trust_store; |
76 | 76 |
77 scoped_refptr<TrustAnchor> trust_anchor = | 77 trust_store.AddTrustAnchor(certs[0]); |
78 TrustAnchor::CreateFromCertificateNoConstraints(certs[0]); | |
79 trust_store.AddTrustAnchor(std::move(trust_anchor)); | |
80 | 78 |
81 // TODO(mattm): test with other irrelevant certs in cert_issuer_sources? | 79 // TODO(mattm): test with other irrelevant certs in cert_issuer_sources? |
82 CertIssuerSourceStatic cert_issuer_source; | 80 CertIssuerSourceStatic cert_issuer_source; |
83 for (size_t i = 1; i < cert_ders.size() - 1; ++i) | 81 for (size_t i = 1; i < cert_ders.size() - 1; ++i) |
84 cert_issuer_source.AddCert(certs[i]); | 82 cert_issuer_source.AddCert(certs[i]); |
85 | 83 |
86 scoped_refptr<ParsedCertificate> target_cert(certs.back()); | 84 scoped_refptr<ParsedCertificate> target_cert(certs.back()); |
87 | 85 |
88 SimpleSignaturePolicy signature_policy(1024); | 86 SimpleSignaturePolicy signature_policy(1024); |
89 | 87 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 225 |
228 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests, | 226 // TODO(mattm): CRL support: PkitsTest04BasicCertificateRevocationTests, |
229 // PkitsTest05VerifyingPathswithSelfIssuedCertificates, | 227 // PkitsTest05VerifyingPathswithSelfIssuedCertificates, |
230 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs | 228 // PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs |
231 | 229 |
232 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies, | 230 // TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies, |
233 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings, | 231 // PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings, |
234 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy | 232 // PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy |
235 | 233 |
236 } // namespace net | 234 } // namespace net |
OLD | NEW |