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

Unified Diff: net/socket/ssl_client_socket_openssl.cc

Issue 1422573008: Plumbing SSLPrivateKey (//net) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing extra tab. Created 5 years, 2 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/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 d6e0aa2816234a235b469486befce4b5d721a688..b4a698885179fccf404bff54e82526f044d28736 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -16,6 +16,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
+#include "base/environment.h"
davidben 2015/11/04 00:17:38 (Stray change? Guessing a funny rebase.)
svaldez 2015/11/04 16:55:52 Done.
#include "base/lazy_instance.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_macros.h"
@@ -23,7 +24,6 @@
#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"
@@ -167,33 +167,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 {
@@ -612,7 +585,6 @@ void SSLClientSocketOpenSSL::Disconnect() {
channel_id_request_.Cancel();
ssl_failure_state_ = SSL_FAILURE_NONE;
- private_key_.reset();
davidben 2015/11/04 00:17:38 Hrm. Actually, I think you can do away with this f
svaldez 2015/11/04 16:55:52 Done.
signature_result_ = kNoPendingResult;
signature_.clear();
}
@@ -1800,17 +1772,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;

Powered by Google App Engine
This is Rietveld 408576698