Index: chrome/browser/ui/android/ssl_client_certificate_request.cc |
diff --git a/chrome/browser/ui/android/ssl_client_certificate_request.cc b/chrome/browser/ui/android/ssl_client_certificate_request.cc |
index 9956db1df0cf1a0fdfaeda4ba5c21f064fb196f3..419c1a5b625f2cc599acad9c064111a2023ff10c 100644 |
--- a/chrome/browser/ui/android/ssl_client_certificate_request.cc |
+++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc |
@@ -21,25 +21,16 @@ |
#include "net/base/host_port_pair.h" |
#include "net/cert/cert_database.h" |
#include "net/cert/x509_certificate.h" |
-#include "net/ssl/openssl_client_key_store.h" |
#include "net/ssl/ssl_cert_request_info.h" |
#include "net/ssl/ssl_client_cert_type.h" |
+#include "net/ssl/ssl_platform_key.h" |
+#include "net/ssl/ssl_private_key.h" |
#include "ui/android/window_android.h" |
namespace chrome { |
namespace { |
-// Must be called on the I/O thread to record a client certificate |
-// and its private key in the OpenSSLClientKeyStore. |
-void RecordClientCertificateKey( |
- const scoped_refptr<net::X509Certificate>& client_cert, |
- crypto::ScopedEVP_PKEY private_key) { |
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
- net::OpenSSLClientKeyStore::GetInstance()->RecordClientCertPrivateKey( |
- client_cert.get(), private_key.get()); |
-} |
- |
void StartClientCertificateRequest( |
const net::SSLCertRequestInfo* cert_request_info, |
ui::WindowAndroid* window, |
@@ -133,7 +124,7 @@ static void OnSystemRequestCompletion( |
if (encoded_chain_ref == NULL || private_key_ref == NULL) { |
LOG(ERROR) << "No client certificate selected"; |
- delegate->ContinueWithCertificate(nullptr); |
+ delegate->ContinueWithCertificate(nullptr, nullptr); |
return; |
} |
@@ -164,15 +155,14 @@ static void OnSystemRequestCompletion( |
return; |
} |
- // RecordClientCertificateKey() must be called on the I/O thread, |
- // before the callback is called with the selected certificate on |
- // the UI thread. |
- content::BrowserThread::PostTaskAndReply( |
+ scoped_refptr<net::SSLPrivateKey> client_private_key = |
+ net::WrapOpenSSLPrivateKey(private_key.Pass()); |
+ |
+ content::BrowserThread::PostTask( |
content::BrowserThread::IO, FROM_HERE, |
- base::Bind(&RecordClientCertificateKey, client_cert, |
- base::Passed(&private_key)), |
base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate, |
- base::Owned(delegate.release()), client_cert)); |
+ base::Owned(delegate.release()), client_cert, |
+ client_private_key)); |
} |
static void NotifyClientCertificatesChanged() { |