| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ssl/ssl_client_auth_handler.h" | 5 #include "chrome/browser/ssl/ssl_client_auth_handler.h" |
| 6 | 6 |
| 7 #include <cryptuiapi.h> | 7 #include <cryptuiapi.h> |
| 8 #pragma comment(lib, "cryptui.lib") | 8 #pragma comment(lib, "cryptui.lib") |
| 9 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 IDS_CLIENT_CERT_DIALOG_TEXT, | 41 IDS_CLIENT_CERT_DIALOG_TEXT, |
| 42 ASCIIToWide(cert_request_info_->host_and_port)); | 42 ASCIIToWide(cert_request_info_->host_and_port)); |
| 43 PCCERT_CONTEXT cert_context = CryptUIDlgSelectCertificateFromStore( | 43 PCCERT_CONTEXT cert_context = CryptUIDlgSelectCertificateFromStore( |
| 44 client_certs, browser_hwnd, title.c_str(), text.c_str(), 0, 0, NULL); | 44 client_certs, browser_hwnd, title.c_str(), text.c_str(), 0, 0, NULL); |
| 45 | 45 |
| 46 if (cert_context) { | 46 if (cert_context) { |
| 47 cert = net::X509Certificate::CreateFromHandle( | 47 cert = net::X509Certificate::CreateFromHandle( |
| 48 cert_context, | 48 cert_context, |
| 49 net::X509Certificate::SOURCE_LONE_CERT_IMPORT, | 49 net::X509Certificate::SOURCE_LONE_CERT_IMPORT, |
| 50 net::X509Certificate::OSCertHandles()); | 50 net::X509Certificate::OSCertHandles()); |
| 51 net::X509Certificate::FreeOSCertHandle(cert_context); |
| 51 } | 52 } |
| 52 | 53 |
| 53 ok = CertCloseStore(client_certs, CERT_CLOSE_STORE_CHECK_FLAG); | 54 ok = CertCloseStore(client_certs, CERT_CLOSE_STORE_CHECK_FLAG); |
| 54 DCHECK(ok); | 55 DCHECK(ok); |
| 55 | 56 |
| 56 CertificateSelected(cert); | 57 CertificateSelected(cert); |
| 57 } | 58 } |
| OLD | NEW |