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

Unified Diff: net/socket/ssl_client_socket_openssl.h

Issue 280853002: Preserve transport errors for OpenSSL sockets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: USE_NSS -> USE_OPENSSL for Windows and Mac Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: net/socket/ssl_client_socket_openssl.h
diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h
index 5d70c0523fabe0230b2361f7418688f1215fe0df..fbda9f58e879b8f909e15f9166516fc178c1d1fc 100644
--- a/net/socket/ssl_client_socket_openssl.h
+++ b/net/socket/ssl_client_socket_openssl.h
@@ -31,6 +31,10 @@ typedef struct x509_st X509;
// <openssl/ossl_type.h>
typedef struct x509_store_ctx_st X509_STORE_CTX;
+namespace crypto {
+class OpenSSLErrStackTracer;
+}
+
namespace net {
class CertVerifier;
@@ -120,8 +124,8 @@ class SSLClientSocketOpenSSL : public SSLClientSocket {
void OnRecvComplete(int result);
int DoHandshakeLoop(int last_io_result);
- int DoReadLoop(int result);
- int DoWriteLoop(int result);
+ int DoReadLoop();
+ int DoWriteLoop();
int DoPayloadRead();
int DoPayloadWrite();
@@ -132,6 +136,9 @@ class SSLClientSocketOpenSSL : public SSLClientSocket {
void TransportWriteComplete(int result);
int TransportReadComplete(int result);
+ int HandleOpenSSLError(int ssl_error,
+ const crypto::OpenSSLErrStackTracer& tracer);
+
// Callback from the SSL layer that indicates the remote server is requesting
// a certificate for this client.
int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey);
@@ -149,9 +156,20 @@ class SSLClientSocketOpenSSL : public SSLClientSocket {
int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen,
const unsigned char* in, unsigned int inlen);
+ // Callback from the SSL layer when an operation is performed on
+ // |transport_bio_|.
+ long BIOCallback(BIO *bio,
+ int cmd,
+ const char *argp, int argi, long argl,
+ long retvalue);
+
+ static long BIOCallbackThunk(BIO *bio,
+ int cmd,
+ const char *argp, int argi, long argl,
+ long retvalue);
+
bool transport_send_busy_;
bool transport_recv_busy_;
- bool transport_recv_eof_;
scoped_refptr<DrainableIOBuffer> send_buffer_;
scoped_refptr<IOBuffer> recv_buffer_;
@@ -178,8 +196,14 @@ class SSLClientSocketOpenSSL : public SSLClientSocket {
// indicates an error.
int pending_read_error_;
- // Used by TransportWriteComplete() and TransportReadComplete() to signify an
- // error writing to the transport socket. A value of OK indicates no error.
+ // Used by TransportReadComplete() to signify an error or EOF reading from the
+ // transport socket. A value of ERR_IO_PENDING indicates the transport is
+ // still readable.
+ int transport_read_error_;
+
+ // Used by TransportWriteComplete() to signify an error writing to the
+ // transport socket. A value of ERR_IO_PENDING indicates the transport is
+ // still writeable.
int transport_write_error_;
// Set when handshake finishes.

Powered by Google App Engine
This is Rietveld 408576698