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

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

Issue 2291213002: Remove ENGINE indirection from Android SSLPrivateKey. (Closed)
Patch Set: re-delete undeleted files Created 4 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
« no previous file with comments | « android_webview/native/aw_contents_client_bridge.cc ('k') | net/android/keystore_openssl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..346fe934c800fd54ee707626f25e4409a39cec9e 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(
@@ -158,10 +159,10 @@ static void OnSystemRequestCompletion(
return;
}
- // Create an EVP_PKEY wrapper for the private key JNI reference.
- crypto::ScopedEVP_PKEY private_key(
- net::android::GetOpenSSLPrivateKeyWrapper(private_key_ref));
- if (!private_key.get()) {
+ // Create an SSLPrivateKey wrapper for the private key JNI reference.
+ scoped_refptr<net::SSLPrivateKey> private_key =
+ net::WrapJavaPrivateKey(private_key_ref);
+ if (!private_key) {
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()),
« no previous file with comments | « android_webview/native/aw_contents_client_bridge.cc ('k') | net/android/keystore_openssl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698