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

Unified Diff: chrome/browser/views/ssl_client_certificate_selector_win.cc

Issue 3170019: Remove dependency on X509Certificate::Cache behaviour when selecting a client certificate on Win (Closed)
Patch Set: Address feedback Created 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/ssl_client_certificate_selector_win.cc
diff --git a/chrome/browser/views/ssl_client_certificate_selector_win.cc b/chrome/browser/views/ssl_client_certificate_selector_win.cc
index 8977787ac44da900cdeff8d261f2a4dea8b8feef..d78151dc7ba5747cfd6b58c7bb7c8c426777dce1 100644
--- a/chrome/browser/views/ssl_client_certificate_selector_win.cc
+++ b/chrome/browser/views/ssl_client_certificate_selector_win.cc
@@ -26,7 +26,6 @@ void ShowSSLClientCertificateSelector(
TabContents* parent,
net::SSLCertRequestInfo* cert_request_info,
SSLClientAuthHandler* delegate) {
- net::X509Certificate* cert = NULL;
// TODO(jcampan): replace this with our own cert selection dialog.
// CryptUIDlgSelectCertificateFromStore is blocking (but still processes
// Windows messages), which is scary.
@@ -51,11 +50,17 @@ void ShowSSLClientCertificateSelector(
client_certs, parent->GetMessageBoxRootWindow(),
title.c_str(), text.c_str(), 0, 0, NULL);
+ net::X509Certificate* cert = NULL;
if (cert_context) {
- cert = net::X509Certificate::CreateFromHandle(
- cert_context,
- net::X509Certificate::SOURCE_LONE_CERT_IMPORT,
- net::X509Certificate::OSCertHandles());
+ for (size_t i = 0; i < cert_request_info->client_certs.size(); ++i) {
+ net::X509Certificate* client_cert = cert_request_info->client_certs[i];
+ if (net::X509Certificate::IsSameOSCert(cert_context,
+ client_cert->os_cert_handle())) {
+ cert = client_cert;
+ break;
+ }
+ }
+ DCHECK(cert != NULL);
net::X509Certificate::FreeOSCertHandle(cert_context);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698