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

Unified Diff: net/cert/cert_verify_proc_mac.cc

Issue 2803513003: Remove ParsedCertificate::unparsed_extensions(). (Closed)
Patch Set: remove unused 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 | « components/cast_certificate/cast_cert_validator.cc ('k') | net/cert/internal/parsed_certificate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/cert_verify_proc_mac.cc
diff --git a/net/cert/cert_verify_proc_mac.cc b/net/cert/cert_verify_proc_mac.cc
index 6df97256f728064db228bc99fc770b506bbb9aa4..6e1f8d6322dab4be2a80df7563f0d5ce5331e4f1 100644
--- a/net/cert/cert_verify_proc_mac.cc
+++ b/net/cert/cert_verify_proc_mac.cc
@@ -278,34 +278,14 @@ bool IsWeakChainBasedOnHashingAlgorithms(
return !leaf_uses_weak_hash && intermediates_contain_weak_hash;
}
-using ExtensionsMap = std::map<net::der::Input, net::ParsedExtension>;
-
-// Helper that looks up an extension by OID given a map of extensions.
-bool GetExtensionValue(const ExtensionsMap& extensions,
- const net::der::Input& oid,
- net::der::Input* value) {
- auto it = extensions.find(oid);
- if (it == extensions.end())
- return false;
- *value = it->second.value;
- return true;
-}
-
// Checks if |*cert| has a Certificate Policies extension containing either
// of |ev_policy_oid| or anyPolicy.
bool HasPolicyOrAnyPolicy(const ParsedCertificate* cert,
const der::Input& ev_policy_oid) {
- der::Input extension_value;
- if (!GetExtensionValue(cert->unparsed_extensions(), CertificatePoliciesOid(),
- &extension_value)) {
- return false;
- }
-
- std::vector<der::Input> policies;
- if (!ParseCertificatePoliciesExtension(extension_value, &policies))
+ if (!cert->has_policy_oids())
return false;
- for (const der::Input& policy_oid : policies) {
+ for (const der::Input& policy_oid : cert->policy_oids()) {
if (policy_oid == ev_policy_oid || policy_oid == AnyPolicy())
return true;
}
@@ -329,18 +309,11 @@ void GetCandidateEVPolicy(const X509Certificate* cert_input,
if (!cert)
return;
- der::Input extension_value;
- if (!GetExtensionValue(cert->unparsed_extensions(), CertificatePoliciesOid(),
- &extension_value)) {
- return;
- }
-
- std::vector<der::Input> policies;
- if (!ParseCertificatePoliciesExtension(extension_value, &policies))
+ if (!cert->has_policy_oids())
return;
EVRootCAMetadata* metadata = EVRootCAMetadata::GetInstance();
- for (const der::Input& policy_oid : policies) {
+ for (const der::Input& policy_oid : cert->policy_oids()) {
if (metadata->IsEVPolicyOID(policy_oid)) {
*ev_policy_oid = policy_oid.AsString();
« no previous file with comments | « components/cast_certificate/cast_cert_validator.cc ('k') | net/cert/internal/parsed_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698