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" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
15 #include "net/cert/cert_verify_result.h" | 15 #include "net/cert/cert_verify_result.h" |
16 #include "net/cert/ct_verify_result.h" | 16 #include "net/cert/ct_verify_result.h" |
17 #include "net/socket/client_socket_handle.h" | 17 #include "net/socket/client_socket_handle.h" |
18 #include "net/socket/ssl_client_socket.h" | 18 #include "net/socket/ssl_client_socket.h" |
19 #include "net/ssl/channel_id_service.h" | 19 #include "net/ssl/channel_id_service.h" |
| 20 #include "net/ssl/openssl_ssl_util.h" |
20 #include "net/ssl/ssl_client_cert_type.h" | 21 #include "net/ssl/ssl_client_cert_type.h" |
21 #include "net/ssl/ssl_config_service.h" | 22 #include "net/ssl/ssl_config_service.h" |
22 | 23 |
23 // Avoid including misc OpenSSL headers, i.e.: | 24 // Avoid including misc OpenSSL headers, i.e.: |
24 // <openssl/bio.h> | 25 // <openssl/bio.h> |
25 typedef struct bio_st BIO; | 26 typedef struct bio_st BIO; |
26 // <openssl/evp.h> | 27 // <openssl/evp.h> |
27 typedef struct evp_pkey_st EVP_PKEY; | 28 typedef struct evp_pkey_st EVP_PKEY; |
28 // <openssl/ssl.h> | 29 // <openssl/ssl.h> |
29 typedef struct ssl_st SSL; | 30 typedef struct ssl_st SSL; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 int user_write_buf_len_; | 203 int user_write_buf_len_; |
203 | 204 |
204 // Used by DoPayloadRead() when attempting to fill the caller's buffer with | 205 // Used by DoPayloadRead() when attempting to fill the caller's buffer with |
205 // as much data as possible without blocking. | 206 // as much data as possible without blocking. |
206 // If DoPayloadRead() encounters an error after having read some data, stores | 207 // If DoPayloadRead() encounters an error after having read some data, stores |
207 // the result to return on the *next* call to DoPayloadRead(). A value > 0 | 208 // the result to return on the *next* call to DoPayloadRead(). A value > 0 |
208 // indicates there is no pending result, otherwise 0 indicates EOF and < 0 | 209 // indicates there is no pending result, otherwise 0 indicates EOF and < 0 |
209 // indicates an error. | 210 // indicates an error. |
210 int pending_read_error_; | 211 int pending_read_error_; |
211 | 212 |
| 213 // If there is a pending read result, the OpenSSL result code (output of |
| 214 // SSL_get_error) associated with it. |
| 215 int pending_read_ssl_error_; |
| 216 |
| 217 // If there is a pending read result, the OpenSSLErrorInfo associated with it. |
| 218 OpenSSLErrorInfo pending_read_error_info_; |
| 219 |
212 // Used by TransportReadComplete() to signify an error reading from the | 220 // Used by TransportReadComplete() to signify an error reading from the |
213 // transport socket. A value of OK indicates the socket is still | 221 // transport socket. A value of OK indicates the socket is still |
214 // readable. EOFs are mapped to ERR_CONNECTION_CLOSED. | 222 // readable. EOFs are mapped to ERR_CONNECTION_CLOSED. |
215 int transport_read_error_; | 223 int transport_read_error_; |
216 | 224 |
217 // Used by TransportWriteComplete() and TransportReadComplete() to signify an | 225 // Used by TransportWriteComplete() and TransportReadComplete() to signify an |
218 // error writing to the transport socket. A value of OK indicates no error. | 226 // error writing to the transport socket. A value of OK indicates no error. |
219 int transport_write_error_; | 227 int transport_write_error_; |
220 | 228 |
221 // Set when Connect finishes. | 229 // Set when Connect finishes. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // pinning failure. It is a (somewhat) human-readable string. | 309 // pinning failure. It is a (somewhat) human-readable string. |
302 std::string pinning_failure_log_; | 310 std::string pinning_failure_log_; |
303 | 311 |
304 BoundNetLog net_log_; | 312 BoundNetLog net_log_; |
305 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; | 313 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; |
306 }; | 314 }; |
307 | 315 |
308 } // namespace net | 316 } // namespace net |
309 | 317 |
310 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 318 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
OLD | NEW |