| 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 9c208d33848bc150d33085e0451349113ad04c98..bf7cb778bffea8cefe18e3f4f845ebd741c8e5db 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"
|
| @@ -168,33 +166,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 {
|
| @@ -616,7 +587,6 @@ void SSLClientSocketOpenSSL::Disconnect() {
|
| channel_id_request_.Cancel();
|
| ssl_failure_state_ = SSL_FAILURE_NONE;
|
|
|
| - private_key_.reset();
|
| signature_result_ = kNoPendingResult;
|
| signature_.clear();
|
| }
|
| @@ -1797,17 +1767,14 @@ 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_private_key;
|
| +
|
| if (!private_key_) {
|
| - // Could not find the private key. Fail the handshake and surface an
|
| - // appropriate error to the caller.
|
| + // The caller supplied a null private key. Fail the handshake and surface
|
| + // an appropriate error to the caller.
|
| LOG(WARNING) << "Client cert found without private key";
|
| OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY);
|
| return -1;
|
|
|