| 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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 static bool IgnoreCertError(int error, int load_flags); | 118 static bool IgnoreCertError(int error, int load_flags); |
| 119 | 119 |
| 120 // ClearSessionCache clears the SSL session cache, used to resume SSL | 120 // ClearSessionCache clears the SSL session cache, used to resume SSL |
| 121 // sessions. | 121 // sessions. |
| 122 static void ClearSessionCache(); | 122 static void ClearSessionCache(); |
| 123 | 123 |
| 124 // Get the maximum SSL version supported by the underlying library and | 124 // Get the maximum SSL version supported by the underlying library and |
| 125 // cryptographic implementation. | 125 // cryptographic implementation. |
| 126 static uint16 GetMaxSupportedSSLVersion(); | 126 static uint16 GetMaxSupportedSSLVersion(); |
| 127 | 127 |
| 128 void set_negotiation_extension(SSLNegotiationExtension negotiation_extension); | |
| 129 | |
| 130 // Returns the ChannelIDService used by this socket, or NULL if | 128 // Returns the ChannelIDService used by this socket, or NULL if |
| 131 // channel ids are not supported. | 129 // channel ids are not supported. |
| 132 virtual ChannelIDService* GetChannelIDService() const = 0; | 130 virtual ChannelIDService* GetChannelIDService() const = 0; |
| 133 | 131 |
| 134 protected: | 132 protected: |
| 135 virtual void set_signed_cert_timestamps_received( | 133 void set_negotiation_extension( |
| 136 bool signed_cert_timestamps_received); | 134 SSLNegotiationExtension negotiation_extension) { |
| 135 negotiation_extension_ = negotiation_extension; |
| 136 } |
| 137 | 137 |
| 138 virtual void set_stapled_ocsp_response_received( | 138 void set_signed_cert_timestamps_received( |
| 139 bool stapled_ocsp_response_received); | 139 bool signed_cert_timestamps_received) { |
| 140 signed_cert_timestamps_received_ = signed_cert_timestamps_received; |
| 141 } |
| 142 |
| 143 void set_stapled_ocsp_response_received(bool stapled_ocsp_response_received) { |
| 144 stapled_ocsp_response_received_ = stapled_ocsp_response_received; |
| 145 } |
| 140 | 146 |
| 141 // Record which TLS extension was used to negotiate protocol and protocol | 147 // Record which TLS extension was used to negotiate protocol and protocol |
| 142 // chosen in a UMA histogram. | 148 // chosen in a UMA histogram. |
| 143 void RecordNegotiationExtension(); | 149 void RecordNegotiationExtension(); |
| 144 | 150 |
| 145 // Records histograms for channel id support during full handshakes - resumed | 151 // Records histograms for channel id support during full handshakes - resumed |
| 146 // handshakes are ignored. | 152 // handshakes are ignored. |
| 147 static void RecordChannelIDSupport( | 153 static void RecordChannelIDSupport( |
| 148 ChannelIDService* channel_id_service, | 154 ChannelIDService* channel_id_service, |
| 149 bool negotiated_channel_id, | 155 bool negotiated_channel_id, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. | 191 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. |
| 186 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 192 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 187 ConnectSignedCertTimestampsEnabledTLSExtension); | 193 ConnectSignedCertTimestampsEnabledTLSExtension); |
| 188 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 194 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 189 ConnectSignedCertTimestampsEnabledOCSP); | 195 ConnectSignedCertTimestampsEnabledOCSP); |
| 190 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 196 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 191 ConnectSignedCertTimestampsDisabled); | 197 ConnectSignedCertTimestampsDisabled); |
| 192 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 198 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 193 VerifyServerChainProperlyOrdered); | 199 VerifyServerChainProperlyOrdered); |
| 194 | 200 |
| 195 // Protocol that we negotiated with the server. | |
| 196 NextProto protocol_negotiated_; | |
| 197 // True if SCTs were received via a TLS extension. | 201 // True if SCTs were received via a TLS extension. |
| 198 bool signed_cert_timestamps_received_; | 202 bool signed_cert_timestamps_received_; |
| 199 // True if a stapled OCSP response was received. | 203 // True if a stapled OCSP response was received. |
| 200 bool stapled_ocsp_response_received_; | 204 bool stapled_ocsp_response_received_; |
| 201 // Protocol negotiation extension used. | 205 // Protocol negotiation extension used. |
| 202 SSLNegotiationExtension negotiation_extension_; | 206 SSLNegotiationExtension negotiation_extension_; |
| 203 }; | 207 }; |
| 204 | 208 |
| 205 } // namespace net | 209 } // namespace net |
| 206 | 210 |
| 207 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 211 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |