[email protected] | 61f3ddf | 2012-02-08 02:45:39 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 6 | #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 7 | |
[email protected] | ea4a1c6a | 2010-12-09 13:33:28 | [diff] [blame] | 8 | #include <string> |
| 9 | |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 10 | #include "base/compiler_specific.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 11 | #include "base/memory/scoped_ptr.h" |
[email protected] | be90ba3 | 2013-05-13 20:05:25 | [diff] [blame] | 12 | #include "base/memory/weak_ptr.h" |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 13 | #include "net/base/completion_callback.h" |
| 14 | #include "net/base/io_buffer.h" |
[email protected] | 6e7845ae | 2013-03-29 21:48:11 | [diff] [blame] | 15 | #include "net/cert/cert_verify_result.h" |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 16 | #include "net/socket/client_socket_handle.h" |
[email protected] | 536fd0b | 2013-03-14 17:41:57 | [diff] [blame] | 17 | #include "net/socket/ssl_client_socket.h" |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 18 | #include "net/ssl/channel_id_service.h" |
[email protected] | c078770 | 2014-05-20 21:51:44 | [diff] [blame] | 19 | #include "net/ssl/ssl_client_cert_type.h" |
[email protected] | 536fd0b | 2013-03-14 17:41:57 | [diff] [blame] | 20 | #include "net/ssl/ssl_config_service.h" |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 21 | |
[email protected] | 03a07b2e | 2013-02-11 20:13:45 | [diff] [blame] | 22 | // Avoid including misc OpenSSL headers, i.e.: |
| 23 | // <openssl/bio.h> |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 24 | typedef struct bio_st BIO; |
[email protected] | 03a07b2e | 2013-02-11 20:13:45 | [diff] [blame] | 25 | // <openssl/evp.h> |
[email protected] | 718c967 | 2010-12-02 10:04:10 | [diff] [blame] | 26 | typedef struct evp_pkey_st EVP_PKEY; |
[email protected] | 03a07b2e | 2013-02-11 20:13:45 | [diff] [blame] | 27 | // <openssl/ssl.h> |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 28 | typedef struct ssl_st SSL; |
[email protected] | 03a07b2e | 2013-02-11 20:13:45 | [diff] [blame] | 29 | // <openssl/x509.h> |
[email protected] | 718c967 | 2010-12-02 10:04:10 | [diff] [blame] | 30 | typedef struct x509_st X509; |
[email protected] | b051cdb6 | 2014-02-28 02:20:16 | [diff] [blame] | 31 | // <openssl/ossl_type.h> |
| 32 | typedef struct x509_store_ctx_st X509_STORE_CTX; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 33 | |
| 34 | namespace net { |
| 35 | |
[email protected] | 170e76c | 2010-10-04 15:04:20 | [diff] [blame] | 36 | class CertVerifier; |
[email protected] | 822581d | 2010-12-16 17:27:15 | [diff] [blame] | 37 | class SingleRequestCertVerifier; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 38 | class SSLCertRequestInfo; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 39 | class SSLInfo; |
| 40 | |
| 41 | // An SSL client socket implemented with OpenSSL. |
| 42 | class SSLClientSocketOpenSSL : public SSLClientSocket { |
| 43 | public: |
| 44 | // Takes ownership of the transport_socket, which may already be connected. |
| 45 | // The given hostname will be compared with the name(s) in the server's |
| 46 | // certificate during the SSL handshake. ssl_config specifies the SSL |
| 47 | // settings. |
[email protected] | 18ccfdb | 2013-08-15 00:13:44 | [diff] [blame] | 48 | SSLClientSocketOpenSSL(scoped_ptr<ClientSocketHandle> transport_socket, |
[email protected] | 055d7f2 | 2010-11-15 12:03:12 | [diff] [blame] | 49 | const HostPortPair& host_and_port, |
[email protected] | 822581d | 2010-12-16 17:27:15 | [diff] [blame] | 50 | const SSLConfig& ssl_config, |
[email protected] | feb79bcd | 2011-07-21 16:55:17 | [diff] [blame] | 51 | const SSLClientSocketContext& context); |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 52 | virtual ~SSLClientSocketOpenSSL(); |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 53 | |
[email protected] | fbef1393 | 2010-11-23 12:38:53 | [diff] [blame] | 54 | const HostPortPair& host_and_port() const { return host_and_port_; } |
[email protected] | c3456bb | 2011-12-12 22:22:19 | [diff] [blame] | 55 | const std::string& ssl_session_cache_shard() const { |
| 56 | return ssl_session_cache_shard_; |
| 57 | } |
[email protected] | fbef1393 | 2010-11-23 12:38:53 | [diff] [blame] | 58 | |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 59 | // SSLClientSocket implementation. |
[email protected] | 8e45855 | 2014-08-05 00:02:15 | [diff] [blame] | 60 | virtual bool InSessionCache() const OVERRIDE; |
| 61 | virtual void SetHandshakeCompletionCallback( |
| 62 | const base::Closure& callback) OVERRIDE; |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 63 | virtual void GetSSLCertRequestInfo( |
| 64 | SSLCertRequestInfo* cert_request_info) OVERRIDE; |
[email protected] | abc44b75 | 2014-07-30 03:52:15 | [diff] [blame] | 65 | virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE; |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 66 | virtual ChannelIDService* GetChannelIDService() const OVERRIDE; |
[email protected] | 81ec7c1 | 2012-07-31 18:32:19 | [diff] [blame] | 67 | |
| 68 | // SSLSocket implementation. |
[email protected] | b0ff3f8 | 2011-07-23 05:12:39 | [diff] [blame] | 69 | virtual int ExportKeyingMaterial(const base::StringPiece& label, |
[email protected] | 1bc6f5e | 2012-03-15 00:20:58 | [diff] [blame] | 70 | bool has_context, |
[email protected] | b0ff3f8 | 2011-07-23 05:12:39 | [diff] [blame] | 71 | const base::StringPiece& context, |
[email protected] | 1bc6f5e | 2012-03-15 00:20:58 | [diff] [blame] | 72 | unsigned char* out, |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 73 | unsigned int outlen) OVERRIDE; |
[email protected] | 81ec7c1 | 2012-07-31 18:32:19 | [diff] [blame] | 74 | virtual int GetTLSUniqueChannelBinding(std::string* out) OVERRIDE; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 75 | |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 76 | // StreamSocket implementation. |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 77 | virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
| 78 | virtual void Disconnect() OVERRIDE; |
| 79 | virtual bool IsConnected() const OVERRIDE; |
| 80 | virtual bool IsConnectedAndIdle() const OVERRIDE; |
[email protected] | a352869 | 2012-06-08 00:11:42 | [diff] [blame] | 81 | virtual int GetPeerAddress(IPEndPoint* address) const OVERRIDE; |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 82 | virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 83 | virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 84 | virtual void SetSubresourceSpeculation() OVERRIDE; |
| 85 | virtual void SetOmniboxSpeculation() OVERRIDE; |
| 86 | virtual bool WasEverUsed() const OVERRIDE; |
| 87 | virtual bool UsingTCPFastOpen() const OVERRIDE; |
[email protected] | 2d88e7d | 2012-07-19 17:55:17 | [diff] [blame] | 88 | virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 89 | |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 90 | // Socket implementation. |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 91 | virtual int Read(IOBuffer* buf, int buf_len, |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 92 | const CompletionCallback& callback) OVERRIDE; |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 93 | virtual int Write(IOBuffer* buf, int buf_len, |
[email protected] | a5bd18f | 2012-05-11 15:51:48 | [diff] [blame] | 94 | const CompletionCallback& callback) OVERRIDE; |
[email protected] | 28b96d1c | 2014-04-09 12:21:15 | [diff] [blame] | 95 | virtual int SetReceiveBufferSize(int32 size) OVERRIDE; |
| 96 | virtual int SetSendBufferSize(int32 size) OVERRIDE; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 97 | |
[email protected] | 7f38da8a | 2014-03-17 16:44:26 | [diff] [blame] | 98 | protected: |
| 99 | // SSLClientSocket implementation. |
| 100 | virtual scoped_refptr<X509Certificate> GetUnverifiedServerCertificateChain() |
| 101 | const OVERRIDE; |
| 102 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 103 | private: |
[email protected] | 7f38da8a | 2014-03-17 16:44:26 | [diff] [blame] | 104 | class PeerCertificateChain; |
[email protected] | 821e3bb | 2013-11-08 01:06:01 | [diff] [blame] | 105 | class SSLContext; |
| 106 | friend class SSLClientSocket; |
| 107 | friend class SSLContext; |
| 108 | |
[email protected] | c8a80e9 | 2014-05-17 16:02:08 | [diff] [blame] | 109 | int Init(); |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 110 | void DoReadCallback(int result); |
| 111 | void DoWriteCallback(int result); |
| 112 | |
[email protected] | 8e45855 | 2014-08-05 00:02:15 | [diff] [blame] | 113 | // Compute a unique key string for the SSL session cache. |
| 114 | std::string GetSessionCacheKey() const; |
| 115 | void OnHandshakeCompletion(); |
| 116 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 117 | bool DoTransportIO(); |
| 118 | int DoHandshake(); |
[email protected] | faff985 | 2014-06-21 06:13:46 | [diff] [blame] | 119 | int DoChannelIDLookup(); |
| 120 | int DoChannelIDLookupComplete(int result); |
[email protected] | 170e76c | 2010-10-04 15:04:20 | [diff] [blame] | 121 | int DoVerifyCert(int result); |
| 122 | int DoVerifyCertComplete(int result); |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 123 | void DoConnectCallback(int result); |
[email protected] | 170e76c | 2010-10-04 15:04:20 | [diff] [blame] | 124 | X509Certificate* UpdateServerCert(); |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 125 | |
| 126 | void OnHandshakeIOComplete(int result); |
| 127 | void OnSendComplete(int result); |
| 128 | void OnRecvComplete(int result); |
| 129 | |
| 130 | int DoHandshakeLoop(int last_io_result); |
| 131 | int DoReadLoop(int result); |
| 132 | int DoWriteLoop(int result); |
| 133 | int DoPayloadRead(); |
| 134 | int DoPayloadWrite(); |
| 135 | |
| 136 | int BufferSend(); |
| 137 | int BufferRecv(); |
| 138 | void BufferSendComplete(int result); |
| 139 | void BufferRecvComplete(int result); |
| 140 | void TransportWriteComplete(int result); |
[email protected] | 3e5c692 | 2014-02-06 02:42:16 | [diff] [blame] | 141 | int TransportReadComplete(int result); |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 142 | |
[email protected] | 821e3bb | 2013-11-08 01:06:01 | [diff] [blame] | 143 | // Callback from the SSL layer that indicates the remote server is requesting |
| 144 | // a certificate for this client. |
[email protected] | 82c5902 | 2014-08-15 09:38:27 | [diff] [blame^] | 145 | int ClientCertRequestCallback(SSL* ssl); |
[email protected] | 821e3bb | 2013-11-08 01:06:01 | [diff] [blame] | 146 | |
[email protected] | b051cdb6 | 2014-02-28 02:20:16 | [diff] [blame] | 147 | // CertVerifyCallback is called to verify the server's certificates. We do |
| 148 | // verification after the handshake so this function only enforces that the |
| 149 | // certificates don't change during renegotiation. |
| 150 | int CertVerifyCallback(X509_STORE_CTX *store_ctx); |
| 151 | |
[email protected] | 821e3bb | 2013-11-08 01:06:01 | [diff] [blame] | 152 | // Callback from the SSL layer to check which NPN protocol we are supporting |
| 153 | int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen, |
| 154 | const unsigned char* in, unsigned int inlen); |
| 155 | |
[email protected] | 5aea7918 | 2014-07-14 20:43:41 | [diff] [blame] | 156 | // Called during an operation on |transport_bio_|'s peer. Checks saved |
| 157 | // transport error state and, if appropriate, returns an error through |
| 158 | // OpenSSL's error system. |
| 159 | long MaybeReplayTransportError(BIO *bio, |
| 160 | int cmd, |
| 161 | const char *argp, int argi, long argl, |
| 162 | long retvalue); |
| 163 | |
| 164 | // Callback from the SSL layer when an operation is performed on |
| 165 | // |transport_bio_|'s peer. |
| 166 | static long BIOCallback(BIO *bio, |
| 167 | int cmd, |
| 168 | const char *argp, int argi, long argl, |
| 169 | long retvalue); |
| 170 | |
[email protected] | 64b5c89 | 2014-08-08 09:39:26 | [diff] [blame] | 171 | // Callback that is used to obtain information about the state of the SSL |
| 172 | // handshake. |
| 173 | static void InfoCallback(const SSL* ssl, int type, int val); |
| 174 | |
[email protected] | e4738ba5 | 2014-08-07 10:07:22 | [diff] [blame] | 175 | void CheckIfHandshakeFinished(); |
| 176 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 177 | bool transport_send_busy_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 178 | bool transport_recv_busy_; |
[email protected] | 4b76856 | 2013-02-16 04:10:07 | [diff] [blame] | 179 | |
| 180 | scoped_refptr<DrainableIOBuffer> send_buffer_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 181 | scoped_refptr<IOBuffer> recv_buffer_; |
| 182 | |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 183 | CompletionCallback user_connect_callback_; |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 184 | CompletionCallback user_read_callback_; |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 185 | CompletionCallback user_write_callback_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 186 | |
[email protected] | be90ba3 | 2013-05-13 20:05:25 | [diff] [blame] | 187 | base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; |
| 188 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 189 | // Used by Read function. |
| 190 | scoped_refptr<IOBuffer> user_read_buf_; |
| 191 | int user_read_buf_len_; |
| 192 | |
| 193 | // Used by Write function. |
| 194 | scoped_refptr<IOBuffer> user_write_buf_; |
| 195 | int user_write_buf_len_; |
| 196 | |
[email protected] | 4b76856 | 2013-02-16 04:10:07 | [diff] [blame] | 197 | // Used by DoPayloadRead() when attempting to fill the caller's buffer with |
| 198 | // as much data as possible without blocking. |
| 199 | // If DoPayloadRead() encounters an error after having read some data, stores |
| 200 | // the result to return on the *next* call to DoPayloadRead(). A value > 0 |
| 201 | // indicates there is no pending result, otherwise 0 indicates EOF and < 0 |
| 202 | // indicates an error. |
| 203 | int pending_read_error_; |
| 204 | |
[email protected] | 5aea7918 | 2014-07-14 20:43:41 | [diff] [blame] | 205 | // Used by TransportReadComplete() to signify an error reading from the |
| 206 | // transport socket. A value of OK indicates the socket is still |
| 207 | // readable. EOFs are mapped to ERR_CONNECTION_CLOSED. |
| 208 | int transport_read_error_; |
| 209 | |
[email protected] | 3e5c692 | 2014-02-06 02:42:16 | [diff] [blame] | 210 | // Used by TransportWriteComplete() and TransportReadComplete() to signify an |
| 211 | // error writing to the transport socket. A value of OK indicates no error. |
| 212 | int transport_write_error_; |
| 213 | |
[email protected] | 64b5c89 | 2014-08-08 09:39:26 | [diff] [blame] | 214 | // Set when Connect finishes. |
[email protected] | 7f38da8a | 2014-03-17 16:44:26 | [diff] [blame] | 215 | scoped_ptr<PeerCertificateChain> server_cert_chain_; |
[email protected] | 170e76c | 2010-10-04 15:04:20 | [diff] [blame] | 216 | scoped_refptr<X509Certificate> server_cert_; |
| 217 | CertVerifyResult server_cert_verify_result_; |
[email protected] | 64b5c89 | 2014-08-08 09:39:26 | [diff] [blame] | 218 | bool completed_connect_; |
[email protected] | 170e76c | 2010-10-04 15:04:20 | [diff] [blame] | 219 | |
[email protected] | 0dc88b3 | 2014-03-26 20:12:28 | [diff] [blame] | 220 | // Set when Read() or Write() successfully reads or writes data to or from the |
| 221 | // network. |
| 222 | bool was_ever_used_; |
| 223 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 224 | // Stores client authentication information between ClientAuthHandler and |
| 225 | // GetSSLCertRequestInfo calls. |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 226 | bool client_auth_cert_needed_; |
[email protected] | 515adc2 | 2013-01-09 16:01:23 | [diff] [blame] | 227 | // List of DER-encoded X.509 DistinguishedName of certificate authorities |
| 228 | // allowed by the server. |
| 229 | std::vector<std::string> cert_authorities_; |
[email protected] | c078770 | 2014-05-20 21:51:44 | [diff] [blame] | 230 | // List of SSLClientCertType values for client certificates allowed by the |
| 231 | // server. |
| 232 | std::vector<SSLClientCertType> cert_key_types_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 233 | |
[email protected] | 822581d | 2010-12-16 17:27:15 | [diff] [blame] | 234 | CertVerifier* const cert_verifier_; |
| 235 | scoped_ptr<SingleRequestCertVerifier> verifier_; |
[email protected] | 170e76c | 2010-10-04 15:04:20 | [diff] [blame] | 236 | |
[email protected] | ee0f2aa8 | 2013-10-25 11:59:26 | [diff] [blame] | 237 | // The service for retrieving Channel ID keys. May be NULL. |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 238 | ChannelIDService* channel_id_service_; |
[email protected] | ee0f2aa8 | 2013-10-25 11:59:26 | [diff] [blame] | 239 | |
[email protected] | 8e45855 | 2014-08-05 00:02:15 | [diff] [blame] | 240 | // Callback that is invoked when the connection finishes. |
| 241 | // |
| 242 | // Note: this callback will be run in Disconnect(). It will not alter |
| 243 | // any member variables of the SSLClientSocketOpenSSL. |
| 244 | base::Closure handshake_completion_callback_; |
| 245 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 246 | // OpenSSL stuff |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 247 | SSL* ssl_; |
| 248 | BIO* transport_bio_; |
| 249 | |
| 250 | scoped_ptr<ClientSocketHandle> transport_; |
[email protected] | 055d7f2 | 2010-11-15 12:03:12 | [diff] [blame] | 251 | const HostPortPair host_and_port_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 252 | SSLConfig ssl_config_; |
[email protected] | c3456bb | 2011-12-12 22:22:19 | [diff] [blame] | 253 | // ssl_session_cache_shard_ is an opaque string that partitions the SSL |
| 254 | // session cache. i.e. sessions created with one value will not attempt to |
| 255 | // resume on the socket with a different value. |
| 256 | const std::string ssl_session_cache_shard_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 257 | |
[email protected] | fbef1393 | 2010-11-23 12:38:53 | [diff] [blame] | 258 | // Used for session cache diagnostics. |
| 259 | bool trying_cached_session_; |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 260 | |
| 261 | enum State { |
| 262 | STATE_NONE, |
| 263 | STATE_HANDSHAKE, |
[email protected] | faff985 | 2014-06-21 06:13:46 | [diff] [blame] | 264 | STATE_CHANNEL_ID_LOOKUP, |
| 265 | STATE_CHANNEL_ID_LOOKUP_COMPLETE, |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 266 | STATE_VERIFY_CERT, |
| 267 | STATE_VERIFY_CERT_COMPLETE, |
| 268 | }; |
| 269 | State next_handshake_state_; |
[email protected] | ea4a1c6a | 2010-12-09 13:33:28 | [diff] [blame] | 270 | NextProtoStatus npn_status_; |
| 271 | std::string npn_proto_; |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 272 | // Written by the |channel_id_service_|. |
[email protected] | ee0f2aa8 | 2013-10-25 11:59:26 | [diff] [blame] | 273 | std::string channel_id_private_key_; |
| 274 | std::string channel_id_cert_; |
[email protected] | ee0f2aa8 | 2013-10-25 11:59:26 | [diff] [blame] | 275 | // True if channel ID extension was negotiated. |
| 276 | bool channel_id_xtn_negotiated_; |
[email protected] | e4738ba5 | 2014-08-07 10:07:22 | [diff] [blame] | 277 | // True if InfoCallback has been run with result = SSL_CB_HANDSHAKE_DONE. |
[email protected] | 64b5c89 | 2014-08-08 09:39:26 | [diff] [blame] | 278 | bool handshake_succeeded_; |
[email protected] | e4738ba5 | 2014-08-07 10:07:22 | [diff] [blame] | 279 | // True if MarkSSLSessionAsGood has been called for this socket's |
[email protected] | 64b5c89 | 2014-08-08 09:39:26 | [diff] [blame] | 280 | // SSL session. |
[email protected] | e4738ba5 | 2014-08-07 10:07:22 | [diff] [blame] | 281 | bool marked_session_as_good_; |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 282 | // The request handle for |channel_id_service_|. |
| 283 | ChannelIDService::RequestHandle channel_id_request_handle_; |
[email protected] | 8bd4e7a | 2014-08-09 14:49:17 | [diff] [blame] | 284 | |
| 285 | TransportSecurityState* transport_security_state_; |
| 286 | |
| 287 | // pinning_failure_log contains a message produced by |
| 288 | // TransportSecurityState::CheckPublicKeyPins in the event of a |
| 289 | // pinning failure. It is a (somewhat) human-readable string. |
| 290 | std::string pinning_failure_log_; |
| 291 | |
[email protected] | d518cd9 | 2010-09-29 12:27:44 | [diff] [blame] | 292 | BoundNetLog net_log_; |
| 293 | }; |
| 294 | |
| 295 | } // namespace net |
| 296 | |
[email protected] | 7e5dd49f | 2010-12-08 18:33:49 | [diff] [blame] | 297 | #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |