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

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

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: removed no longer needed forward declaration Created 3 years, 6 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 2406d2ce2ff90bf2334bf4f6716d7b6060f85517..9bc26987b8270881f80ce11e4ab8c74bd1e62b50 100644
--- a/chrome/browser/ui/android/ssl_client_certificate_request.cc
+++ b/chrome/browser/ui/android/ssl_client_certificate_request.cc
@@ -22,7 +22,6 @@
#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"
@@ -37,15 +36,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(net::X509Certificate* client_cert,
- scoped_refptr<net::SSLPrivateKey> private_key) {
- DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- net::OpenSSLClientKeyStore::GetInstance()->RecordClientCertPrivateKey(
- client_cert, std::move(private_key));
-}
-
void StartClientCertificateRequest(
const net::SSLCertRequestInfo* cert_request_info,
ui::WindowAndroid* window,
@@ -135,7 +125,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;
}
@@ -166,16 +156,8 @@ 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(
- content::BrowserThread::IO, FROM_HERE,
- base::Bind(&RecordClientCertificateKey, base::RetainedRef(client_cert),
- base::Passed(&private_key)),
- base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
- base::Owned(delegate.release()),
- base::RetainedRef(client_cert)));
+ delegate->ContinueWithCertificate(std::move(client_cert),
+ std::move(private_key));
}
static void NotifyClientCertificatesChanged() {
@@ -204,7 +186,7 @@ bool RegisterSSLClientCertificateRequestAndroid(JNIEnv* env) {
void ShowSSLClientCertificateSelector(
content::WebContents* contents,
net::SSLCertRequestInfo* cert_request_info,
- net::CertificateList unused_client_certs,
+ net::ClientCertIdentityList unused_client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) {
ui::WindowAndroid* window = ViewAndroidHelper::FromWebContents(contents)
->GetViewAndroid()->GetWindowAndroid();
« no previous file with comments | « chrome/browser/ssl/ssl_client_certificate_selector.h ('k') | chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698