Chromium Code Reviews| Index: net/socket/ssl_client_socket_openssl.cc |
| diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc |
| index c4489fba65b04edab4e94d3c9b2089b98db5036e..57f1aa43a0dad161ddcda3f3f3d8b683a37d43be 100644 |
| --- a/net/socket/ssl_client_socket_openssl.cc |
| +++ b/net/socket/ssl_client_socket_openssl.cc |
| @@ -17,14 +17,12 @@ |
| #include "base/bind.h" |
| #include "base/callback_helpers.h" |
| #include "base/environment.h" |
| -#include "base/lazy_instance.h" |
| #include "base/memory/singleton.h" |
| #include "base/metrics/histogram_macros.h" |
| #include "base/profiler/scoped_tracker.h" |
| #include "base/stl_util.h" |
| #include "base/strings/string_piece.h" |
| #include "base/synchronization/lock.h" |
| -#include "base/threading/sequenced_worker_pool.h" |
| #include "base/threading/thread_local.h" |
| #include "base/values.h" |
| #include "crypto/ec_private_key.h" |
| @@ -51,10 +49,6 @@ |
| #include "base/win/windows_version.h" |
| #endif |
| -#if !defined(OS_NACL) |
| -#include "net/ssl/ssl_platform_key.h" |
| -#endif |
| - |
| namespace net { |
| namespace { |
| @@ -169,33 +163,6 @@ bool EVP_MDToPrivateKeyHash(const EVP_MD* md, SSLPrivateKey::Hash* hash) { |
| } |
| } |
| -#if !defined(OS_NACL) |
| -class PlatformKeyTaskRunner { |
| - public: |
| - PlatformKeyTaskRunner() { |
| - // Serialize all the private key operations on a single background |
| - // thread to avoid problems with buggy smartcards. |
| - worker_pool_ = new base::SequencedWorkerPool(1, "Platform Key Thread"); |
| - task_runner_ = worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior( |
| - worker_pool_->GetSequenceToken(), |
| - base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); |
| - } |
| - |
| - scoped_refptr<base::SequencedTaskRunner> task_runner() { |
| - return task_runner_; |
| - } |
| - |
| - private: |
| - scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| - scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(PlatformKeyTaskRunner); |
| -}; |
| - |
| -base::LazyInstance<PlatformKeyTaskRunner>::Leaky g_platform_key_task_runner = |
| - LAZY_INSTANCE_INITIALIZER; |
| -#endif |
| - |
| } // namespace |
| class SSLClientSocketOpenSSL::SSLContext { |
| @@ -628,7 +595,6 @@ void SSLClientSocketOpenSSL::Disconnect() { |
| channel_id_request_.Cancel(); |
| ssl_failure_state_ = SSL_FAILURE_NONE; |
| - private_key_.reset(); |
| signature_result_ = kNoPendingResult; |
| signature_.clear(); |
| } |
| @@ -1808,14 +1774,11 @@ int SSLClientSocketOpenSSL::ClientCertRequestCallback(SSL* ssl) { |
| } |
| #if defined(OS_NACL) |
| - OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY); |
| - return -1; |
| + OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY); |
| + return -1; |
| #else |
| - // TODO(davidben): Lift this call up to the embedder so we can actually test |
| - // this code. https://crbug.com/394131 |
| - private_key_ = FetchClientCertPrivateKey( |
| - ssl_config_.client_cert.get(), |
| - g_platform_key_task_runner.Get().task_runner()); |
| + private_key_ = ssl_config_.client_pkey.Pass(); |
|
davidben
2015/09/25 20:10:11
I think you want it without the .Pass(). We probab
svaldez
2015/09/28 16:54:53
Done.
|
| + |
| if (!private_key_) { |
| // Could not find the private key. Fail the handshake and surface an |
| // appropriate error to the caller. |