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

Unified Diff: ios/web/navigation/crw_session_certificate_policy_manager.mm

Issue 2000503002: Remove the fingerprint and ca_fingerprint from X509Certificate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_cache
Patch Set: Fix IDN test Created 4 years, 6 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 | « content/browser/cert_store_impl.cc ('k') | ios/web/net/cert_host_pair.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/navigation/crw_session_certificate_policy_manager.mm
diff --git a/ios/web/navigation/crw_session_certificate_policy_manager.mm b/ios/web/navigation/crw_session_certificate_policy_manager.mm
index 5be4bae8bc40e9646c290accbd925faaec6c451a..beac71dc6691095d6685295ee546f3a66b60a9d1 100644
--- a/ios/web/navigation/crw_session_certificate_policy_manager.mm
+++ b/ios/web/navigation/crw_session_certificate_policy_manager.mm
@@ -13,6 +13,7 @@
#include "base/strings/sys_string_conversions.h"
#include "ios/web/public/certificate_policy_cache.h"
#include "ios/web/public/web_thread.h"
+#include "net/base/hash_value.h"
#include "net/cert/x509_certificate.h"
// Break if we detect that CertStatus values changed, because we persist them on
@@ -50,6 +51,7 @@ NSString* const kAllowedCertificatesKey = @"allowedCertificates";
struct AllowedCertificate {
scoped_refptr<net::X509Certificate> certificate;
+ net::SHA256HashValue certificateHash;
std::string host;
};
@@ -59,10 +61,10 @@ class LessThan {
const AllowedCertificate& rhs) const {
if (lhs.host != rhs.host)
return lhs.host < rhs.host;
- return certificateCompare_(lhs.certificate, rhs.certificate);
+ return hash_compare_(lhs.certificateHash, rhs.certificateHash);
}
private:
- net::X509Certificate::LessThan certificateCompare_;
+ net::SHA256HashValueLessThan hash_compare_;
};
typedef std::map<AllowedCertificate, net::CertStatus, LessThan>
@@ -105,7 +107,11 @@ void AddToCertificatePolicyCache(
status:(net::CertStatus)status {
DCHECK([NSThread isMainThread]);
DCHECK(certificate);
- AllowedCertificate allowedCertificate = {certificate, host};
+ AllowedCertificate allowedCertificate = {
+ certificate, net::X509Certificate::CalculateChainFingerprint256(
+ certificate->os_cert_handle(),
+ certificate->GetIntermediateCertificates()),
+ host};
allowed_[allowedCertificate] = status;
}
« no previous file with comments | « content/browser/cert_store_impl.cc ('k') | ios/web/net/cert_host_pair.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698