| 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_impl.h" | 5 #include "net/socket/ssl_client_socket_impl.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "net/cert/ct_ev_whitelist.h" | 33 #include "net/cert/ct_ev_whitelist.h" |
| 34 #include "net/cert/ct_policy_enforcer.h" | 34 #include "net/cert/ct_policy_enforcer.h" |
| 35 #include "net/cert/ct_policy_status.h" | 35 #include "net/cert/ct_policy_status.h" |
| 36 #include "net/cert/ct_verifier.h" | 36 #include "net/cert/ct_verifier.h" |
| 37 #include "net/cert/x509_certificate_net_log_param.h" | 37 #include "net/cert/x509_certificate_net_log_param.h" |
| 38 #include "net/cert/x509_util_openssl.h" | 38 #include "net/cert/x509_util_openssl.h" |
| 39 #include "net/http/transport_security_state.h" | 39 #include "net/http/transport_security_state.h" |
| 40 #include "net/log/net_log.h" | 40 #include "net/log/net_log.h" |
| 41 #include "net/log/net_log_event_type.h" | 41 #include "net/log/net_log_event_type.h" |
| 42 #include "net/log/net_log_parameters_callback.h" | 42 #include "net/log/net_log_parameters_callback.h" |
| 43 #include "net/log/trace_constants.h" |
| 43 #include "net/ssl/ssl_cert_request_info.h" | 44 #include "net/ssl/ssl_cert_request_info.h" |
| 44 #include "net/ssl/ssl_cipher_suite_names.h" | 45 #include "net/ssl/ssl_cipher_suite_names.h" |
| 45 #include "net/ssl/ssl_client_session_cache.h" | 46 #include "net/ssl/ssl_client_session_cache.h" |
| 46 #include "net/ssl/ssl_connection_status_flags.h" | 47 #include "net/ssl/ssl_connection_status_flags.h" |
| 47 #include "net/ssl/ssl_info.h" | 48 #include "net/ssl/ssl_info.h" |
| 48 #include "net/ssl/ssl_private_key.h" | 49 #include "net/ssl/ssl_private_key.h" |
| 49 #include "net/ssl/token_binding.h" | 50 #include "net/ssl/token_binding.h" |
| 50 #include "third_party/boringssl/src/include/openssl/bio.h" | 51 #include "third_party/boringssl/src/include/openssl/bio.h" |
| 51 #include "third_party/boringssl/src/include/openssl/bytestring.h" | 52 #include "third_party/boringssl/src/include/openssl/bytestring.h" |
| 52 #include "third_party/boringssl/src/include/openssl/err.h" | 53 #include "third_party/boringssl/src/include/openssl/err.h" |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1323 | 1324 |
| 1324 void SSLClientSocketImpl::OnHandshakeIOComplete(int result) { | 1325 void SSLClientSocketImpl::OnHandshakeIOComplete(int result) { |
| 1325 int rv = DoHandshakeLoop(result); | 1326 int rv = DoHandshakeLoop(result); |
| 1326 if (rv != ERR_IO_PENDING) { | 1327 if (rv != ERR_IO_PENDING) { |
| 1327 LogConnectEndEvent(rv); | 1328 LogConnectEndEvent(rv); |
| 1328 DoConnectCallback(rv); | 1329 DoConnectCallback(rv); |
| 1329 } | 1330 } |
| 1330 } | 1331 } |
| 1331 | 1332 |
| 1332 int SSLClientSocketImpl::DoHandshakeLoop(int last_io_result) { | 1333 int SSLClientSocketImpl::DoHandshakeLoop(int last_io_result) { |
| 1333 TRACE_EVENT0("net", "SSLClientSocketImpl::DoHandshakeLoop"); | 1334 TRACE_EVENT0(kNetTracingCategory, "SSLClientSocketImpl::DoHandshakeLoop"); |
| 1334 int rv = last_io_result; | 1335 int rv = last_io_result; |
| 1335 do { | 1336 do { |
| 1336 // Default to STATE_NONE for next state. | 1337 // Default to STATE_NONE for next state. |
| 1337 // (This is a quirk carried over from the windows | 1338 // (This is a quirk carried over from the windows |
| 1338 // implementation. It makes reading the logs a bit harder.) | 1339 // implementation. It makes reading the logs a bit harder.) |
| 1339 // State handlers can and often do call GotoState just | 1340 // State handlers can and often do call GotoState just |
| 1340 // to stay in the current state. | 1341 // to stay in the current state. |
| 1341 State state = next_handshake_state_; | 1342 State state = next_handshake_state_; |
| 1342 next_handshake_state_ = STATE_NONE; | 1343 next_handshake_state_ = STATE_NONE; |
| 1343 switch (state) { | 1344 switch (state) { |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2019 if (ERR_GET_REASON(info->error_code) == SSL_R_TLSV1_ALERT_ACCESS_DENIED && | 2020 if (ERR_GET_REASON(info->error_code) == SSL_R_TLSV1_ALERT_ACCESS_DENIED && |
| 2020 !certificate_requested_) { | 2021 !certificate_requested_) { |
| 2021 net_error = ERR_SSL_PROTOCOL_ERROR; | 2022 net_error = ERR_SSL_PROTOCOL_ERROR; |
| 2022 } | 2023 } |
| 2023 } | 2024 } |
| 2024 | 2025 |
| 2025 return net_error; | 2026 return net_error; |
| 2026 } | 2027 } |
| 2027 | 2028 |
| 2028 } // namespace net | 2029 } // namespace net |
| OLD | NEW |