| 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 11 matching lines...) Expand all Loading... |
| 22 #include "base/strings/string_number_conversions.h" | 22 #include "base/strings/string_number_conversions.h" |
| 23 #include "base/strings/string_piece.h" | 23 #include "base/strings/string_piece.h" |
| 24 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
| 25 #include "base/threading/thread_local.h" | 25 #include "base/threading/thread_local.h" |
| 26 #include "base/trace_event/trace_event.h" | 26 #include "base/trace_event/trace_event.h" |
| 27 #include "base/values.h" | 27 #include "base/values.h" |
| 28 #include "crypto/ec_private_key.h" | 28 #include "crypto/ec_private_key.h" |
| 29 #include "crypto/openssl_util.h" | 29 #include "crypto/openssl_util.h" |
| 30 #include "net/base/ip_address.h" | 30 #include "net/base/ip_address.h" |
| 31 #include "net/base/net_errors.h" | 31 #include "net/base/net_errors.h" |
| 32 #include "net/base/trace_constants.h" |
| 32 #include "net/cert/cert_verifier.h" | 33 #include "net/cert/cert_verifier.h" |
| 33 #include "net/cert/ct_ev_whitelist.h" | 34 #include "net/cert/ct_ev_whitelist.h" |
| 34 #include "net/cert/ct_policy_enforcer.h" | 35 #include "net/cert/ct_policy_enforcer.h" |
| 35 #include "net/cert/ct_policy_status.h" | 36 #include "net/cert/ct_policy_status.h" |
| 36 #include "net/cert/ct_verifier.h" | 37 #include "net/cert/ct_verifier.h" |
| 37 #include "net/cert/x509_certificate_net_log_param.h" | 38 #include "net/cert/x509_certificate_net_log_param.h" |
| 38 #include "net/cert/x509_util_openssl.h" | 39 #include "net/cert/x509_util_openssl.h" |
| 39 #include "net/http/transport_security_state.h" | 40 #include "net/http/transport_security_state.h" |
| 40 #include "net/log/net_log.h" | 41 #include "net/log/net_log.h" |
| 41 #include "net/log/net_log_event_type.h" | 42 #include "net/log/net_log_event_type.h" |
| (...skipping 1281 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 |