| 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 <errno.h> | 10 #include <errno.h> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "base/lazy_instance.h" | 23 #include "base/lazy_instance.h" |
| 24 #include "base/macros.h" | 24 #include "base/macros.h" |
| 25 #include "base/memory/singleton.h" | 25 #include "base/memory/singleton.h" |
| 26 #include "base/metrics/histogram_macros.h" | 26 #include "base/metrics/histogram_macros.h" |
| 27 #include "base/metrics/sparse_histogram.h" | 27 #include "base/metrics/sparse_histogram.h" |
| 28 #include "base/profiler/scoped_tracker.h" | 28 #include "base/profiler/scoped_tracker.h" |
| 29 #include "base/strings/string_number_conversions.h" | 29 #include "base/strings/string_number_conversions.h" |
| 30 #include "base/strings/string_piece.h" | 30 #include "base/strings/string_piece.h" |
| 31 #include "base/synchronization/lock.h" | 31 #include "base/synchronization/lock.h" |
| 32 #include "base/threading/thread_local.h" | 32 #include "base/threading/thread_local.h" |
| 33 #include "base/trace_event/trace_event.h" |
| 33 #include "base/values.h" | 34 #include "base/values.h" |
| 34 #include "crypto/auto_cbb.h" | 35 #include "crypto/auto_cbb.h" |
| 35 #include "crypto/ec_private_key.h" | 36 #include "crypto/ec_private_key.h" |
| 36 #include "crypto/openssl_util.h" | 37 #include "crypto/openssl_util.h" |
| 37 #include "crypto/scoped_openssl_types.h" | 38 #include "crypto/scoped_openssl_types.h" |
| 38 #include "net/base/ip_address.h" | 39 #include "net/base/ip_address.h" |
| 39 #include "net/base/net_errors.h" | 40 #include "net/base/net_errors.h" |
| 40 #include "net/cert/cert_verifier.h" | 41 #include "net/cert/cert_verifier.h" |
| 41 #include "net/cert/ct_ev_whitelist.h" | 42 #include "net/cert/ct_ev_whitelist.h" |
| 42 #include "net/cert/ct_policy_enforcer.h" | 43 #include "net/cert/ct_policy_enforcer.h" |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 // decrypted data. | 1468 // decrypted data. |
| 1468 if (!user_read_buf_.get()) | 1469 if (!user_read_buf_.get()) |
| 1469 return; | 1470 return; |
| 1470 | 1471 |
| 1471 int rv = DoReadLoop(); | 1472 int rv = DoReadLoop(); |
| 1472 if (rv != ERR_IO_PENDING) | 1473 if (rv != ERR_IO_PENDING) |
| 1473 DoReadCallback(rv); | 1474 DoReadCallback(rv); |
| 1474 } | 1475 } |
| 1475 | 1476 |
| 1476 int SSLClientSocketOpenSSL::DoHandshakeLoop(int last_io_result) { | 1477 int SSLClientSocketOpenSSL::DoHandshakeLoop(int last_io_result) { |
| 1478 TRACE_EVENT0("net", "SSLClientSocketOpenSSL::DoHandshakeLoop"); |
| 1477 int rv = last_io_result; | 1479 int rv = last_io_result; |
| 1478 do { | 1480 do { |
| 1479 // Default to STATE_NONE for next state. | 1481 // Default to STATE_NONE for next state. |
| 1480 // (This is a quirk carried over from the windows | 1482 // (This is a quirk carried over from the windows |
| 1481 // implementation. It makes reading the logs a bit harder.) | 1483 // implementation. It makes reading the logs a bit harder.) |
| 1482 // State handlers can and often do call GotoState just | 1484 // State handlers can and often do call GotoState just |
| 1483 // to stay in the current state. | 1485 // to stay in the current state. |
| 1484 State state = next_handshake_state_; | 1486 State state = next_handshake_state_; |
| 1485 GotoState(STATE_NONE); | 1487 GotoState(STATE_NONE); |
| 1486 switch (state) { | 1488 switch (state) { |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 tb_was_negotiated_ = true; | 2304 tb_was_negotiated_ = true; |
| 2303 return 1; | 2305 return 1; |
| 2304 } | 2306 } |
| 2305 } | 2307 } |
| 2306 | 2308 |
| 2307 *out_alert_value = SSL_AD_ILLEGAL_PARAMETER; | 2309 *out_alert_value = SSL_AD_ILLEGAL_PARAMETER; |
| 2308 return 0; | 2310 return 0; |
| 2309 } | 2311 } |
| 2310 | 2312 |
| 2311 } // namespace net | 2313 } // namespace net |
| OLD | NEW |