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

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: I'm an idiot 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..ecab91d0e298a5d38db9ce5a86ec0932208b332f 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 hashCompare_(lhs.certificateHash, rhs.certificateHash);
eroman 2016/06/09 23:16:17 Why is it that we don't just have an operator<() o
}
private:
- net::X509Certificate::LessThan certificateCompare_;
+ const net::SHA256HashValueLessThan hashCompare_;
};
typedef std::map<AllowedCertificate, net::CertStatus, LessThan>
@@ -105,7 +107,10 @@ void AddToCertificatePolicyCache(
status:(net::CertStatus)status {
DCHECK([NSThread isMainThread]);
DCHECK(certificate);
- AllowedCertificate allowedCertificate = {certificate, host};
+ AllowedCertificate allowedCertificate = {
+ certificate, host, net::X509Certificate::CalculateChainFingerprint256(
+ certificate->os_cert_handle(),
+ certificate->GetIntermediateCertificates())};
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