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

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

Issue 2126803004: WIP: NSS trust store integration for path builder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cert-command-line-path-builder-add_certpathbuilder
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/cert/internal/path_builder.cc ('k') | net/cert/internal/path_builder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/path_builder_pkits_unittest.cc
diff --git a/net/cert/internal/path_builder_pkits_unittest.cc b/net/cert/internal/path_builder_pkits_unittest.cc
index a046d1cfe3029b1ae39374e89d3423c8e96b5e27..214950d6d7bb56efd51d65dc67cc6b7bafaae224 100644
--- a/net/cert/internal/path_builder_pkits_unittest.cc
+++ b/net/cert/internal/path_builder_pkits_unittest.cc
@@ -9,7 +9,7 @@
#include "net/cert/internal/parse_certificate.h"
#include "net/cert/internal/parsed_certificate.h"
#include "net/cert/internal/signature_policy.h"
-#include "net/cert/internal/trust_store.h"
+#include "net/cert/internal/trust_store_static.h"
#include "net/cert/internal/verify_certificate_chain.h"
#include "net/der/input.h"
@@ -66,13 +66,13 @@ class PathBuilderPkitsTestDelegate {
}
// First entry in the PKITS chain is the trust anchor.
// TODO(mattm): test with all possible trust anchors in the trust store?
- TrustStore trust_store;
+ TrustStoreStatic trust_store;
trust_store.AddTrustedCertificate(certs[0]);
// TODO(mattm): test with other irrelevant certs in cert_issuer_sources?
CertIssuerSourceStatic cert_issuer_source;
- for (size_t i = 1; i < cert_ders.size() - 1; ++i)
- cert_issuer_source.AddCert(certs[i]);
+ for (const auto& cert : certs)
+ cert_issuer_source.AddCert(cert);
scoped_refptr<ParsedCertificate> target_cert(certs.back());
@@ -82,8 +82,9 @@ class PathBuilderPkitsTestDelegate {
der::GeneralizedTime time = {2011, 4, 15, 0, 0, 0};
CertPathBuilder::Result result;
- CertPathBuilder path_builder(std::move(target_cert), &trust_store,
- &signature_policy, time, &result);
+ CertPathBuilder path_builder(std::move(target_cert), &signature_policy,
+ time, &result);
+ path_builder.AddTrustStore(&trust_store);
path_builder.AddCertIssuerSource(&cert_issuer_source);
CompletionStatus rv = path_builder.Run(base::Closure());
« no previous file with comments | « net/cert/internal/path_builder.cc ('k') | net/cert/internal/path_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698