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

Unified Diff: ios/web/net/cert_host_pair.cc

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 Win & iOS 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
Index: ios/web/net/cert_host_pair.cc
diff --git a/ios/web/net/cert_host_pair.cc b/ios/web/net/cert_host_pair.cc
index 569a77b734275f382713f3abdb3870c376b3305e..826608c3ea35a0aac5dcbbaccdc818785aa32daa 100644
--- a/ios/web/net/cert_host_pair.cc
+++ b/ios/web/net/cert_host_pair.cc
@@ -10,7 +10,11 @@ namespace web {
CertHostPair::CertHostPair(const scoped_refptr<net::X509Certificate>& cert,
const std::string& host)
- : cert(cert), host(host) {}
+ : cert(cert),
+ host(host),
+ cert_hash(net::X509Certificate::CalculateChainFingerprint256(
+ cert->os_cert_handle(),
+ cert->GetIntermediateCertificates())) {}
CertHostPair::CertHostPair(const CertHostPair& other) = default;
@@ -19,7 +23,7 @@ CertHostPair::~CertHostPair() {}
bool CertHostPair::operator<(const CertHostPair& other) const {
if (host != other.host)
return host < other.host;
- return net::X509Certificate::LessThan()(cert, other.cert);
+ return net::SHA256HashValueLessThan()(cert_hash, other.cert_hash);
}
} // web

Powered by Google App Engine
This is Rietveld 408576698