diff options
author | markusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 15:20:31 +0000 |
---|---|---|
committer | markusheintz@chromium.org <markusheintz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-15 15:20:31 +0000 |
commit | 3303a564923ef5bfe164e1d4f0a6d258225b1492 (patch) | |
tree | 57cea0ccf423f88ff68160a3073682c9b5e87bed | |
parent | 6f2f220dd29824cc2f2bd1ced2aecaef28a6dc56 (diff) | |
download | chromium_src-3303a564923ef5bfe164e1d4f0a6d258225b1492.zip chromium_src-3303a564923ef5bfe164e1d4f0a6d258225b1492.tar.gz chromium_src-3303a564923ef5bfe164e1d4f0a6d258225b1492.tar.bz2 |
If multiple certificates are matched by a certificate filters then selected the first certificate in the list (This is a random select).
BUG=96599
TEST=none
Review URL: http://codereview.chromium.org/7796042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101295 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_ssl_helper.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc index 614bd5a..f96d1e4 100644 --- a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc +++ b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc @@ -226,17 +226,15 @@ void TabContentsSSLHelper::SelectClientCertificate( DCHECK(filter->IsType(Value::TYPE_DICTIONARY)); DictionaryValue* filter_dict = static_cast<DictionaryValue*>(filter.get()); - // Get all client certificates that match the criterias in |filter_dict|. const std::vector<scoped_refptr<net::X509Certificate> >& all_client_certs = cert_request_info->client_certs; - std::vector<scoped_refptr<net::X509Certificate> > matching_client_certs; for (size_t i = 0; i < all_client_certs.size(); ++i) { - if (CertMatchesFilter(*all_client_certs[i], *filter_dict)) - matching_client_certs.push_back(all_client_certs[i]); + if (CertMatchesFilter(*all_client_certs[i], *filter_dict)) { + selected_cert = all_client_certs[i]; + // Use the first certificate that is matched by the filter. + break; + } } - - if (matching_client_certs.size() == 1) - selected_cert = matching_client_certs[0]; } if (selected_cert) { |