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

Unified Diff: chrome/browser/ui/android/ssl_client_certificate_request.cc

Issue 1304143010: Plumbing SSLPrivateKey Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 3 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: 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..81a4f6ed86a364536259c0a1a6b5c55bee5d3579 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,13 @@ 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_pkey =
+ net::WrapPrivateKey(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_pkey));
}
static void NotifyClientCertificatesChanged() {

Powered by Google App Engine
This is Rietveld 408576698