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 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
7 | 7 |
8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
9 | 9 |
10 #include <openssl/ssl.h> | 10 #include <openssl/ssl.h> |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 << SSLConnectionStatusToCompression(ssl_info->connection_status) | 645 << SSLConnectionStatusToCompression(ssl_info->connection_status) |
646 << " version = " | 646 << " version = " |
647 << SSLConnectionStatusToVersion(ssl_info->connection_status); | 647 << SSLConnectionStatusToVersion(ssl_info->connection_status); |
648 return true; | 648 return true; |
649 } | 649 } |
650 | 650 |
651 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( | 651 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( |
652 SSLCertRequestInfo* cert_request_info) { | 652 SSLCertRequestInfo* cert_request_info) { |
653 cert_request_info->host_and_port = host_and_port_.ToString(); | 653 cert_request_info->host_and_port = host_and_port_.ToString(); |
654 cert_request_info->cert_authorities = cert_authorities_; | 654 cert_request_info->cert_authorities = cert_authorities_; |
655 cert_request_info->client_certs = client_certs_; | |
656 } | 655 } |
657 | 656 |
658 int SSLClientSocketOpenSSL::ExportKeyingMaterial( | 657 int SSLClientSocketOpenSSL::ExportKeyingMaterial( |
659 const base::StringPiece& label, | 658 const base::StringPiece& label, |
660 bool has_context, const base::StringPiece& context, | 659 bool has_context, const base::StringPiece& context, |
661 unsigned char* out, unsigned int outlen) { | 660 unsigned char* out, unsigned int outlen) { |
662 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); | 661 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); |
663 | 662 |
664 int rv = SSL_export_keying_material( | 663 int rv = SSL_export_keying_material( |
665 ssl_, out, outlen, const_cast<char*>(label.data()), | 664 ssl_, out, outlen, const_cast<char*>(label.data()), |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 user_write_callback_.Reset(); | 763 user_write_callback_.Reset(); |
765 user_read_buf_ = NULL; | 764 user_read_buf_ = NULL; |
766 user_read_buf_len_ = 0; | 765 user_read_buf_len_ = 0; |
767 user_write_buf_ = NULL; | 766 user_write_buf_ = NULL; |
768 user_write_buf_len_ = 0; | 767 user_write_buf_len_ = 0; |
769 | 768 |
770 server_cert_verify_result_.Reset(); | 769 server_cert_verify_result_.Reset(); |
771 completed_handshake_ = false; | 770 completed_handshake_ = false; |
772 | 771 |
773 cert_authorities_.clear(); | 772 cert_authorities_.clear(); |
774 client_certs_.clear(); | |
775 client_auth_cert_needed_ = false; | 773 client_auth_cert_needed_ = false; |
776 } | 774 } |
777 | 775 |
778 int SSLClientSocketOpenSSL::DoHandshakeLoop(int last_io_result) { | 776 int SSLClientSocketOpenSSL::DoHandshakeLoop(int last_io_result) { |
779 int rv = last_io_result; | 777 int rv = last_io_result; |
780 do { | 778 do { |
781 // Default to STATE_NONE for next state. | 779 // Default to STATE_NONE for next state. |
782 // (This is a quirk carried over from the windows | 780 // (This is a quirk carried over from the windows |
783 // implementation. It makes reading the logs a bit harder.) | 781 // implementation. It makes reading the logs a bit harder.) |
784 // State handlers can and often do call GotoState just | 782 // State handlers can and often do call GotoState just |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1364 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
1367 user_write_buf_->data()); | 1365 user_write_buf_->data()); |
1368 return rv; | 1366 return rv; |
1369 } | 1367 } |
1370 | 1368 |
1371 int err = SSL_get_error(ssl_, rv); | 1369 int err = SSL_get_error(ssl_, rv); |
1372 return MapOpenSSLError(err, err_tracer); | 1370 return MapOpenSSLError(err, err_tracer); |
1373 } | 1371 } |
1374 | 1372 |
1375 } // namespace net | 1373 } // namespace net |
OLD | NEW |