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

Unified Diff: net/cert/internal/path_builder_verify_certificate_chain_unittest.cc

Issue 2832703002: Allow the TrustStore interface to return matching intermediates, and identify distrusted certs. (Closed)
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
Index: net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
diff --git a/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc b/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
index 43ba879a971987274d56fedf2589d42e651e6940..09fda9c96cc614c83e4955a57c4d3cd7c90eab84 100644
--- a/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
+++ b/net/cert/internal/path_builder_verify_certificate_chain_unittest.cc
@@ -21,7 +21,21 @@ class PathBuilderDelegate {
ASSERT_FALSE(test.chain.empty());
TrustStoreInMemory trust_store;
- trust_store.AddTrustAnchor(test.trust_anchor);
+
+ switch (test.last_cert_trust.type) {
+ case CertificateTrustType::TRUSTED_ANCHOR:
+ trust_store.AddTrustAnchor(test.chain.back());
+ break;
+ case CertificateTrustType::TRUSTED_ANCHOR_WITH_CONSTRAINTS:
+ trust_store.AddTrustAnchorWithConstraints(test.chain.back());
+ break;
+ case CertificateTrustType::UNSPECIFIED:
+ LOG(ERROR) << "Unexpected CertificateTrustType";
+ break;
+ case CertificateTrustType::DISTRUSTED:
+ trust_store.AddDistrustedCertificateForTest(test.chain.back());
+ break;
+ }
CertIssuerSourceStatic intermediate_cert_issuer_source;
for (size_t i = 1; i < test.chain.size(); ++i)

Powered by Google App Engine
This is Rietveld 408576698