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

Unified Diff: net/ssl/ssl_platform_key_nss.cc

Issue 1278763002: Add a ClientKeyStore to allow injection of non-platform keys for TLS client auth. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client_cert_store
Patch Set: Nits. Created 5 years, 4 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 | « net/ssl/client_key_store.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ssl/ssl_platform_key_nss.cc
diff --git a/net/ssl/ssl_platform_key_nss.cc b/net/ssl/ssl_platform_key_nss.cc
index d08bd98b0f2f69f9c685aefb6c1d4e7c590e515e..22a6eec487dd0ca293fb54039581cdf758ff0b25 100644
--- a/net/ssl/ssl_platform_key_nss.cc
+++ b/net/ssl/ssl_platform_key_nss.cc
@@ -19,6 +19,7 @@
#include "crypto/scoped_nss_types.h"
#include "crypto/scoped_openssl_types.h"
#include "net/cert/x509_certificate.h"
+#include "net/ssl/client_key_store.h"
#include "net/ssl/ssl_private_key.h"
#include "net/ssl/threaded_ssl_private_key.h"
@@ -158,8 +159,10 @@ scoped_ptr<SSLPrivateKey> FetchClientCertPrivateKey(
scoped_refptr<base::SequencedTaskRunner> task_runner) {
crypto::ScopedSECKEYPrivateKey key(
PK11_FindKeyByAnyCert(certificate->os_cert_handle(), nullptr));
- if (!key)
- return nullptr;
+ if (!key) {
+ return ClientKeyStore::GetInstance()->FetchClientCertPrivateKey(
+ *certificate);
+ }
KeyType nss_type = SECKEY_GetPrivateKeyType(key.get());
SSLPrivateKey::Type type;
« no previous file with comments | « net/ssl/client_key_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698