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

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

Issue 2898303005: Wire up certificate policies support in PathBuilder. (Closed)
Patch Set: remove extra space Created 3 years, 7 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 5b14575ea91eb9b77aa513114dae8edca7a99b0f..18a64452fa7f2a53eb9b962eb0cbaa196e29dd67 100644
--- a/net/cert/internal/path_builder_pkits_unittest.cc
+++ b/net/cert/internal/path_builder_pkits_unittest.cc
@@ -81,14 +81,21 @@ class PathBuilderPkitsTestDelegate {
SimpleSignaturePolicy signature_policy(1024);
CertPathBuilder::Result result;
- CertPathBuilder path_builder(std::move(target_cert), &trust_store,
- &signature_policy, info.time,
- KeyPurpose::ANY_EKU, &result);
+ CertPathBuilder path_builder(
+ std::move(target_cert), &trust_store, &signature_policy, info.time,
+ KeyPurpose::ANY_EKU, info.initial_explicit_policy,
+ info.initial_policy_set, info.initial_policy_mapping_inhibit,
+ info.initial_inhibit_any_policy, &result);
path_builder.AddCertIssuerSource(&cert_issuer_source);
path_builder.Run();
ASSERT_EQ(info.should_validate, result.HasValidPath());
+
+ if (result.HasValidPath()) {
+ EXPECT_EQ(info.user_constrained_policy_set,
+ result.GetBestValidPath()->user_constrained_policy_set);
+ }
}
};
@@ -232,6 +239,21 @@ INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
PkitsTest07KeyUsage,
PathBuilderPkitsTestDelegate);
+INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
+ PkitsTest08CertificatePolicies,
+ PathBuilderPkitsTestDelegate);
+INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
+ PkitsTest09RequireExplicitPolicy,
+ PathBuilderPkitsTestDelegate);
+INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
+ PkitsTest10PolicyMappings,
+ PathBuilderPkitsTestDelegate);
+INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
+ PkitsTest11InhibitPolicyMapping,
+ PathBuilderPkitsTestDelegate);
+INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
+ PkitsTest12InhibitAnyPolicy,
+ PathBuilderPkitsTestDelegate);
INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
PkitsTest13NameConstraints,
PathBuilderPkitsTestDelegate);
@@ -243,8 +265,4 @@ INSTANTIATE_TYPED_TEST_CASE_P(PathBuilder,
// PkitsTest05VerifyingPathswithSelfIssuedCertificates,
// PkitsTest14DistributionPoints, PkitsTest15DeltaCRLs
-// TODO(mattm): Certificate Policies support: PkitsTest08CertificatePolicies,
-// PkitsTest09RequireExplicitPolicy PkitsTest10PolicyMappings,
-// PkitsTest11InhibitPolicyMapping, PkitsTest12InhibitAnyPolicy
-
} // namespace net
« 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