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

Unified Diff: ios/web/net/cert_store_impl.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_store_impl.h ('k') | ios/web/net/request_tracker_impl_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/net/cert_store_impl.cc
diff --git a/ios/web/net/cert_store_impl.cc b/ios/web/net/cert_store_impl.cc
index a2396b58323a81270dc790261d37fab5d4d9855e..254115058a6b47365440e6b83af72122e6be7405 100644
--- a/ios/web/net/cert_store_impl.cc
+++ b/ios/web/net/cert_store_impl.cc
@@ -16,23 +16,41 @@ CertStoreImpl* CertStoreImpl::GetInstance() {
return base::Singleton<CertStoreImpl>::get();
}
-CertStoreImpl::CertStoreImpl() {
-}
-
-CertStoreImpl::~CertStoreImpl() {
-}
-
int CertStoreImpl::StoreCert(net::X509Certificate* cert, int group_id) {
- return store_.Store(cert, group_id);
+ scoped_refptr<HashAndCert> hash_and_cert(new HashAndCert);
+ hash_and_cert->chain_hash =
+ net::X509Certificate::CalculateChainFingerprint256(
+ cert->os_cert_handle(), cert->GetIntermediateCertificates());
+ hash_and_cert->cert = cert;
+ return store_.Store(hash_and_cert.get(), group_id);
}
bool CertStoreImpl::RetrieveCert(int cert_id,
scoped_refptr<net::X509Certificate>* cert) {
- return store_.Retrieve(cert_id, cert);
+ scoped_refptr<HashAndCert> hash_and_cert;
+ if (store_.Retrieve(cert_id, &hash_and_cert)) {
+ *cert = hash_and_cert->cert;
+ return true;
+ }
+ return false;
}
void CertStoreImpl::RemoveCertsForGroup(int group_id) {
store_.RemoveForRequestTracker(group_id);
}
+CertStoreImpl::CertStoreImpl() {}
+
+CertStoreImpl::~CertStoreImpl() {}
+
+CertStoreImpl::HashAndCert::HashAndCert() = default;
+
+bool CertStoreImpl::HashAndCert::LessThan::operator()(
+ const scoped_refptr<HashAndCert>& lhs,
+ const scoped_refptr<HashAndCert>& rhs) const {
+ return net::SHA256HashValueLessThan()(lhs->chain_hash, rhs->chain_hash);
+}
+
+CertStoreImpl::HashAndCert::~HashAndCert() = default;
+
} // namespace web
« no previous file with comments | « ios/web/net/cert_store_impl.h ('k') | ios/web/net/request_tracker_impl_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698