| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // inadequate TLS version. | 178 // inadequate TLS version. |
| 179 static bool IsTLSVersionAdequateForHTTP2(const SSLConfig& ssl_config); | 179 static bool IsTLSVersionAdequateForHTTP2(const SSLConfig& ssl_config); |
| 180 | 180 |
| 181 // Serializes |next_protos| in the wire format for ALPN: protocols are listed | 181 // Serializes |next_protos| in the wire format for ALPN: protocols are listed |
| 182 // in order, each prefixed by a one-byte length. Any HTTP/2 protocols in | 182 // in order, each prefixed by a one-byte length. Any HTTP/2 protocols in |
| 183 // |next_protos| are ignored if |can_advertise_http2| is false. | 183 // |next_protos| are ignored if |can_advertise_http2| is false. |
| 184 static std::vector<uint8_t> SerializeNextProtos( | 184 static std::vector<uint8_t> SerializeNextProtos( |
| 185 const NextProtoVector& next_protos, | 185 const NextProtoVector& next_protos, |
| 186 bool can_advertise_http2); | 186 bool can_advertise_http2); |
| 187 | 187 |
| 188 // For unit testing only. | |
| 189 // Returns the unverified certificate chain as presented by server. | |
| 190 // Note that chain may be different than the verified chain returned by | |
| 191 // StreamSocket::GetSSLInfo(). | |
| 192 virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() | |
| 193 const = 0; | |
| 194 | |
| 195 private: | 188 private: |
| 196 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); | 189 FRIEND_TEST_ALL_PREFIXES(SSLClientSocket, SerializeNextProtos); |
| 197 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. | 190 // For signed_cert_timestamps_received_ and stapled_ocsp_response_received_. |
| 198 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 191 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 199 ConnectSignedCertTimestampsEnabledTLSExtension); | 192 ConnectSignedCertTimestampsEnabledTLSExtension); |
| 200 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 193 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 201 ConnectSignedCertTimestampsEnabledOCSP); | 194 ConnectSignedCertTimestampsEnabledOCSP); |
| 202 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 195 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 203 ConnectSignedCertTimestampsDisabled); | 196 ConnectSignedCertTimestampsDisabled); |
| 204 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, | 197 FRIEND_TEST_ALL_PREFIXES(SSLClientSocketTest, |
| 205 VerifyServerChainProperlyOrdered); | 198 VerifyServerChainProperlyOrdered); |
| 206 | 199 |
| 207 // True if SCTs were received via a TLS extension. | 200 // True if SCTs were received via a TLS extension. |
| 208 bool signed_cert_timestamps_received_; | 201 bool signed_cert_timestamps_received_; |
| 209 // True if a stapled OCSP response was received. | 202 // True if a stapled OCSP response was received. |
| 210 bool stapled_ocsp_response_received_; | 203 bool stapled_ocsp_response_received_; |
| 211 // Protocol negotiation extension used. | 204 // Protocol negotiation extension used. |
| 212 SSLNegotiationExtension negotiation_extension_; | 205 SSLNegotiationExtension negotiation_extension_; |
| 213 }; | 206 }; |
| 214 | 207 |
| 215 } // namespace net | 208 } // namespace net |
| 216 | 209 |
| 217 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 210 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |