| 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_OPENSSL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // The given hostname will be compared with the name(s) in the server's | 36 // The given hostname will be compared with the name(s) in the server's |
| 37 // certificate during the SSL handshake. ssl_config specifies the SSL | 37 // certificate during the SSL handshake. ssl_config specifies the SSL |
| 38 // settings. | 38 // settings. |
| 39 SSLClientSocketOpenSSL(ClientSocketHandle* transport_socket, | 39 SSLClientSocketOpenSSL(ClientSocketHandle* transport_socket, |
| 40 const HostPortPair& host_and_port, | 40 const HostPortPair& host_and_port, |
| 41 const SSLConfig& ssl_config, | 41 const SSLConfig& ssl_config, |
| 42 const SSLClientSocketContext& context); | 42 const SSLClientSocketContext& context); |
| 43 ~SSLClientSocketOpenSSL(); | 43 ~SSLClientSocketOpenSSL(); |
| 44 | 44 |
| 45 const HostPortPair& host_and_port() const { return host_and_port_; } | 45 const HostPortPair& host_and_port() const { return host_and_port_; } |
| 46 const std::string& session_cache_shard() const { |
| 47 return session_cache_shard_; |
| 48 } |
| 46 | 49 |
| 47 // Callback from the SSL layer that indicates the remote server is requesting | 50 // Callback from the SSL layer that indicates the remote server is requesting |
| 48 // a certificate for this client. | 51 // a certificate for this client. |
| 49 int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey); | 52 int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey); |
| 50 | 53 |
| 51 // Callback from the SSL layer to check which NPN protocol we are supporting | 54 // Callback from the SSL layer to check which NPN protocol we are supporting |
| 52 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen, | 55 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen, |
| 53 const unsigned char* in, unsigned int inlen); | 56 const unsigned char* in, unsigned int inlen); |
| 54 | 57 |
| 55 // SSLClientSocket implementation. | 58 // SSLClientSocket implementation. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 CertVerifier* const cert_verifier_; | 152 CertVerifier* const cert_verifier_; |
| 150 scoped_ptr<SingleRequestCertVerifier> verifier_; | 153 scoped_ptr<SingleRequestCertVerifier> verifier_; |
| 151 | 154 |
| 152 // OpenSSL stuff | 155 // OpenSSL stuff |
| 153 SSL* ssl_; | 156 SSL* ssl_; |
| 154 BIO* transport_bio_; | 157 BIO* transport_bio_; |
| 155 | 158 |
| 156 scoped_ptr<ClientSocketHandle> transport_; | 159 scoped_ptr<ClientSocketHandle> transport_; |
| 157 const HostPortPair host_and_port_; | 160 const HostPortPair host_and_port_; |
| 158 SSLConfig ssl_config_; | 161 SSLConfig ssl_config_; |
| 162 // session_cache_shard_ is an opaque string that partitions the SSL session |
| 163 // cache. i.e. sessions created with one value will not attempt to resume on |
| 164 // the socket with a different value. |
| 165 const std::string session_cache_shard_; |
| 159 | 166 |
| 160 // Used for session cache diagnostics. | 167 // Used for session cache diagnostics. |
| 161 bool trying_cached_session_; | 168 bool trying_cached_session_; |
| 162 | 169 |
| 163 enum State { | 170 enum State { |
| 164 STATE_NONE, | 171 STATE_NONE, |
| 165 STATE_HANDSHAKE, | 172 STATE_HANDSHAKE, |
| 166 STATE_VERIFY_CERT, | 173 STATE_VERIFY_CERT, |
| 167 STATE_VERIFY_CERT_COMPLETE, | 174 STATE_VERIFY_CERT_COMPLETE, |
| 168 }; | 175 }; |
| 169 State next_handshake_state_; | 176 State next_handshake_state_; |
| 170 NextProtoStatus npn_status_; | 177 NextProtoStatus npn_status_; |
| 171 std::string npn_proto_; | 178 std::string npn_proto_; |
| 172 std::string server_protos_; | 179 std::string server_protos_; |
| 173 BoundNetLog net_log_; | 180 BoundNetLog net_log_; |
| 174 }; | 181 }; |
| 175 | 182 |
| 176 } // namespace net | 183 } // namespace net |
| 177 | 184 |
| 178 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 185 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| OLD | NEW |