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

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 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 | « ios/web/net/cert_host_pair.h ('k') | ios/web/net/cert_host_pair_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9a47dbd75e85b0d0494155b6c9632e12c5dd6b54 100644
--- a/ios/web/net/cert_host_pair.cc
+++ b/ios/web/net/cert_host_pair.cc
@@ -8,18 +8,22 @@
namespace web {
-CertHostPair::CertHostPair(const scoped_refptr<net::X509Certificate>& cert,
- const std::string& host)
- : cert(cert), host(host) {}
+CertHostPair::CertHostPair(scoped_refptr<net::X509Certificate> cert,
+ std::string host)
+ : cert_(std::move(cert)),
+ host_(std::move(host)),
+ cert_hash_(net::X509Certificate::CalculateChainFingerprint256(
+ cert_->os_cert_handle(),
+ cert_->GetIntermediateCertificates())) {}
CertHostPair::CertHostPair(const CertHostPair& other) = default;
CertHostPair::~CertHostPair() {}
bool CertHostPair::operator<(const CertHostPair& other) const {
- if (host != other.host)
- return host < other.host;
- return net::X509Certificate::LessThan()(cert, other.cert);
+ if (host_ != other.host_)
+ return host_ < other.host_;
+ return net::SHA256HashValueLessThan()(cert_hash_, other.cert_hash_);
}
} // web
« no previous file with comments | « ios/web/net/cert_host_pair.h ('k') | ios/web/net/cert_host_pair_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698