diff options
Diffstat (limited to 'lib/vtls')
-rw-r--r-- | lib/vtls/curl_schannel.c | 3 | ||||
-rw-r--r-- | lib/vtls/cyassl.c | 3 | ||||
-rw-r--r-- | lib/vtls/gtls.c | 2 | ||||
-rw-r--r-- | lib/vtls/openssl.c | 4 | ||||
-rw-r--r-- | lib/vtls/polarssl.c | 3 | ||||
-rw-r--r-- | lib/vtls/vtls.c | 6 | ||||
-rw-r--r-- | lib/vtls/vtls.h | 22 |
7 files changed, 23 insertions, 20 deletions
diff --git a/lib/vtls/curl_schannel.c b/lib/vtls/curl_schannel.c index d1f41a797..b3fe52695 100644 --- a/lib/vtls/curl_schannel.c +++ b/lib/vtls/curl_schannel.c @@ -509,7 +509,7 @@ schannel_connect_step3(struct connectdata *conn, int sockindex) struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; struct curl_schannel_cred *old_cred = NULL; - int incache; + bool incache; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); @@ -550,6 +550,7 @@ schannel_connect_step3(struct connectdata *conn, int sockindex) incache = FALSE; } } + if(!incache) { result = Curl_ssl_addsessionid(conn, (void *)connssl->cred, sizeof(struct curl_schannel_cred)); diff --git a/lib/vtls/cyassl.c b/lib/vtls/cyassl.c index 3746064fe..3333fc3a0 100644 --- a/lib/vtls/cyassl.c +++ b/lib/vtls/cyassl.c @@ -332,7 +332,7 @@ cyassl_connect_step3(struct connectdata *conn, void *old_ssl_sessionid=NULL; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - int incache; + bool incache; SSL_SESSION *our_ssl_sessionid; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); @@ -347,6 +347,7 @@ cyassl_connect_step3(struct connectdata *conn, incache = FALSE; } } + if(!incache) { result = Curl_ssl_addsessionid(conn, our_ssl_sessionid, 0 /* unknown size */); diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index c8d701f82..5d4e48a25 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -754,7 +754,7 @@ gtls_connect_step3(struct connectdata *conn, struct SessionHandle *data = conn->data; gnutls_session_t session = conn->ssl[sockindex].session; int rc; - int incache; + bool incache; void *ssl_sessionid; #ifdef HAS_ALPN gnutls_datum_t proto; diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 51cf2c479..f0127a27e 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2610,7 +2610,7 @@ static CURLcode ossl_connect_step3(struct connectdata *conn, int sockindex) void *old_ssl_sessionid = NULL; struct SessionHandle *data = conn->data; struct ssl_connect_data *connssl = &conn->ssl[sockindex]; - int incache; + bool incache; SSL_SESSION *our_ssl_sessionid; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); @@ -2646,7 +2646,7 @@ static CURLcode ossl_connect_step3(struct connectdata *conn, int sockindex) if(!incache) { result = Curl_ssl_addsessionid(conn, our_ssl_sessionid, - 0 /* unknown size */); + 0 /* unknown size */); if(result) { failf(data, "failed to store ssl session"); return result; diff --git a/lib/vtls/polarssl.c b/lib/vtls/polarssl.c index 822617846..7780b5ac6 100644 --- a/lib/vtls/polarssl.c +++ b/lib/vtls/polarssl.c @@ -488,7 +488,7 @@ polarssl_connect_step3(struct connectdata *conn, struct SessionHandle *data = conn->data; void *old_ssl_sessionid = NULL; ssl_session *our_ssl_sessionid = &conn->ssl[sockindex].ssn ; - int incache; + bool incache; DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); @@ -501,6 +501,7 @@ polarssl_connect_step3(struct connectdata *conn, incache = FALSE; } } + if(!incache) { void *new_session = malloc(sizeof(ssl_session)); diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 960f76c17..905ddd3e9 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -316,9 +316,9 @@ Curl_ssl_connect_nonblocking(struct connectdata *conn, int sockindex, * Check if there's a session ID for the given connection in the cache, and if * there's one suitable, it is provided. Returns TRUE when no entry matched. */ -int Curl_ssl_getsessionid(struct connectdata *conn, - void **ssl_sessionid, - size_t *idsize) /* set 0 if unknown */ +bool Curl_ssl_getsessionid(struct connectdata *conn, + void **ssl_sessionid, + size_t *idsize) /* set 0 if unknown */ { struct curl_ssl_session *check; struct SessionHandle *data = conn->data; diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index d24a858f6..8091868c8 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -23,14 +23,14 @@ ***************************************************************************/ #include "curl_setup.h" -#include "openssl.h" /* OpenSSL versions */ -#include "gtls.h" /* GnuTLS versions */ -#include "nssg.h" /* NSS versions */ -#include "gskit.h" /* Global Secure ToolKit versions */ -#include "polarssl.h" /* PolarSSL versions */ -#include "axtls.h" /* axTLS versions */ -#include "cyassl.h" /* CyaSSL versions */ -#include "curl_schannel.h" /* Schannel SSPI version */ +#include "openssl.h" /* OpenSSL versions */ +#include "gtls.h" /* GnuTLS versions */ +#include "nssg.h" /* NSS versions */ +#include "gskit.h" /* Global Secure ToolKit versions */ +#include "polarssl.h" /* PolarSSL versions */ +#include "axtls.h" /* axTLS versions */ +#include "cyassl.h" /* CyaSSL versions */ +#include "curl_schannel.h" /* Schannel SSPI version */ #include "curl_darwinssl.h" /* SecureTransport (Darwin) version */ #ifndef MAX_PINNED_PUBKEY_SIZE @@ -92,9 +92,9 @@ CURLcode Curl_ssl_push_certinfo(struct SessionHandle * data, int certnum, /* Functions to be used by SSL library adaptation functions */ /* extract a session ID */ -int Curl_ssl_getsessionid(struct connectdata *conn, - void **ssl_sessionid, - size_t *idsize) /* set 0 if unknown */; +bool Curl_ssl_getsessionid(struct connectdata *conn, + void **ssl_sessionid, + size_t *idsize) /* set 0 if unknown */; /* add a new session ID */ CURLcode Curl_ssl_addsessionid(struct connectdata *conn, void *ssl_sessionid, |