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> |
11 #include <openssl/bio.h> | 11 #include <openssl/bio.h> |
12 #include <openssl/err.h> | 12 #include <openssl/err.h> |
13 #include <openssl/mem.h> | 13 #include <openssl/mem.h> |
14 #include <openssl/ssl.h> | 14 #include <openssl/ssl.h> |
15 #include <string.h> | 15 #include <string.h> |
16 | 16 |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/callback_helpers.h" | 18 #include "base/callback_helpers.h" |
19 #include "base/lazy_instance.h" | 19 #include "base/lazy_instance.h" |
20 #include "base/memory/singleton.h" | 20 #include "base/memory/singleton.h" |
21 #include "base/metrics/histogram_macros.h" | 21 #include "base/metrics/histogram_macros.h" |
22 #include "base/profiler/scoped_tracker.h" | 22 #include "base/profiler/scoped_tracker.h" |
23 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
24 #include "base/strings/string_piece.h" | 24 #include "base/strings/string_piece.h" |
25 #include "base/synchronization/lock.h" | 25 #include "base/synchronization/lock.h" |
26 #include "base/threading/sequenced_worker_pool.h" | |
27 #include "base/threading/thread_local.h" | 26 #include "base/threading/thread_local.h" |
28 #include "base/values.h" | 27 #include "base/values.h" |
29 #include "crypto/ec_private_key.h" | 28 #include "crypto/ec_private_key.h" |
30 #include "crypto/openssl_util.h" | 29 #include "crypto/openssl_util.h" |
31 #include "crypto/scoped_openssl_types.h" | 30 #include "crypto/scoped_openssl_types.h" |
32 #include "net/base/ip_address_number.h" | 31 #include "net/base/ip_address_number.h" |
33 #include "net/base/net_errors.h" | 32 #include "net/base/net_errors.h" |
34 #include "net/cert/cert_policy_enforcer.h" | 33 #include "net/cert/cert_policy_enforcer.h" |
35 #include "net/cert/cert_verifier.h" | 34 #include "net/cert/cert_verifier.h" |
36 #include "net/cert/ct_ev_whitelist.h" | 35 #include "net/cert/ct_ev_whitelist.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 *hash = SSLPrivateKey::Hash::SHA384; | 159 *hash = SSLPrivateKey::Hash::SHA384; |
161 return true; | 160 return true; |
162 case NID_sha512: | 161 case NID_sha512: |
163 *hash = SSLPrivateKey::Hash::SHA512; | 162 *hash = SSLPrivateKey::Hash::SHA512; |
164 return true; | 163 return true; |
165 default: | 164 default: |
166 return false; | 165 return false; |
167 } | 166 } |
168 } | 167 } |
169 | 168 |
170 #if !defined(OS_NACL) | |
171 class PlatformKeyTaskRunner { | |
172 public: | |
173 PlatformKeyTaskRunner() { | |
174 // Serialize all the private key operations on a single background | |
175 // thread to avoid problems with buggy smartcards. | |
176 worker_pool_ = new base::SequencedWorkerPool(1, "Platform Key Thread"); | |
177 task_runner_ = worker_pool_->GetSequencedTaskRunnerWithShutdownBehavior( | |
178 worker_pool_->GetSequenceToken(), | |
179 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); | |
180 } | |
181 | |
182 scoped_refptr<base::SequencedTaskRunner> task_runner() { | |
183 return task_runner_; | |
184 } | |
185 | |
186 private: | |
187 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | |
188 scoped_refptr<base::SequencedTaskRunner> task_runner_; | |
189 | |
190 DISALLOW_COPY_AND_ASSIGN(PlatformKeyTaskRunner); | |
191 }; | |
192 | |
193 base::LazyInstance<PlatformKeyTaskRunner>::Leaky g_platform_key_task_runner = | |
194 LAZY_INSTANCE_INITIALIZER; | |
195 #endif | |
196 | |
197 } // namespace | 169 } // namespace |
198 | 170 |
199 class SSLClientSocketOpenSSL::SSLContext { | 171 class SSLClientSocketOpenSSL::SSLContext { |
200 public: | 172 public: |
201 static SSLContext* GetInstance() { | 173 static SSLContext* GetInstance() { |
202 return base::Singleton<SSLContext>::get(); | 174 return base::Singleton<SSLContext>::get(); |
203 } | 175 } |
204 SSL_CTX* ssl_ctx() { return ssl_ctx_.get(); } | 176 SSL_CTX* ssl_ctx() { return ssl_ctx_.get(); } |
205 SSLClientSessionCacheOpenSSL* session_cache() { return &session_cache_; } | 177 SSLClientSessionCacheOpenSSL* session_cache() { return &session_cache_; } |
206 | 178 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
605 | 577 |
606 npn_status_ = kNextProtoUnsupported; | 578 npn_status_ = kNextProtoUnsupported; |
607 npn_proto_.clear(); | 579 npn_proto_.clear(); |
608 | 580 |
609 channel_id_sent_ = false; | 581 channel_id_sent_ = false; |
610 session_pending_ = false; | 582 session_pending_ = false; |
611 certificate_verified_ = false; | 583 certificate_verified_ = false; |
612 channel_id_request_.Cancel(); | 584 channel_id_request_.Cancel(); |
613 ssl_failure_state_ = SSL_FAILURE_NONE; | 585 ssl_failure_state_ = SSL_FAILURE_NONE; |
614 | 586 |
615 private_key_.reset(); | |
616 signature_result_ = kNoPendingResult; | 587 signature_result_ = kNoPendingResult; |
617 signature_.clear(); | 588 signature_.clear(); |
618 } | 589 } |
619 | 590 |
620 bool SSLClientSocketOpenSSL::IsConnected() const { | 591 bool SSLClientSocketOpenSSL::IsConnected() const { |
621 // If the handshake has not yet completed. | 592 // If the handshake has not yet completed. |
622 if (!completed_connect_) | 593 if (!completed_connect_) |
623 return false; | 594 return false; |
624 // If an asynchronous operation is still pending. | 595 // If an asynchronous operation is still pending. |
625 if (user_read_buf_.get() || user_write_buf_.get()) | 596 if (user_read_buf_.get() || user_write_buf_.get()) |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1033 // The server supports channel ID. Stop to look one up before returning to | 1004 // The server supports channel ID. Stop to look one up before returning to |
1034 // the handshake. | 1005 // the handshake. |
1035 GotoState(STATE_CHANNEL_ID_LOOKUP); | 1006 GotoState(STATE_CHANNEL_ID_LOOKUP); |
1036 return OK; | 1007 return OK; |
1037 } | 1008 } |
1038 if (ssl_error == SSL_ERROR_WANT_X509_LOOKUP && | 1009 if (ssl_error == SSL_ERROR_WANT_X509_LOOKUP && |
1039 !ssl_config_.send_client_cert) { | 1010 !ssl_config_.send_client_cert) { |
1040 return ERR_SSL_CLIENT_AUTH_CERT_NEEDED; | 1011 return ERR_SSL_CLIENT_AUTH_CERT_NEEDED; |
1041 } | 1012 } |
1042 if (ssl_error == SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) { | 1013 if (ssl_error == SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) { |
1043 DCHECK(private_key_); | 1014 DCHECK(ssl_config_.client_private_key); |
1044 DCHECK_NE(kNoPendingResult, signature_result_); | 1015 DCHECK_NE(kNoPendingResult, signature_result_); |
1045 GotoState(STATE_HANDSHAKE); | 1016 GotoState(STATE_HANDSHAKE); |
1046 return ERR_IO_PENDING; | 1017 return ERR_IO_PENDING; |
1047 } | 1018 } |
1048 | 1019 |
1049 OpenSSLErrorInfo error_info; | 1020 OpenSSLErrorInfo error_info; |
1050 net_error = MapOpenSSLErrorWithDetails(ssl_error, err_tracer, &error_info); | 1021 net_error = MapOpenSSLErrorWithDetails(ssl_error, err_tracer, &error_info); |
1051 if (net_error == ERR_IO_PENDING) { | 1022 if (net_error == ERR_IO_PENDING) { |
1052 // If not done, stay in this state | 1023 // If not done, stay in this state |
1053 GotoState(STATE_HANDSHAKE); | 1024 GotoState(STATE_HANDSHAKE); |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1499 // error, so it does not occur. The second and third are distinguished by | 1470 // error, so it does not occur. The second and third are distinguished by |
1500 // SSL_ERROR_ZERO_RETURN. | 1471 // SSL_ERROR_ZERO_RETURN. |
1501 pending_read_ssl_error_ = SSL_get_error(ssl_, ssl_ret); | 1472 pending_read_ssl_error_ = SSL_get_error(ssl_, ssl_ret); |
1502 if (pending_read_ssl_error_ == SSL_ERROR_ZERO_RETURN) { | 1473 if (pending_read_ssl_error_ == SSL_ERROR_ZERO_RETURN) { |
1503 pending_read_error_ = 0; | 1474 pending_read_error_ = 0; |
1504 } else if (pending_read_ssl_error_ == SSL_ERROR_WANT_X509_LOOKUP && | 1475 } else if (pending_read_ssl_error_ == SSL_ERROR_WANT_X509_LOOKUP && |
1505 !ssl_config_.send_client_cert) { | 1476 !ssl_config_.send_client_cert) { |
1506 pending_read_error_ = ERR_SSL_CLIENT_AUTH_CERT_NEEDED; | 1477 pending_read_error_ = ERR_SSL_CLIENT_AUTH_CERT_NEEDED; |
1507 } else if (pending_read_ssl_error_ == | 1478 } else if (pending_read_ssl_error_ == |
1508 SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) { | 1479 SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) { |
1509 DCHECK(private_key_); | 1480 DCHECK(ssl_config_.client_private_key); |
1510 DCHECK_NE(kNoPendingResult, signature_result_); | 1481 DCHECK_NE(kNoPendingResult, signature_result_); |
1511 pending_read_error_ = ERR_IO_PENDING; | 1482 pending_read_error_ = ERR_IO_PENDING; |
1512 } else { | 1483 } else { |
1513 pending_read_error_ = MapOpenSSLErrorWithDetails( | 1484 pending_read_error_ = MapOpenSSLErrorWithDetails( |
1514 pending_read_ssl_error_, err_tracer, &pending_read_error_info_); | 1485 pending_read_ssl_error_, err_tracer, &pending_read_error_info_); |
1515 } | 1486 } |
1516 | 1487 |
1517 // Many servers do not reliably send a close_notify alert when shutting down | 1488 // Many servers do not reliably send a close_notify alert when shutting down |
1518 // a connection, and instead terminate the TCP connection. This is reported | 1489 // a connection, and instead terminate the TCP connection. This is reported |
1519 // as ERR_CONNECTION_CLOSED. Because of this, map the unclean shutdown to a | 1490 // as ERR_CONNECTION_CLOSED. Because of this, map the unclean shutdown to a |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1789 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT); | 1760 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_BAD_FORMAT); |
1790 return -1; | 1761 return -1; |
1791 } | 1762 } |
1792 | 1763 |
1793 if (!SSL_use_certificate(ssl_, leaf_x509.get()) || | 1764 if (!SSL_use_certificate(ssl_, leaf_x509.get()) || |
1794 !SSL_set1_chain(ssl_, chain.get())) { | 1765 !SSL_set1_chain(ssl_, chain.get())) { |
1795 LOG(WARNING) << "Failed to set client certificate"; | 1766 LOG(WARNING) << "Failed to set client certificate"; |
1796 return -1; | 1767 return -1; |
1797 } | 1768 } |
1798 | 1769 |
1799 #if defined(OS_NACL) | 1770 #if defined(OS_NACL) |
davidben
2015/11/06 21:47:45
I think this is no longer necessary. We'll just ne
svaldez
2015/11/09 17:32:16
Done.
| |
1800 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY); | 1771 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY); |
1801 return -1; | 1772 return -1; |
1802 #else | 1773 #else |
1803 // TODO(davidben): Lift this call up to the embedder so we can actually test | 1774 if (!ssl_config_.client_private_key) { |
1804 // this code. https://crbug.com/394131 | 1775 // The caller supplied a null private key. Fail the handshake and surface |
1805 private_key_ = FetchClientCertPrivateKey( | 1776 // an appropriate error to the caller. |
1806 ssl_config_.client_cert.get(), | |
1807 g_platform_key_task_runner.Get().task_runner()); | |
1808 if (!private_key_) { | |
1809 // Could not find the private key. Fail the handshake and surface an | |
1810 // appropriate error to the caller. | |
1811 LOG(WARNING) << "Client cert found without private key"; | 1777 LOG(WARNING) << "Client cert found without private key"; |
1812 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY); | 1778 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY); |
1813 return -1; | 1779 return -1; |
1814 } | 1780 } |
1815 | 1781 |
1816 SSL_set_private_key_method(ssl_, &SSLContext::kPrivateKeyMethod); | 1782 SSL_set_private_key_method(ssl_, &SSLContext::kPrivateKeyMethod); |
1817 | 1783 |
1818 std::vector<SSLPrivateKey::Hash> digest_prefs = | 1784 std::vector<SSLPrivateKey::Hash> digest_prefs = |
1819 private_key_->GetDigestPreferences(); | 1785 ssl_config_.client_private_key->GetDigestPreferences(); |
1820 | 1786 |
1821 size_t digests_len = digest_prefs.size(); | 1787 size_t digests_len = digest_prefs.size(); |
1822 std::vector<int> digests; | 1788 std::vector<int> digests; |
1823 for (size_t i = 0; i < digests_len; i++) { | 1789 for (size_t i = 0; i < digests_len; i++) { |
1824 switch (digest_prefs[i]) { | 1790 switch (digest_prefs[i]) { |
1825 case SSLPrivateKey::Hash::SHA1: | 1791 case SSLPrivateKey::Hash::SHA1: |
1826 digests.push_back(NID_sha1); | 1792 digests.push_back(NID_sha1); |
1827 break; | 1793 break; |
1828 case SSLPrivateKey::Hash::SHA256: | 1794 case SSLPrivateKey::Hash::SHA256: |
1829 digests.push_back(NID_sha256); | 1795 digests.push_back(NID_sha256); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2066 | 2032 |
2067 NextProto next_proto = NextProtoFromString(npn_proto_); | 2033 NextProto next_proto = NextProtoFromString(npn_proto_); |
2068 for (NextProto allowed : ssl_config_.renego_allowed_for_protos) { | 2034 for (NextProto allowed : ssl_config_.renego_allowed_for_protos) { |
2069 if (next_proto == allowed) | 2035 if (next_proto == allowed) |
2070 return true; | 2036 return true; |
2071 } | 2037 } |
2072 return false; | 2038 return false; |
2073 } | 2039 } |
2074 | 2040 |
2075 int SSLClientSocketOpenSSL::PrivateKeyTypeCallback() { | 2041 int SSLClientSocketOpenSSL::PrivateKeyTypeCallback() { |
2076 switch (private_key_->GetType()) { | 2042 switch (ssl_config_.client_private_key->GetType()) { |
2077 case SSLPrivateKey::Type::RSA: | 2043 case SSLPrivateKey::Type::RSA: |
2078 return EVP_PKEY_RSA; | 2044 return EVP_PKEY_RSA; |
2079 case SSLPrivateKey::Type::ECDSA: | 2045 case SSLPrivateKey::Type::ECDSA: |
2080 return EVP_PKEY_EC; | 2046 return EVP_PKEY_EC; |
2081 } | 2047 } |
2082 NOTREACHED(); | 2048 NOTREACHED(); |
2083 return EVP_PKEY_NONE; | 2049 return EVP_PKEY_NONE; |
2084 } | 2050 } |
2085 | 2051 |
2086 size_t SSLClientSocketOpenSSL::PrivateKeyMaxSignatureLenCallback() { | 2052 size_t SSLClientSocketOpenSSL::PrivateKeyMaxSignatureLenCallback() { |
2087 return private_key_->GetMaxSignatureLengthInBytes(); | 2053 return ssl_config_.client_private_key->GetMaxSignatureLengthInBytes(); |
2088 } | 2054 } |
2089 | 2055 |
2090 ssl_private_key_result_t SSLClientSocketOpenSSL::PrivateKeySignCallback( | 2056 ssl_private_key_result_t SSLClientSocketOpenSSL::PrivateKeySignCallback( |
2091 uint8_t* out, | 2057 uint8_t* out, |
2092 size_t* out_len, | 2058 size_t* out_len, |
2093 size_t max_out, | 2059 size_t max_out, |
2094 const EVP_MD* md, | 2060 const EVP_MD* md, |
2095 const uint8_t* in, | 2061 const uint8_t* in, |
2096 size_t in_len) { | 2062 size_t in_len) { |
2097 DCHECK_EQ(kNoPendingResult, signature_result_); | 2063 DCHECK_EQ(kNoPendingResult, signature_result_); |
2098 DCHECK(signature_.empty()); | 2064 DCHECK(signature_.empty()); |
2099 DCHECK(private_key_); | 2065 DCHECK(ssl_config_.client_private_key); |
2100 | 2066 |
2101 net_log_.BeginEvent(NetLog::TYPE_SSL_PRIVATE_KEY_OPERATION); | 2067 net_log_.BeginEvent(NetLog::TYPE_SSL_PRIVATE_KEY_OPERATION); |
2102 | 2068 |
2103 SSLPrivateKey::Hash hash; | 2069 SSLPrivateKey::Hash hash; |
2104 if (!EVP_MDToPrivateKeyHash(md, &hash)) { | 2070 if (!EVP_MDToPrivateKeyHash(md, &hash)) { |
2105 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); | 2071 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); |
2106 return ssl_private_key_failure; | 2072 return ssl_private_key_failure; |
2107 } | 2073 } |
2108 | 2074 |
2109 signature_result_ = ERR_IO_PENDING; | 2075 signature_result_ = ERR_IO_PENDING; |
2110 private_key_->SignDigest( | 2076 ssl_config_.client_private_key->SignDigest( |
2111 hash, base::StringPiece(reinterpret_cast<const char*>(in), in_len), | 2077 hash, base::StringPiece(reinterpret_cast<const char*>(in), in_len), |
2112 base::Bind(&SSLClientSocketOpenSSL::OnPrivateKeySignComplete, | 2078 base::Bind(&SSLClientSocketOpenSSL::OnPrivateKeySignComplete, |
2113 weak_factory_.GetWeakPtr())); | 2079 weak_factory_.GetWeakPtr())); |
2114 return ssl_private_key_retry; | 2080 return ssl_private_key_retry; |
2115 } | 2081 } |
2116 | 2082 |
2117 ssl_private_key_result_t SSLClientSocketOpenSSL::PrivateKeySignCompleteCallback( | 2083 ssl_private_key_result_t SSLClientSocketOpenSSL::PrivateKeySignCompleteCallback( |
2118 uint8_t* out, | 2084 uint8_t* out, |
2119 size_t* out_len, | 2085 size_t* out_len, |
2120 size_t max_out) { | 2086 size_t max_out) { |
2121 DCHECK_NE(kNoPendingResult, signature_result_); | 2087 DCHECK_NE(kNoPendingResult, signature_result_); |
2122 DCHECK(private_key_); | 2088 DCHECK(ssl_config_.client_private_key); |
2123 | 2089 |
2124 if (signature_result_ == ERR_IO_PENDING) | 2090 if (signature_result_ == ERR_IO_PENDING) |
2125 return ssl_private_key_retry; | 2091 return ssl_private_key_retry; |
2126 if (signature_result_ != OK) { | 2092 if (signature_result_ != OK) { |
2127 OpenSSLPutNetError(FROM_HERE, signature_result_); | 2093 OpenSSLPutNetError(FROM_HERE, signature_result_); |
2128 return ssl_private_key_failure; | 2094 return ssl_private_key_failure; |
2129 } | 2095 } |
2130 if (signature_.size() > max_out) { | 2096 if (signature_.size() > max_out) { |
2131 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); | 2097 OpenSSLPutNetError(FROM_HERE, ERR_SSL_CLIENT_AUTH_SIGNATURE_FAILED); |
2132 return ssl_private_key_failure; | 2098 return ssl_private_key_failure; |
2133 } | 2099 } |
2134 memcpy(out, vector_as_array(&signature_), signature_.size()); | 2100 memcpy(out, vector_as_array(&signature_), signature_.size()); |
2135 *out_len = signature_.size(); | 2101 *out_len = signature_.size(); |
2136 signature_.clear(); | 2102 signature_.clear(); |
2137 return ssl_private_key_success; | 2103 return ssl_private_key_success; |
2138 } | 2104 } |
2139 | 2105 |
2140 void SSLClientSocketOpenSSL::OnPrivateKeySignComplete( | 2106 void SSLClientSocketOpenSSL::OnPrivateKeySignComplete( |
2141 Error error, | 2107 Error error, |
2142 const std::vector<uint8_t>& signature) { | 2108 const std::vector<uint8_t>& signature) { |
2143 DCHECK_EQ(ERR_IO_PENDING, signature_result_); | 2109 DCHECK_EQ(ERR_IO_PENDING, signature_result_); |
2144 DCHECK(signature_.empty()); | 2110 DCHECK(signature_.empty()); |
2145 DCHECK(private_key_); | 2111 DCHECK(ssl_config_.client_private_key); |
2146 | 2112 |
2147 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SSL_PRIVATE_KEY_OPERATION, | 2113 net_log_.EndEventWithNetErrorCode(NetLog::TYPE_SSL_PRIVATE_KEY_OPERATION, |
2148 error); | 2114 error); |
2149 | 2115 |
2150 signature_result_ = error; | 2116 signature_result_ = error; |
2151 if (signature_result_ == OK) | 2117 if (signature_result_ == OK) |
2152 signature_ = signature; | 2118 signature_ = signature; |
2153 | 2119 |
2154 if (next_handshake_state_ == STATE_HANDSHAKE) { | 2120 if (next_handshake_state_ == STATE_HANDSHAKE) { |
2155 OnHandshakeIOComplete(signature_result_); | 2121 OnHandshakeIOComplete(signature_result_); |
2156 return; | 2122 return; |
2157 } | 2123 } |
2158 | 2124 |
2159 // During a renegotiation, either Read or Write calls may be blocked on an | 2125 // During a renegotiation, either Read or Write calls may be blocked on an |
2160 // asynchronous private key operation. | 2126 // asynchronous private key operation. |
2161 PumpReadWriteEvents(); | 2127 PumpReadWriteEvents(); |
2162 } | 2128 } |
2163 | 2129 |
2164 } // namespace net | 2130 } // namespace net |
OLD | NEW |