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

Unified Diff: net/cert/internal/verify_certificate_chain.h

Issue 2800993002: Add a key purpose parameter to Certificate PathBuilder. (Closed)
Patch Set: rebase 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
« no previous file with comments | « net/cert/internal/trust_store.h ('k') | net/cert/internal/verify_certificate_chain.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/verify_certificate_chain.h
diff --git a/net/cert/internal/verify_certificate_chain.h b/net/cert/internal/verify_certificate_chain.h
index 5ebecb5e0ad57f6d46e6e3e0637bb25df4a46406..7abeede6dd46cdc13c16fca22b53fd6415f00d61 100644
--- a/net/cert/internal/verify_certificate_chain.h
+++ b/net/cert/internal/verify_certificate_chain.h
@@ -23,6 +23,13 @@ struct GeneralizedTime;
class SignaturePolicy;
class TrustAnchor;
+// The key purpose (extended key usage) to check for during verification.
+enum class KeyPurpose {
+ ANY_EKU,
+ SERVER_AUTH,
+ CLIENT_AUTH,
+};
+
// VerifyCertificateChain() verifies a certificate path (chain) based on the
// rules in RFC 5280. The caller is responsible for building the path and
// finding the trust anchor.
@@ -56,6 +63,9 @@ class TrustAnchor;
// time:
// The UTC time to use for expiration checks.
//
+// key_purpose:
+// The key purpose that the target certificate needs to be valid for.
+//
// ---------
// Outputs
// ---------
@@ -72,6 +82,7 @@ NET_EXPORT bool VerifyCertificateChain(const ParsedCertificateList& certs,
const TrustAnchor* trust_anchor,
const SignaturePolicy* signature_policy,
const der::GeneralizedTime& time,
+ KeyPurpose required_key_purpose,
CertPathErrors* errors);
// TODO(crbug.com/634443): Move exported errors to a central location?
« no previous file with comments | « net/cert/internal/trust_store.h ('k') | net/cert/internal/verify_certificate_chain.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698