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

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

Issue 2291213002: Remove ENGINE indirection from Android SSLPrivateKey. (Closed)
Patch Set: Fix WebView build Created 4 years, 4 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 6881cd4717952b0d5f5a1a6219a9cc9974f256fa..f6629a9e91a9e2c1c251960a2dbb7c30c86f21ae 100644
--- a/chrome/browser/ui/android/ssl_client_certificate_request.cc
+++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc
@@ -13,19 +13,21 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
+#include "base/memory/ref_counted.h"
#include "chrome/browser/ssl/ssl_client_certificate_selector.h"
#include "chrome/browser/ui/android/view_android_helper.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "crypto/scoped_openssl_types.h"
#include "jni/SSLClientCertificateRequest_jni.h"
-#include "net/android/keystore_openssl.h"
#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"
@@ -38,12 +40,11 @@ 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) {
+void RecordClientCertificateKey(net::X509Certificate* client_cert,
+ scoped_refptr<net::SSLPrivateKey> private_key) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
net::OpenSSLClientKeyStore::GetInstance()->RecordClientCertPrivateKey(
- client_cert.get(), private_key.get());
+ client_cert, std::move(private_key));
}
void StartClientCertificateRequest(
@@ -159,8 +160,8 @@ static void OnSystemRequestCompletion(
}
// Create an EVP_PKEY wrapper for the private key JNI reference.
svaldez 2016/09/01 14:51:05 Update comment.
davidben 2016/09/01 19:40:56 Done.
- crypto::ScopedEVP_PKEY private_key(
- net::android::GetOpenSSLPrivateKeyWrapper(private_key_ref));
+ scoped_refptr<net::SSLPrivateKey> private_key =
+ net::WrapJavaPrivateKey(private_key_ref);
if (!private_key.get()) {
LOG(ERROR) << "Could not create OpenSSL wrapper for private key";
return;
@@ -171,7 +172,7 @@ static void OnSystemRequestCompletion(
// the UI thread.
content::BrowserThread::PostTaskAndReply(
content::BrowserThread::IO, FROM_HERE,
- base::Bind(&RecordClientCertificateKey, client_cert,
+ base::Bind(&RecordClientCertificateKey, base::RetainedRef(client_cert),
base::Passed(&private_key)),
base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
base::Owned(delegate.release()),

Powered by Google App Engine
This is Rietveld 408576698