| 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 1f119458402448170fa63869d00f511303590d04..8d44cc49f76cc8d8b4bfdf15b8a1bc733eb93c4a 100644
|
| --- a/chrome/browser/ui/android/ssl_client_certificate_request.cc
|
| +++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc
|
| @@ -23,9 +23,10 @@
|
| #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_android.h"
|
| +#include "net/ssl/ssl_private_key.h"
|
| #include "ui/android/view_android.h"
|
| #include "ui/android/window_android.h"
|
|
|
| @@ -33,16 +34,6 @@ 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,
|
| @@ -136,7 +127,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;
|
| }
|
|
|
| @@ -167,15 +158,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(std::move(private_key));
|
| +
|
| + 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() {
|
|
|