| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 bool supports_ecc); | 202 bool supports_ecc); |
| 203 | 203 |
| 204 // Records ConnectionType histograms for a successful SSL connection. | 204 // Records ConnectionType histograms for a successful SSL connection. |
| 205 static void RecordConnectionTypeMetrics(int ssl_version); | 205 static void RecordConnectionTypeMetrics(int ssl_version); |
| 206 | 206 |
| 207 // Returns whether TLS channel ID is enabled. | 207 // Returns whether TLS channel ID is enabled. |
| 208 static bool IsChannelIDEnabled( | 208 static bool IsChannelIDEnabled( |
| 209 const SSLConfig& ssl_config, | 209 const SSLConfig& ssl_config, |
| 210 ChannelIDService* channel_id_service); | 210 ChannelIDService* channel_id_service); |
| 211 | 211 |
| 212 // Determine if there is at least one enabled cipher suite and TLS version |
| 213 // that is satisfies Section 9.2 of the HTTP/2 specification. Note that the |
| 214 // server might still pick an inadequate cipher suite or TLS version. |
| 215 static bool IsSecurityAdequateForHTTP2( |
| 216 const SSLConfig& ssl_config, |
| 217 const std::vector<uint16>& cipher_suites); |
| 218 |
| 212 // Serializes |next_protos| in the wire format for ALPN: protocols are listed | 219 // Serializes |next_protos| in the wire format for ALPN: protocols are listed |
| 213 // in order, each prefixed by a one-byte length. | 220 // in order, each prefixed by a one-byte length. Any HTTP/2 protocols in |
| 221 // |next_protos| are ignored if |can_advertise_http2| is false. |
| 214 static std::vector<uint8_t> SerializeNextProtos( | 222 static std::vector<uint8_t> SerializeNextProtos( |
| 215 const NextProtoVector& next_protos); | 223 const NextProtoVector& next_protos, |
| 224 bool can_advertise_http2); |
| 216 | 225 |
| 217 // For unit testing only. | 226 // For unit testing only. |
| 218 // Returns the unverified certificate chain as presented by server. | 227 // Returns the unverified certificate chain as presented by server. |
| 219 // Note that chain may be different than the verified chain returned by | 228 // Note that chain may be different than the verified chain returned by |
| 220 // StreamSocket::GetSSLInfo(). | 229 // StreamSocket::GetSSLInfo(). |
| 221 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() | 230 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() |
| 222 const = 0; | 231 const = 0; |
| 223 | 232 |
| 224 private: | 233 private: |
| 225 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); | 234 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 245 bool signed_cert_timestamps_received_; | 254 bool signed_cert_timestamps_received_; |
| 246 // True if a stapled OCSP response was received. | 255 // True if a stapled OCSP response was received. |
| 247 bool stapled_ocsp_response_received_; | 256 bool stapled_ocsp_response_received_; |
| 248 // Protocol negotiation extension used. | 257 // Protocol negotiation extension used. |
| 249 SSLNegotiationExtension negotiation_extension_; | 258 SSLNegotiationExtension negotiation_extension_; |
| 250 }; | 259 }; |
| 251 | 260 |
| 252 } // namespace net | 261 } // namespace net |
| 253 | 262 |
| 254 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 263 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |