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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 11458012: SSLCertRequestInfo: Add |valid_cas| and |valid_key_types| (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: trivial fix for Linux build Created 8 years 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 2850fef3aeed19cdb2c7431133049410c6a9244d..cdf77ca1deb74f3040711f0a512bfb3b06c30a70 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1288,30 +1288,32 @@ void ChromeContentBrowserClient::SelectClientCertificate(
<< cert_request_info->host_and_port;
Profile* profile = Profile::FromBrowserContext(tab->GetBrowserContext());
- scoped_ptr<Value> filter(
- profile->GetHostContentSettingsMap()->GetWebsiteSetting(
- requesting_url,
- requesting_url,
- CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
- std::string(), NULL));
-
- if (filter.get()) {
- // Try to automatically select a client certificate.
- if (filter->IsType(Value::TYPE_DICTIONARY)) {
- DictionaryValue* filter_dict =
- static_cast<DictionaryValue*>(filter.get());
-
- const std::vector<scoped_refptr<net::X509Certificate> >&
- all_client_certs = cert_request_info->client_certs;
- for (size_t i = 0; i < all_client_certs.size(); ++i) {
- if (CertMatchesFilter(*all_client_certs[i], *filter_dict)) {
- // Use the first certificate that is matched by the filter.
- callback.Run(all_client_certs[i]);
- return;
+ if (!cert_request_info->no_client_certs) {
+ scoped_ptr<Value> filter(
+ profile->GetHostContentSettingsMap()->GetWebsiteSetting(
+ requesting_url,
+ requesting_url,
+ CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE,
+ std::string(), NULL));
+
+ if (filter.get()) {
+ // Try to automatically select a client certificate.
+ if (filter->IsType(Value::TYPE_DICTIONARY)) {
+ DictionaryValue* filter_dict =
+ static_cast<DictionaryValue*>(filter.get());
+
+ const std::vector<scoped_refptr<net::X509Certificate> >&
+ all_client_certs = cert_request_info->client_certs;
+ for (size_t i = 0; i < all_client_certs.size(); ++i) {
+ if (CertMatchesFilter(*all_client_certs[i], *filter_dict)) {
+ // Use the first certificate that is matched by the filter.
+ callback.Run(all_client_certs[i]);
+ return;
+ }
}
+ } else {
+ NOTREACHED();
}
- } else {
- NOTREACHED();
}
}
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_client_certificate_selector_test.cc » ('j') | net/base/ssl_cert_request_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698