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

Unified Diff: net/ssl/ssl_platform_key_win.cc

Issue 1304143010: Plumbing SSLPrivateKey Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing unused function in Android. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: net/ssl/ssl_platform_key_win.cc
diff --git a/net/ssl/ssl_platform_key_win.cc b/net/ssl/ssl_platform_key_win.cc
index 5bd99554446139a757666ff56078838ba6002cdb..8cfb6108a047b1c17ccca6e04ce70cc90705ac39 100644
--- a/net/ssl/ssl_platform_key_win.cc
+++ b/net/ssl/ssl_platform_key_win.cc
@@ -16,7 +16,6 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
-#include "base/lazy_instance.h"
davidben 2015/10/13 20:32:16 Still needed for this file.
svaldez 2015/10/14 15:06:19 Done.
#include "base/logging.h"
#include "base/macros.h"
#include "base/sequenced_task_runner.h"
@@ -28,6 +27,7 @@
#include "net/base/net_errors.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/scoped_openssl_types.h"
+#include "net/ssl/ssl_platform_key_task_runner.h"
#include "net/ssl/ssl_private_key.h"
#include "net/ssl/threaded_ssl_private_key.h"
@@ -317,9 +317,12 @@ bool GetKeyInfo(const X509Certificate* certificate,
} // namespace
-scoped_ptr<SSLPrivateKey> FetchClientCertPrivateKey(
- X509Certificate* certificate,
- scoped_refptr<base::SequencedTaskRunner> task_runner) {
+scoped_refptr<SSLPrivateKey> FetchClientCertPrivateKey(
+ X509Certificate* certificate) {
+ if (!certificate) {
+ return nullptr;
+ }
+
// Rather than query the private key for metadata, extract the public key from
// the certificate without using Windows APIs. CAPI and CNG do not
// consistently work depending on the system. See https://crbug.com/468345.
@@ -354,8 +357,8 @@ scoped_ptr<SSLPrivateKey> FetchClientCertPrivateKey(
DCHECK(SSLPrivateKey::Type::RSA == key_type);
delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length));
}
- return make_scoped_ptr(
- new ThreadedSSLPrivateKey(delegate.Pass(), task_runner.Pass()));
+ return make_scoped_refptr(new ThreadedSSLPrivateKey(
+ delegate.Pass(), GetSSLPlatformKeyTaskRunner()));
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698