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

Unified Diff: net/socket/ssl_client_socket_win.cc

Issue 11739004: Add server certificate request parameters to be stored in SSLCertRequestInfo. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address Ryan's remark ( ASSERT_TRUE(ptr) ) Created 7 years, 11 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 | « net/socket/ssl_client_socket_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_win.cc
diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc
index 37e5309c786d3e25078626b49f5afefa972f1ccb..ecc7f0e0f0381b51f760b1d5037fbffb3e945948 100644
--- a/net/socket/ssl_client_socket_win.cc
+++ b/net/socket/ssl_client_socket_win.cc
@@ -456,12 +456,13 @@ bool SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) {
void SSLClientSocketWin::GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) {
cert_request_info->host_and_port = host_and_port_.ToString();
+ cert_request_info->cert_authorities.clear();
+ cert_request_info->cert_key_types.clear();
cert_request_info->client_certs.clear();
- // Get the certificate_authorities field of the CertificateRequest message.
- // Schannel doesn't return the certificate_types field of the
- // CertificateRequest message to us, so we can't filter the client
- // certificates properly. :-(
+ // Get the server criteria for client certificates. Schannel doesn't return
+ // the certificate_types field of the CertificateRequest message to us, so we
+ // can't fill the |cert_key_types| field.
SecPkgContext_IssuerListInfoEx issuer_list;
SECURITY_STATUS status = QueryContextAttributes(
&ctxt_, SECPKG_ATTR_ISSUER_LIST_EX, &issuer_list);
@@ -470,6 +471,16 @@ void SSLClientSocketWin::GetSSLCertRequestInfo(
return;
}
+ for (size_t i = 0; i < issuer_list.cIssuers; i++) {
+ cert_request_info->cert_authorities.push_back(std::string(
+ reinterpret_cast<const char*>(issuer_list.aIssuers[i].pbData),
+ static_cast<size_t>(issuer_list.aIssuers[i].cbData)));
+ }
+
+ // Retrieve the list of matching client certificates. This is to be moved out
+ // of here as a part of refactoring effort being tracked in
+ // http://crbug.com/166642.
+
// Client certificates of the user are in the "MY" system certificate store.
HCERTSTORE my_cert_store = CertOpenSystemStore(NULL, L"MY");
if (!my_cert_store) {
« no previous file with comments | « net/socket/ssl_client_socket_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698