OLD | NEW |
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 #include "net/socket/ssl_client_socket_win.h" | 5 #include "net/socket/ssl_client_socket_win.h" |
6 | 6 |
7 #include <schnlsp.h> | 7 #include <schnlsp.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 memset(&stream_sizes_, 0, sizeof(stream_sizes_)); | 397 memset(&stream_sizes_, 0, sizeof(stream_sizes_)); |
398 memset(in_buffers_, 0, sizeof(in_buffers_)); | 398 memset(in_buffers_, 0, sizeof(in_buffers_)); |
399 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 399 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
400 memset(&ctxt_, 0, sizeof(ctxt_)); | 400 memset(&ctxt_, 0, sizeof(ctxt_)); |
401 } | 401 } |
402 | 402 |
403 SSLClientSocketWin::~SSLClientSocketWin() { | 403 SSLClientSocketWin::~SSLClientSocketWin() { |
404 Disconnect(); | 404 Disconnect(); |
405 } | 405 } |
406 | 406 |
407 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { | 407 bool SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { |
408 ssl_info->Reset(); | 408 ssl_info->Reset(); |
409 if (!server_cert_) | 409 if (!server_cert_) |
410 return; | 410 return false; |
411 | 411 |
412 ssl_info->cert = server_cert_verify_result_.verified_cert; | 412 ssl_info->cert = server_cert_verify_result_.verified_cert; |
413 ssl_info->cert_status = server_cert_verify_result_.cert_status; | 413 ssl_info->cert_status = server_cert_verify_result_.cert_status; |
414 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; | 414 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; |
415 ssl_info->is_issued_by_known_root = | 415 ssl_info->is_issued_by_known_root = |
416 server_cert_verify_result_.is_issued_by_known_root; | 416 server_cert_verify_result_.is_issued_by_known_root; |
417 ssl_info->client_cert_sent = | 417 ssl_info->client_cert_sent = |
418 ssl_config_.send_client_cert && ssl_config_.client_cert; | 418 ssl_config_.send_client_cert && ssl_config_.client_cert; |
419 ssl_info->channel_id_sent = WasChannelIDSent(); | 419 ssl_info->channel_id_sent = WasChannelIDSent(); |
420 SecPkgContext_ConnectionInfo connection_info; | 420 SecPkgContext_ConnectionInfo connection_info; |
(...skipping 20 matching lines...) Expand all Loading... |
441 // TODO(wtc): find out what the cipher_info.dwBaseCipherSuite field is. | 441 // TODO(wtc): find out what the cipher_info.dwBaseCipherSuite field is. |
442 ssl_info->connection_status |= | 442 ssl_info->connection_status |= |
443 (cipher_info.dwCipherSuite & SSL_CONNECTION_CIPHERSUITE_MASK) << | 443 (cipher_info.dwCipherSuite & SSL_CONNECTION_CIPHERSUITE_MASK) << |
444 SSL_CONNECTION_CIPHERSUITE_SHIFT; | 444 SSL_CONNECTION_CIPHERSUITE_SHIFT; |
445 // SChannel doesn't support TLS compression, so cipher_info doesn't have | 445 // SChannel doesn't support TLS compression, so cipher_info doesn't have |
446 // any field related to the compression method. | 446 // any field related to the compression method. |
447 } | 447 } |
448 | 448 |
449 if (ssl_config_.version_fallback) | 449 if (ssl_config_.version_fallback) |
450 ssl_info->connection_status |= SSL_CONNECTION_VERSION_FALLBACK; | 450 ssl_info->connection_status |= SSL_CONNECTION_VERSION_FALLBACK; |
| 451 |
| 452 return true; |
451 } | 453 } |
452 | 454 |
453 void SSLClientSocketWin::GetSSLCertRequestInfo( | 455 void SSLClientSocketWin::GetSSLCertRequestInfo( |
454 SSLCertRequestInfo* cert_request_info) { | 456 SSLCertRequestInfo* cert_request_info) { |
455 cert_request_info->host_and_port = host_and_port_.ToString(); | 457 cert_request_info->host_and_port = host_and_port_.ToString(); |
456 cert_request_info->client_certs.clear(); | 458 cert_request_info->client_certs.clear(); |
457 | 459 |
458 // Get the certificate_authorities field of the CertificateRequest message. | 460 // Get the certificate_authorities field of the CertificateRequest message. |
459 // Schannel doesn't return the certificate_types field of the | 461 // Schannel doesn't return the certificate_types field of the |
460 // CertificateRequest message to us, so we can't filter the client | 462 // CertificateRequest message to us, so we can't filter the client |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); | 1606 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); |
1605 } | 1607 } |
1606 | 1608 |
1607 void SSLClientSocketWin::FreeSendBuffer() { | 1609 void SSLClientSocketWin::FreeSendBuffer() { |
1608 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1610 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
1609 DCHECK(status == SEC_E_OK); | 1611 DCHECK(status == SEC_E_OK); |
1610 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1612 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
1611 } | 1613 } |
1612 | 1614 |
1613 } // namespace net | 1615 } // namespace net |
OLD | NEW |