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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { | 405 void SSLClientSocketWin::GetSSLInfo(SSLInfo* ssl_info) { |
406 ssl_info->Reset(); | 406 ssl_info->Reset(); |
407 if (!server_cert_) | 407 if (!server_cert_) |
408 return; | 408 return; |
409 | 409 |
410 ssl_info->cert = server_cert_verify_result_.verified_cert; | 410 ssl_info->cert = server_cert_verify_result_.verified_cert; |
411 ssl_info->cert_status = server_cert_verify_result_.cert_status; | 411 ssl_info->cert_status = server_cert_verify_result_.cert_status; |
412 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; | 412 ssl_info->public_key_hashes = server_cert_verify_result_.public_key_hashes; |
413 ssl_info->is_issued_by_known_root = | 413 ssl_info->is_issued_by_known_root = |
414 server_cert_verify_result_.is_issued_by_known_root; | 414 server_cert_verify_result_.is_issued_by_known_root; |
415 ssl_info->client_cert_sent = WasOriginBoundCertSent() || | 415 ssl_info->client_cert_sent = WasDomainBoundCertSent() || |
416 (ssl_config_.send_client_cert && ssl_config_.client_cert); | 416 (ssl_config_.send_client_cert && ssl_config_.client_cert); |
417 SecPkgContext_ConnectionInfo connection_info; | 417 SecPkgContext_ConnectionInfo connection_info; |
418 SECURITY_STATUS status = QueryContextAttributes( | 418 SECURITY_STATUS status = QueryContextAttributes( |
419 &ctxt_, SECPKG_ATTR_CONNECTION_INFO, &connection_info); | 419 &ctxt_, SECPKG_ATTR_CONNECTION_INFO, &connection_info); |
420 if (status == SEC_E_OK) { | 420 if (status == SEC_E_OK) { |
421 // TODO(wtc): compute the overall security strength, taking into account | 421 // TODO(wtc): compute the overall security strength, taking into account |
422 // dwExchStrength and dwHashStrength. dwExchStrength needs to be | 422 // dwExchStrength and dwHashStrength. dwExchStrength needs to be |
423 // normalized. | 423 // normalized. |
424 ssl_info->security_bits = connection_info.dwCipherStrength; | 424 ssl_info->security_bits = connection_info.dwCipherStrength; |
425 } | 425 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 } | 547 } |
548 | 548 |
549 SSLClientSocket::NextProtoStatus | 549 SSLClientSocket::NextProtoStatus |
550 SSLClientSocketWin::GetNextProto(std::string* proto, | 550 SSLClientSocketWin::GetNextProto(std::string* proto, |
551 std::string* server_protos) { | 551 std::string* server_protos) { |
552 proto->clear(); | 552 proto->clear(); |
553 server_protos->clear(); | 553 server_protos->clear(); |
554 return kNextProtoUnsupported; | 554 return kNextProtoUnsupported; |
555 } | 555 } |
556 | 556 |
557 OriginBoundCertService* SSLClientSocketWin::GetOriginBoundCertService() const { | 557 ServerBoundCertService* SSLClientSocketWin::GetServerBoundCertService() const { |
558 return NULL; | 558 return NULL; |
559 } | 559 } |
560 | 560 |
561 int SSLClientSocketWin::Connect(const CompletionCallback& callback) { | 561 int SSLClientSocketWin::Connect(const CompletionCallback& callback) { |
562 DCHECK(transport_.get()); | 562 DCHECK(transport_.get()); |
563 DCHECK(next_state_ == STATE_NONE); | 563 DCHECK(next_state_ == STATE_NONE); |
564 DCHECK(user_connect_callback_.is_null()); | 564 DCHECK(user_connect_callback_.is_null()); |
565 | 565 |
566 net_log_.BeginEvent(NetLog::TYPE_SSL_CONNECT, NULL); | 566 net_log_.BeginEvent(NetLog::TYPE_SSL_CONNECT, NULL); |
567 | 567 |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); | 1589 UpdateConnectionTypeHistograms(CONNECTION_SSL_MD2_CA); |
1590 } | 1590 } |
1591 | 1591 |
1592 void SSLClientSocketWin::FreeSendBuffer() { | 1592 void SSLClientSocketWin::FreeSendBuffer() { |
1593 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); | 1593 SECURITY_STATUS status = FreeContextBuffer(send_buffer_.pvBuffer); |
1594 DCHECK(status == SEC_E_OK); | 1594 DCHECK(status == SEC_E_OK); |
1595 memset(&send_buffer_, 0, sizeof(send_buffer_)); | 1595 memset(&send_buffer_, 0, sizeof(send_buffer_)); |
1596 } | 1596 } |
1597 | 1597 |
1598 } // namespace net | 1598 } // namespace net |
OLD | NEW |