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_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 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 class SSLContext; | 103 class SSLContext; |
104 friend class SSLClientSocket; | 104 friend class SSLClientSocket; |
105 friend class SSLContext; | 105 friend class SSLContext; |
106 | 106 |
107 int Init(); | 107 int Init(); |
108 void DoReadCallback(int result); | 108 void DoReadCallback(int result); |
109 void DoWriteCallback(int result); | 109 void DoWriteCallback(int result); |
110 | 110 |
111 bool DoTransportIO(); | 111 bool DoTransportIO(); |
112 int DoHandshake(); | 112 int DoHandshake(); |
| 113 int DoChannelIDLookup(); |
| 114 int DoChannelIDLookupComplete(int result); |
113 int DoVerifyCert(int result); | 115 int DoVerifyCert(int result); |
114 int DoVerifyCertComplete(int result); | 116 int DoVerifyCertComplete(int result); |
115 void DoConnectCallback(int result); | 117 void DoConnectCallback(int result); |
116 X509Certificate* UpdateServerCert(); | 118 X509Certificate* UpdateServerCert(); |
117 | 119 |
118 void OnHandshakeIOComplete(int result); | 120 void OnHandshakeIOComplete(int result); |
119 void OnSendComplete(int result); | 121 void OnSendComplete(int result); |
120 void OnRecvComplete(int result); | 122 void OnRecvComplete(int result); |
121 | 123 |
122 int DoHandshakeLoop(int last_io_result); | 124 int DoHandshakeLoop(int last_io_result); |
123 int DoReadLoop(int result); | 125 int DoReadLoop(int result); |
124 int DoWriteLoop(int result); | 126 int DoWriteLoop(int result); |
125 int DoPayloadRead(); | 127 int DoPayloadRead(); |
126 int DoPayloadWrite(); | 128 int DoPayloadWrite(); |
127 | 129 |
128 int BufferSend(); | 130 int BufferSend(); |
129 int BufferRecv(); | 131 int BufferRecv(); |
130 void BufferSendComplete(int result); | 132 void BufferSendComplete(int result); |
131 void BufferRecvComplete(int result); | 133 void BufferRecvComplete(int result); |
132 void TransportWriteComplete(int result); | 134 void TransportWriteComplete(int result); |
133 int TransportReadComplete(int result); | 135 int TransportReadComplete(int result); |
134 | 136 |
135 // Callback from the SSL layer that indicates the remote server is requesting | 137 // Callback from the SSL layer that indicates the remote server is requesting |
136 // a certificate for this client. | 138 // a certificate for this client. |
137 int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey); | 139 int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey); |
138 | 140 |
139 // Callback from the SSL layer that indicates the remote server supports TLS | |
140 // Channel IDs. | |
141 void ChannelIDRequestCallback(SSL* ssl, EVP_PKEY** pkey); | |
142 | |
143 // CertVerifyCallback is called to verify the server's certificates. We do | 141 // CertVerifyCallback is called to verify the server's certificates. We do |
144 // verification after the handshake so this function only enforces that the | 142 // verification after the handshake so this function only enforces that the |
145 // certificates don't change during renegotiation. | 143 // certificates don't change during renegotiation. |
146 int CertVerifyCallback(X509_STORE_CTX *store_ctx); | 144 int CertVerifyCallback(X509_STORE_CTX *store_ctx); |
147 | 145 |
148 // Callback from the SSL layer to check which NPN protocol we are supporting | 146 // Callback from the SSL layer to check which NPN protocol we are supporting |
149 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen, | 147 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen, |
150 const unsigned char* in, unsigned int inlen); | 148 const unsigned char* in, unsigned int inlen); |
151 | 149 |
152 bool transport_send_busy_; | 150 bool transport_send_busy_; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // session cache. i.e. sessions created with one value will not attempt to | 217 // session cache. i.e. sessions created with one value will not attempt to |
220 // resume on the socket with a different value. | 218 // resume on the socket with a different value. |
221 const std::string ssl_session_cache_shard_; | 219 const std::string ssl_session_cache_shard_; |
222 | 220 |
223 // Used for session cache diagnostics. | 221 // Used for session cache diagnostics. |
224 bool trying_cached_session_; | 222 bool trying_cached_session_; |
225 | 223 |
226 enum State { | 224 enum State { |
227 STATE_NONE, | 225 STATE_NONE, |
228 STATE_HANDSHAKE, | 226 STATE_HANDSHAKE, |
| 227 STATE_CHANNEL_ID_LOOKUP, |
| 228 STATE_CHANNEL_ID_LOOKUP_COMPLETE, |
229 STATE_VERIFY_CERT, | 229 STATE_VERIFY_CERT, |
230 STATE_VERIFY_CERT_COMPLETE, | 230 STATE_VERIFY_CERT_COMPLETE, |
231 }; | 231 }; |
232 State next_handshake_state_; | 232 State next_handshake_state_; |
233 NextProtoStatus npn_status_; | 233 NextProtoStatus npn_status_; |
234 std::string npn_proto_; | 234 std::string npn_proto_; |
235 std::string server_protos_; | 235 std::string server_protos_; |
236 // Written by the |server_bound_cert_service_|. | 236 // Written by the |server_bound_cert_service_|. |
237 std::string channel_id_private_key_; | 237 std::string channel_id_private_key_; |
238 std::string channel_id_cert_; | 238 std::string channel_id_cert_; |
239 // The return value of the last call to |server_bound_cert_service_|. | |
240 int channel_id_request_return_value_; | |
241 // True if channel ID extension was negotiated. | 239 // True if channel ID extension was negotiated. |
242 bool channel_id_xtn_negotiated_; | 240 bool channel_id_xtn_negotiated_; |
243 // The request handle for |server_bound_cert_service_|. | 241 // The request handle for |server_bound_cert_service_|. |
244 ServerBoundCertService::RequestHandle channel_id_request_handle_; | 242 ServerBoundCertService::RequestHandle channel_id_request_handle_; |
245 BoundNetLog net_log_; | 243 BoundNetLog net_log_; |
246 }; | 244 }; |
247 | 245 |
248 } // namespace net | 246 } // namespace net |
249 | 247 |
250 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 248 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
OLD | NEW |