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

Unified Diff: ios/web/net/cert_policy.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_unittest.cc ('k') | ios/web/net/cert_store_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/net/cert_policy.cc
diff --git a/ios/web/net/cert_policy.cc b/ios/web/net/cert_policy.cc
index 46d5699de3f00d046137741edd53f924d5614ae6..5855f97b39128df06de3aa48e3c88d2a424d5541 100644
--- a/ios/web/net/cert_policy.cc
+++ b/ios/web/net/cert_policy.cc
@@ -19,10 +19,9 @@ CertPolicy::~CertPolicy() {
// |error| is an exact match to or subset of the errors in the saved CertStatus.
CertPolicy::Judgment CertPolicy::Check(net::X509Certificate* cert,
net::CertStatus error) const {
- std::map<net::SHA1HashValue,
- net::CertStatus,
- net::SHA1HashValueLessThan>::const_iterator allowed_iter =
- allowed_.find(cert->fingerprint());
+ auto allowed_iter =
+ allowed_.find(net::X509Certificate::CalculateChainFingerprint256(
+ cert->os_cert_handle(), cert->GetIntermediateCertificates()));
if ((allowed_iter != allowed_.end()) && (allowed_iter->second & error) &&
!(~(allowed_iter->second & error) ^ ~error)) {
return ALLOWED;
@@ -33,7 +32,8 @@ CertPolicy::Judgment CertPolicy::Check(net::X509Certificate* cert,
void CertPolicy::Allow(net::X509Certificate* cert, net::CertStatus error) {
// If this same cert had already been saved with a different error status,
// this will replace it with the new error status.
- allowed_[cert->fingerprint()] = error;
+ allowed_[net::X509Certificate::CalculateChainFingerprint256(
+ cert->os_cert_handle(), cert->GetIntermediateCertificates())] = error;
}
} // namespace web
« no previous file with comments | « ios/web/net/cert_host_pair_unittest.cc ('k') | ios/web/net/cert_store_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698