| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 const SSLConfig& ssl_config) | 375 const SSLConfig& ssl_config) |
| 376 : ALLOW_THIS_IN_INITIALIZER_LIST( | 376 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| 377 handshake_io_callback_(this, | 377 handshake_io_callback_(this, |
| 378 &SSLClientSocketWin::OnHandshakeIOComplete)), | 378 &SSLClientSocketWin::OnHandshakeIOComplete)), |
| 379 ALLOW_THIS_IN_INITIALIZER_LIST( | 379 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 380 read_callback_(this, &SSLClientSocketWin::OnReadComplete)), | 380 read_callback_(this, &SSLClientSocketWin::OnReadComplete)), |
| 381 ALLOW_THIS_IN_INITIALIZER_LIST( | 381 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 382 write_callback_(this, &SSLClientSocketWin::OnWriteComplete)), | 382 write_callback_(this, &SSLClientSocketWin::OnWriteComplete)), |
| 383 transport_(transport_socket), | 383 transport_(transport_socket), |
| 384 hostname_(hostname), | 384 hostname_(hostname), |
| 385 port_(port), |
| 385 ssl_config_(ssl_config), | 386 ssl_config_(ssl_config), |
| 386 user_connect_callback_(NULL), | 387 user_connect_callback_(NULL), |
| 387 user_read_callback_(NULL), | 388 user_read_callback_(NULL), |
| 388 user_read_buf_len_(0), | 389 user_read_buf_len_(0), |
| 389 user_write_callback_(NULL), | 390 user_write_callback_(NULL), |
| 390 user_write_buf_len_(0), | 391 user_write_buf_len_(0), |
| 391 next_state_(STATE_NONE), | 392 next_state_(STATE_NONE), |
| 392 creds_(NULL), | 393 creds_(NULL), |
| 393 isc_status_(SEC_E_OK), | 394 isc_status_(SEC_E_OK), |
| 394 payload_send_buffer_len_(0), | 395 payload_send_buffer_len_(0), |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // SChannel doesn't support TLS compression, so cipher_info doesn't have | 447 // SChannel doesn't support TLS compression, so cipher_info doesn't have |
| 447 // any field related to the compression method. | 448 // any field related to the compression method. |
| 448 } | 449 } |
| 449 | 450 |
| 450 if (ssl_config_.ssl3_fallback) | 451 if (ssl_config_.ssl3_fallback) |
| 451 ssl_info->connection_status |= SSL_CONNECTION_SSL3_FALLBACK; | 452 ssl_info->connection_status |= SSL_CONNECTION_SSL3_FALLBACK; |
| 452 } | 453 } |
| 453 | 454 |
| 454 void SSLClientSocketWin::GetSSLCertRequestInfo( | 455 void SSLClientSocketWin::GetSSLCertRequestInfo( |
| 455 SSLCertRequestInfo* cert_request_info) { | 456 SSLCertRequestInfo* cert_request_info) { |
| 456 cert_request_info->host_and_port = hostname_; // TODO(wtc): no port! | 457 cert_request_info->host_and_port = HostPortPair(hostname_, port_).ToString(); |
| 457 cert_request_info->client_certs.clear(); | 458 cert_request_info->client_certs.clear(); |
| 458 | 459 |
| 459 // Get the certificate_authorities field of the CertificateRequest message. | 460 // Get the certificate_authorities field of the CertificateRequest message. |
| 460 // Schannel doesn't return the certificate_types field of the | 461 // Schannel doesn't return the certificate_types field of the |
| 461 // CertificateRequest message to us, so we can't filter the client | 462 // CertificateRequest message to us, so we can't filter the client |
| 462 // certificates properly. :-( | 463 // certificates properly. :-( |
| 463 SecPkgContext_IssuerListInfoEx issuer_list; | 464 SecPkgContext_IssuerListInfoEx issuer_list; |
| 464 SECURITY_STATUS status = QueryContextAttributes( | 465 SECURITY_STATUS status = QueryContextAttributes( |
| 465 &ctxt_, SECPKG_ATTR_ISSUER_LIST_EX, &issuer_list); | 466 &ctxt_, SECPKG_ATTR_ISSUER_LIST_EX, &issuer_list); |
| 466 if (status != SEC_E_OK) { | 467 if (status != SEC_E_OK) { |
| (...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); | 1510 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); |
| 1510 } | 1511 } |
| 1511 | 1512 |
| 1512 void SSLClientSocketWin::FreeSendBuffer() { | 1513 void SSLClientSocketWin::FreeSendBuffer() { |
| 1513 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1514 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
| 1514 DCHECK(status == SEC_E_OK); | 1515 DCHECK(status == SEC_E_OK); |
| 1515 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1516 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
| 1516 } | 1517 } |
| 1517 | 1518 |
| 1518 } // namespace net | 1519 } // namespace net |
| OLD | NEW |