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

Side by Side Diff: net/ssl/client_key_store.cc

Issue 1422573008: Plumbing SSLPrivateKey (//net) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing un-needed forward decl. Created 5 years, 1 month 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 | « net/ssl/client_key_store.h ('k') | net/ssl/ssl_client_auth_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ssl/client_key_store.h" 5 #include "net/ssl/client_key_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "net/cert/x509_certificate.h" 9 #include "net/cert/x509_certificate.h"
10 #include "net/ssl/ssl_private_key.h" 10 #include "net/ssl/ssl_private_key.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void ClientKeyStore::RemoveProvider(const CertKeyProvider* provider) { 33 void ClientKeyStore::RemoveProvider(const CertKeyProvider* provider) {
34 base::AutoLock auto_lock(lock_); 34 base::AutoLock auto_lock(lock_);
35 35
36 const auto& it = std::find(providers_.begin(), providers_.end(), provider); 36 const auto& it = std::find(providers_.begin(), providers_.end(), provider);
37 if (it != providers_.end()) 37 if (it != providers_.end())
38 providers_.erase(it); 38 providers_.erase(it);
39 } 39 }
40 40
41 scoped_ptr<SSLPrivateKey> ClientKeyStore::FetchClientCertPrivateKey( 41 scoped_refptr<SSLPrivateKey> ClientKeyStore::FetchClientCertPrivateKey(
42 const X509Certificate& certificate) { 42 const X509Certificate& certificate) {
43 base::AutoLock auto_lock(lock_); 43 base::AutoLock auto_lock(lock_);
44 44
45 for (const auto& provider : providers_) { 45 for (const auto& provider : providers_) {
46 scoped_ptr<SSLPrivateKey> key; 46 scoped_refptr<SSLPrivateKey> key;
47 if (provider->GetCertificateKey(certificate, &key)) 47 if (provider->GetCertificateKey(certificate, &key))
48 return key.Pass(); 48 return key.Pass();
49 } 49 }
50 return nullptr; 50 return nullptr;
51 } 51 }
52 52
53 } // namespace net 53 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/client_key_store.h ('k') | net/ssl/ssl_client_auth_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698