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 |