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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
8 | 8 |
9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 //////////////////////////////////////////////////////////////////////////// | 641 //////////////////////////////////////////////////////////////////////////// |
642 int DoBufferRecv(IOBuffer* buffer, int len); | 642 int DoBufferRecv(IOBuffer* buffer, int len); |
643 int DoBufferSend(IOBuffer* buffer, int len); | 643 int DoBufferSend(IOBuffer* buffer, int len); |
644 int DoGetChannelID(const std::string& host); | 644 int DoGetChannelID(const std::string& host); |
645 | 645 |
646 void OnGetChannelIDComplete(int result); | 646 void OnGetChannelIDComplete(int result); |
647 void OnHandshakeStateUpdated(const HandshakeState& state); | 647 void OnHandshakeStateUpdated(const HandshakeState& state); |
648 void OnNSSBufferUpdated(int amount_in_read_buffer); | 648 void OnNSSBufferUpdated(int amount_in_read_buffer); |
649 void DidNSSRead(int result); | 649 void DidNSSRead(int result); |
650 void DidNSSWrite(int result); | 650 void DidNSSWrite(int result); |
651 void RecordChannelIDSupportOnNetworkTaskRunner( | 651 void RecordChannelIDSupportOnNetworkTaskRunner(bool negotiated_channel_id, |
652 bool negotiated_channel_id, | 652 bool channel_id_enabled) const; |
653 bool channel_id_enabled, | |
654 bool supports_ecc) const; | |
655 | 653 |
656 //////////////////////////////////////////////////////////////////////////// | 654 //////////////////////////////////////////////////////////////////////////// |
657 // Methods that are called on both the network task runner and the NSS | 655 // Methods that are called on both the network task runner and the NSS |
658 // task runner. | 656 // task runner. |
659 //////////////////////////////////////////////////////////////////////////// | 657 //////////////////////////////////////////////////////////////////////////// |
660 void OnHandshakeIOComplete(int result); | 658 void OnHandshakeIOComplete(int result); |
661 void BufferRecvComplete(IOBuffer* buffer, int result); | 659 void BufferRecvComplete(IOBuffer* buffer, int result); |
662 void BufferSendComplete(int result); | 660 void BufferSendComplete(int result); |
663 | 661 |
664 // PostOrRunCallback is a helper function to ensure that |callback| is | 662 // PostOrRunCallback is a helper function to ensure that |callback| is |
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 void SSLClientSocketNSS::Core::RecordChannelIDSupportOnNSSTaskRunner() { | 2122 void SSLClientSocketNSS::Core::RecordChannelIDSupportOnNSSTaskRunner() { |
2125 DCHECK(OnNSSTaskRunner()); | 2123 DCHECK(OnNSSTaskRunner()); |
2126 if (nss_handshake_state_.resumed_handshake) | 2124 if (nss_handshake_state_.resumed_handshake) |
2127 return; | 2125 return; |
2128 | 2126 |
2129 // Copy the NSS task runner-only state to the network task runner and | 2127 // Copy the NSS task runner-only state to the network task runner and |
2130 // log histograms from there, since the histograms also need access to the | 2128 // log histograms from there, since the histograms also need access to the |
2131 // network task runner state. | 2129 // network task runner state. |
2132 PostOrRunCallback( | 2130 PostOrRunCallback( |
2133 FROM_HERE, | 2131 FROM_HERE, |
2134 base::Bind(&Core::RecordChannelIDSupportOnNetworkTaskRunner, | 2132 base::Bind(&Core::RecordChannelIDSupportOnNetworkTaskRunner, this, |
2135 this, | 2133 channel_id_xtn_negotiated_, ssl_config_.channel_id_enabled)); |
2136 channel_id_xtn_negotiated_, | |
2137 ssl_config_.channel_id_enabled, | |
2138 crypto::ECPrivateKey::IsSupported())); | |
2139 } | 2134 } |
2140 | 2135 |
2141 void SSLClientSocketNSS::Core::RecordChannelIDSupportOnNetworkTaskRunner( | 2136 void SSLClientSocketNSS::Core::RecordChannelIDSupportOnNetworkTaskRunner( |
2142 bool negotiated_channel_id, | 2137 bool negotiated_channel_id, |
2143 bool channel_id_enabled, | 2138 bool channel_id_enabled) const { |
2144 bool supports_ecc) const { | |
2145 DCHECK(OnNetworkTaskRunner()); | 2139 DCHECK(OnNetworkTaskRunner()); |
2146 | 2140 |
2147 RecordChannelIDSupport(channel_id_service_, | 2141 RecordChannelIDSupport(channel_id_service_, negotiated_channel_id, |
2148 negotiated_channel_id, | 2142 channel_id_enabled); |
2149 channel_id_enabled, | |
2150 supports_ecc); | |
2151 } | 2143 } |
2152 | 2144 |
2153 int SSLClientSocketNSS::Core::DoBufferRecv(IOBuffer* read_buffer, int len) { | 2145 int SSLClientSocketNSS::Core::DoBufferRecv(IOBuffer* read_buffer, int len) { |
2154 DCHECK(OnNetworkTaskRunner()); | 2146 DCHECK(OnNetworkTaskRunner()); |
2155 DCHECK_GT(len, 0); | 2147 DCHECK_GT(len, 0); |
2156 | 2148 |
2157 if (detached_) | 2149 if (detached_) |
2158 return ERR_ABORTED; | 2150 return ERR_ABORTED; |
2159 | 2151 |
2160 int rv = transport_->socket()->Read( | 2152 int rv = transport_->socket()->Read( |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3184 return channel_id_service_; | 3176 return channel_id_service_; |
3185 } | 3177 } |
3186 | 3178 |
3187 SSLFailureState SSLClientSocketNSS::GetSSLFailureState() const { | 3179 SSLFailureState SSLClientSocketNSS::GetSSLFailureState() const { |
3188 if (completed_handshake_) | 3180 if (completed_handshake_) |
3189 return SSL_FAILURE_NONE; | 3181 return SSL_FAILURE_NONE; |
3190 return SSL_FAILURE_UNKNOWN; | 3182 return SSL_FAILURE_UNKNOWN; |
3191 } | 3183 } |
3192 | 3184 |
3193 } // namespace net | 3185 } // namespace net |
OLD | NEW |