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

Side by Side Diff: ios/web/net/cert_store_impl.cc

Issue 2327433002: Stop using CertStore which is not compatible with PlzNavigate. (Closed)
Patch Set: remove cert_store on ios Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « ios/web/net/cert_store_impl.h ('k') | ios/web/net/crw_ssl_status_updater.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ios/web/net/cert_store_impl.h"
6
7 namespace web {
8
9 // static
10 CertStore* CertStore::GetInstance() {
11 return CertStoreImpl::GetInstance();
12 }
13
14 // static
15 CertStoreImpl* CertStoreImpl::GetInstance() {
16 return base::Singleton<CertStoreImpl>::get();
17 }
18
19 int CertStoreImpl::StoreCert(net::X509Certificate* cert, int group_id) {
20 scoped_refptr<HashAndCert> hash_and_cert(new HashAndCert);
21 hash_and_cert->chain_hash =
22 net::X509Certificate::CalculateChainFingerprint256(
23 cert->os_cert_handle(), cert->GetIntermediateCertificates());
24 hash_and_cert->cert = cert;
25 return store_.Store(hash_and_cert.get(), group_id);
26 }
27
28 bool CertStoreImpl::RetrieveCert(int cert_id,
29 scoped_refptr<net::X509Certificate>* cert) {
30 scoped_refptr<HashAndCert> hash_and_cert;
31 if (store_.Retrieve(cert_id, &hash_and_cert)) {
32 *cert = hash_and_cert->cert;
33 return true;
34 }
35 return false;
36 }
37
38 void CertStoreImpl::RemoveCertsForGroup(int group_id) {
39 store_.RemoveForRequestTracker(group_id);
40 }
41
42 CertStoreImpl::CertStoreImpl() {}
43
44 CertStoreImpl::~CertStoreImpl() {}
45
46 CertStoreImpl::HashAndCert::HashAndCert() = default;
47
48 bool CertStoreImpl::HashAndCert::LessThan::operator()(
49 const scoped_refptr<HashAndCert>& lhs,
50 const scoped_refptr<HashAndCert>& rhs) const {
51 return net::SHA256HashValueLessThan()(lhs->chain_hash, rhs->chain_hash);
52 }
53
54 CertStoreImpl::HashAndCert::~HashAndCert() = default;
55
56 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/net/cert_store_impl.h ('k') | ios/web/net/crw_ssl_status_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698