Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: net/socket/ssl_client_socket_openssl.h

Issue 367963007: Preserve transport errors for OpenSSL sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // CertVerifyCallback is called to verify the server's certificates. We do 141 // CertVerifyCallback is called to verify the server's certificates. We do
142 // verification after the handshake so this function only enforces that the 142 // verification after the handshake so this function only enforces that the
143 // certificates don't change during renegotiation. 143 // certificates don't change during renegotiation.
144 int CertVerifyCallback(X509_STORE_CTX *store_ctx); 144 int CertVerifyCallback(X509_STORE_CTX *store_ctx);
145 145
146 // 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
147 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen, 147 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen,
148 const unsigned char* in, unsigned int inlen); 148 const unsigned char* in, unsigned int inlen);
149 149
150 // Callback from the SSL layer when an operation is performed on
151 // |transport_bio_|'s peer.
152 long BIOCallback(BIO *bio,
153 int cmd,
154 const char *argp, int argi, long argl,
155 long retvalue);
156
157 static long BIOCallbackThunk(BIO *bio,
158 int cmd,
159 const char *argp, int argi, long argl,
160 long retvalue);
Ryan Sleevi 2014/07/07 22:36:34 1) Document 2) Naming - In nss.cc, we use static+"
davidben 2014/07/08 00:03:35 OpenSSL thus far uses the same name for both, but
161
150 bool transport_send_busy_; 162 bool transport_send_busy_;
151 bool transport_recv_busy_; 163 bool transport_recv_busy_;
152 bool transport_recv_eof_;
153 164
154 scoped_refptr<DrainableIOBuffer> send_buffer_; 165 scoped_refptr<DrainableIOBuffer> send_buffer_;
155 scoped_refptr<IOBuffer> recv_buffer_; 166 scoped_refptr<IOBuffer> recv_buffer_;
156 167
157 CompletionCallback user_connect_callback_; 168 CompletionCallback user_connect_callback_;
158 CompletionCallback user_read_callback_; 169 CompletionCallback user_read_callback_;
159 CompletionCallback user_write_callback_; 170 CompletionCallback user_write_callback_;
160 171
161 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; 172 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_;
162 173
163 // Used by Read function. 174 // Used by Read function.
164 scoped_refptr<IOBuffer> user_read_buf_; 175 scoped_refptr<IOBuffer> user_read_buf_;
165 int user_read_buf_len_; 176 int user_read_buf_len_;
166 177
167 // Used by Write function. 178 // Used by Write function.
168 scoped_refptr<IOBuffer> user_write_buf_; 179 scoped_refptr<IOBuffer> user_write_buf_;
169 int user_write_buf_len_; 180 int user_write_buf_len_;
170 181
171 // Used by DoPayloadRead() when attempting to fill the caller's buffer with 182 // Used by DoPayloadRead() when attempting to fill the caller's buffer with
172 // as much data as possible without blocking. 183 // as much data as possible without blocking.
173 // If DoPayloadRead() encounters an error after having read some data, stores 184 // If DoPayloadRead() encounters an error after having read some data, stores
174 // the result to return on the *next* call to DoPayloadRead(). A value > 0 185 // the result to return on the *next* call to DoPayloadRead(). A value > 0
175 // indicates there is no pending result, otherwise 0 indicates EOF and < 0 186 // indicates there is no pending result, otherwise 0 indicates EOF and < 0
176 // indicates an error. 187 // indicates an error.
177 int pending_read_error_; 188 int pending_read_error_;
178 189
190 // Used by TransportReadComplete() to signify an error reading from the
191 // transport socket. A value of OK indicates the socket is still
192 // readable. EOFs are mapped to ERR_CONNECTION_CLOSED.
193 int transport_read_error_;
194
179 // Used by TransportWriteComplete() and TransportReadComplete() to signify an 195 // Used by TransportWriteComplete() and TransportReadComplete() to signify an
180 // error writing to the transport socket. A value of OK indicates no error. 196 // error writing to the transport socket. A value of OK indicates no error.
181 int transport_write_error_; 197 int transport_write_error_;
182 198
183 // Set when handshake finishes. 199 // Set when handshake finishes.
184 scoped_ptr<PeerCertificateChain> server_cert_chain_; 200 scoped_ptr<PeerCertificateChain> server_cert_chain_;
185 scoped_refptr<X509Certificate> server_cert_; 201 scoped_refptr<X509Certificate> server_cert_;
186 CertVerifyResult server_cert_verify_result_; 202 CertVerifyResult server_cert_verify_result_;
187 bool completed_handshake_; 203 bool completed_handshake_;
188 204
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // True if channel ID extension was negotiated. 255 // True if channel ID extension was negotiated.
240 bool channel_id_xtn_negotiated_; 256 bool channel_id_xtn_negotiated_;
241 // The request handle for |server_bound_cert_service_|. 257 // The request handle for |server_bound_cert_service_|.
242 ServerBoundCertService::RequestHandle channel_id_request_handle_; 258 ServerBoundCertService::RequestHandle channel_id_request_handle_;
243 BoundNetLog net_log_; 259 BoundNetLog net_log_;
244 }; 260 };
245 261
246 } // namespace net 262 } // namespace net
247 263
248 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ 264 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_
OLDNEW
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_openssl.cc » ('j') | net/socket/ssl_client_socket_openssl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698