| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
| 12 #include "net/base/load_flags.h" | 12 #include "net/base/load_flags.h" |
| 13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
| 14 #include "net/socket/ssl_socket.h" | 14 #include "net/socket/ssl_socket.h" |
| 15 #include "net/socket/stream_socket.h" | 15 #include "net/socket/stream_socket.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 class CertVerifier; | 19 class CertVerifier; |
| 20 class DnsCertProvenanceChecker; | |
| 21 class OriginBoundCertService; | 20 class OriginBoundCertService; |
| 22 class SSLCertRequestInfo; | 21 class SSLCertRequestInfo; |
| 23 class SSLHostInfo; | 22 class SSLHostInfo; |
| 24 class SSLHostInfoFactory; | 23 class SSLHostInfoFactory; |
| 25 class SSLInfo; | 24 class SSLInfo; |
| 26 class TransportSecurityState; | 25 class TransportSecurityState; |
| 27 | 26 |
| 28 // This struct groups together several fields which are used by various | 27 // This struct groups together several fields which are used by various |
| 29 // classes related to SSLClientSocket. | 28 // classes related to SSLClientSocket. |
| 30 struct SSLClientSocketContext { | 29 struct SSLClientSocketContext { |
| 31 SSLClientSocketContext() | 30 SSLClientSocketContext() |
| 32 : cert_verifier(NULL), | 31 : cert_verifier(NULL), |
| 33 origin_bound_cert_service(NULL), | 32 origin_bound_cert_service(NULL), |
| 34 transport_security_state(NULL), | 33 transport_security_state(NULL), |
| 35 dns_cert_checker(NULL), | |
| 36 ssl_host_info_factory(NULL) {} | 34 ssl_host_info_factory(NULL) {} |
| 37 | 35 |
| 38 SSLClientSocketContext(CertVerifier* cert_verifier_arg, | 36 SSLClientSocketContext(CertVerifier* cert_verifier_arg, |
| 39 OriginBoundCertService* origin_bound_cert_service_arg, | 37 OriginBoundCertService* origin_bound_cert_service_arg, |
| 40 TransportSecurityState* transport_security_state_arg, | 38 TransportSecurityState* transport_security_state_arg, |
| 41 DnsCertProvenanceChecker* dns_cert_checker_arg, | |
| 42 SSLHostInfoFactory* ssl_host_info_factory_arg, | 39 SSLHostInfoFactory* ssl_host_info_factory_arg, |
| 43 const std::string& ssl_session_cache_shard_arg) | 40 const std::string& ssl_session_cache_shard_arg) |
| 44 : cert_verifier(cert_verifier_arg), | 41 : cert_verifier(cert_verifier_arg), |
| 45 origin_bound_cert_service(origin_bound_cert_service_arg), | 42 origin_bound_cert_service(origin_bound_cert_service_arg), |
| 46 transport_security_state(transport_security_state_arg), | 43 transport_security_state(transport_security_state_arg), |
| 47 dns_cert_checker(dns_cert_checker_arg), | |
| 48 ssl_host_info_factory(ssl_host_info_factory_arg), | 44 ssl_host_info_factory(ssl_host_info_factory_arg), |
| 49 ssl_session_cache_shard(ssl_session_cache_shard_arg) {} | 45 ssl_session_cache_shard(ssl_session_cache_shard_arg) {} |
| 50 | 46 |
| 51 CertVerifier* cert_verifier; | 47 CertVerifier* cert_verifier; |
| 52 OriginBoundCertService* origin_bound_cert_service; | 48 OriginBoundCertService* origin_bound_cert_service; |
| 53 TransportSecurityState* transport_security_state; | 49 TransportSecurityState* transport_security_state; |
| 54 DnsCertProvenanceChecker* dns_cert_checker; | |
| 55 SSLHostInfoFactory* ssl_host_info_factory; | 50 SSLHostInfoFactory* ssl_host_info_factory; |
| 56 // ssl_session_cache_shard is an opaque string that identifies a shard of the | 51 // ssl_session_cache_shard is an opaque string that identifies a shard of the |
| 57 // SSL session cache. SSL sockets with the same ssl_session_cache_shard may | 52 // SSL session cache. SSL sockets with the same ssl_session_cache_shard may |
| 58 // resume each other's SSL sessions but we'll never sessions between shards. | 53 // resume each other's SSL sessions but we'll never sessions between shards. |
| 59 const std::string ssl_session_cache_shard; | 54 const std::string ssl_session_cache_shard; |
| 60 }; | 55 }; |
| 61 | 56 |
| 62 // A client socket that uses SSL as the transport layer. | 57 // A client socket that uses SSL as the transport layer. |
| 63 // | 58 // |
| 64 // NOTE: The SSL handshake occurs within the Connect method after a TCP | 59 // NOTE: The SSL handshake occurs within the Connect method after a TCP |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 bool was_spdy_negotiated_; | 153 bool was_spdy_negotiated_; |
| 159 // Protocol that we negotiated with the server. | 154 // Protocol that we negotiated with the server. |
| 160 SSLClientSocket::NextProto next_protocol_; | 155 SSLClientSocket::NextProto next_protocol_; |
| 161 // True if an origin bound certificate was sent. | 156 // True if an origin bound certificate was sent. |
| 162 bool was_origin_bound_cert_sent_; | 157 bool was_origin_bound_cert_sent_; |
| 163 }; | 158 }; |
| 164 | 159 |
| 165 } // namespace net | 160 } // namespace net |
| 166 | 161 |
| 167 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 162 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |