Chromium Code Reviews| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 617 << SSLConnectionStatusToVersion(ssl_info->connection_status); | 617 << SSLConnectionStatusToVersion(ssl_info->connection_status); |
| 618 } | 618 } |
| 619 | 619 |
| 620 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( | 620 void SSLClientSocketOpenSSL::GetSSLCertRequestInfo( |
| 621 SSLCertRequestInfo* cert_request_info) { | 621 SSLCertRequestInfo* cert_request_info) { |
| 622 cert_request_info->host_and_port = host_and_port_.ToString(); | 622 cert_request_info->host_and_port = host_and_port_.ToString(); |
| 623 cert_request_info->client_certs = client_certs_; | 623 cert_request_info->client_certs = client_certs_; |
| 624 } | 624 } |
| 625 | 625 |
| 626 int SSLClientSocketOpenSSL::ExportKeyingMaterial( | 626 int SSLClientSocketOpenSSL::ExportKeyingMaterial( |
| 627 const base::StringPiece& label, const base::StringPiece& context, | 627 const base::StringPiece& label, |
| 628 bool has_context, const base::StringPiece& context, | |
| 628 unsigned char *out, unsigned int outlen) { | 629 unsigned char *out, unsigned int outlen) { |
|
Ryan Sleevi
2012/03/10 04:23:31
nit: "unsigned char *" -> "unsigned char* "
| |
| 629 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); | 630 crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); |
| 630 | 631 |
| 631 int rv = SSL_export_keying_material( | 632 int rv = SSL_export_keying_material( |
| 632 ssl_, out, outlen, const_cast<char*>(label.data()), | 633 ssl_, out, outlen, const_cast<char*>(label.data()), |
| 633 label.size(), | 634 label.size(), |
| 634 reinterpret_cast<unsigned char*>(const_cast<char*>(context.data())), | 635 reinterpret_cast<unsigned char*>(const_cast<char*>(context.data())), |
| 635 context.length(), | 636 context.length(), |
| 636 context.length() > 0); | 637 context.length() > 0); |
| 637 | 638 |
| 638 if (rv != 1) { | 639 if (rv != 1) { |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1296 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1297 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
| 1297 user_write_buf_->data()); | 1298 user_write_buf_->data()); |
| 1298 return rv; | 1299 return rv; |
| 1299 } | 1300 } |
| 1300 | 1301 |
| 1301 int err = SSL_get_error(ssl_, rv); | 1302 int err = SSL_get_error(ssl_, rv); |
| 1302 return MapOpenSSLError(err, err_tracer); | 1303 return MapOpenSSLError(err, err_tracer); |
| 1303 } | 1304 } |
| 1304 | 1305 |
| 1305 } // namespace net | 1306 } // namespace net |
| OLD | NEW |