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

Side by Side Diff: net/socket_stream/socket_stream.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // TODO(ukai): code is similar with http_network_transaction.cc. We should 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should
6 // think about ways to share code, if possible. 6 // think about ways to share code, if possible.
7 7
8 #include "net/socket_stream/socket_stream.h" 8 #include "net/socket_stream/socket_stream.h"
9 9
10 #include <set> 10 #include <set>
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 return result; 1161 return result;
1162 1162
1163 scoped_refptr<X509Certificate> client_cert; 1163 scoped_refptr<X509Certificate> client_cert;
1164 bool found_cached_cert = session->ssl_client_auth_cache()->Lookup( 1164 bool found_cached_cert = session->ssl_client_auth_cache()->Lookup(
1165 cert_request_info->host_and_port, &client_cert); 1165 cert_request_info->host_and_port, &client_cert);
1166 if (!found_cached_cert) 1166 if (!found_cached_cert)
1167 return result; 1167 return result;
1168 if (!client_cert) 1168 if (!client_cert)
1169 return result; 1169 return result;
1170 1170
1171 const std::vector<scoped_refptr<X509Certificate> >& client_certs = 1171 if (!client_cert->IsValidClientCertificate(*cert_request_info))
1172 cert_request_info->client_certs;
1173 bool cert_still_valid = false;
1174 for (size_t i = 0; i < client_certs.size(); ++i) {
1175 if (client_cert->Equals(client_certs[i])) {
1176 cert_still_valid = true;
1177 break;
1178 }
1179 }
1180 if (!cert_still_valid)
1181 return result; 1172 return result;
1182 1173
1183 ssl_config->send_client_cert = true; 1174 ssl_config->send_client_cert = true;
1184 ssl_config->client_cert = client_cert; 1175 ssl_config->client_cert = client_cert;
1185 next_state_ = STATE_TCP_CONNECT; 1176 next_state_ = STATE_TCP_CONNECT;
1186 return OK; 1177 return OK;
1187 } 1178 }
1188 1179
1189 int SocketStream::AllowCertErrorForReconnection(SSLConfig* ssl_config) { 1180 int SocketStream::AllowCertErrorForReconnection(SSLConfig* ssl_config) {
1190 DCHECK(ssl_config); 1181 DCHECK(ssl_config);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
1273 1264
1274 SSLConfigService* SocketStream::ssl_config_service() const { 1265 SSLConfigService* SocketStream::ssl_config_service() const {
1275 return context_->ssl_config_service(); 1266 return context_->ssl_config_service();
1276 } 1267 }
1277 1268
1278 ProxyService* SocketStream::proxy_service() const { 1269 ProxyService* SocketStream::proxy_service() const {
1279 return context_->proxy_service(); 1270 return context_->proxy_service();
1280 } 1271 }
1281 1272
1282 } // namespace net 1273 } // namespace net
OLDNEW
« net/base/x509_certificate.h ('K') | « net/socket/ssl_client_socket_openssl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698