diff --git a/docs/libcurl/symbols-in-versions b/docs/libcurl/symbols-in-versions index 620da64260b10a91b57c03963808c8a893c6f945..5cbeff091f9f9cee2b698b33aa3255ae5fbd6a58 100644 --- a/docs/libcurl/symbols-in-versions +++ b/docs/libcurl/symbols-in-versions @@ -604,6 +604,7 @@ CURLSSH_AUTH_KEYBOARD 7.16.1 CURLSSH_AUTH_NONE 7.16.1 CURLSSH_AUTH_PASSWORD 7.16.1 CURLSSH_AUTH_PUBLICKEY 7.16.1 +CURLSSLBACKEND_AXTLS 7.38.0 CURLSSLBACKEND_CYASSL 7.34.0 CURLSSLBACKEND_DARWINSSL 7.34.0 CURLSSLBACKEND_GNUTLS 7.34.0 diff --git a/include/curl/curl.h b/include/curl/curl.h index ebcd07a0086a80ec84ae5b15aa97d44497df3dde..d40b2dbbf43cb1f625e5a45b489408067e70c9f0 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -2033,7 +2033,8 @@ typedef enum { CURLSSLBACKEND_POLARSSL = 6, CURLSSLBACKEND_CYASSL = 7, CURLSSLBACKEND_SCHANNEL = 8, - CURLSSLBACKEND_DARWINSSL = 9 + CURLSSLBACKEND_DARWINSSL = 9, + CURLSSLBACKEND_AXTLS = 10 } curl_sslbackend; /* Information about the SSL library used and the respective internal SSL diff --git a/lib/getinfo.c b/lib/getinfo.c index bbda35dd058ebf6901130fb1d4918dd0ca5d5c6a..8905d36131d57fca598acb3f081519a72d2eaa08 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -285,6 +285,7 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info, struct curl_tlssessioninfo *tsi = &data->tsi; struct connectdata *conn = data->easy_conn; unsigned int sockindex = 0; + void *internals = NULL; *tsip = tsi; tsi->backend = CURLSSLBACKEND_NONE; @@ -303,25 +304,24 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info, /* Return the TLS session information from the relevant backend */ #ifdef USE_SSLEAY - tsi->backend = CURLSSLBACKEND_OPENSSL; - tsi->internals = conn->ssl[sockindex].ctx; + internals = conn->ssl[sockindex].ctx; #endif #ifdef USE_GNUTLS - tsi->backend = CURLSSLBACKEND_GNUTLS; - tsi->internals = conn->ssl[sockindex].session; + internals = conn->ssl[sockindex].session; #endif #ifdef USE_NSS - tsi->backend = CURLSSLBACKEND_NSS; - tsi->internals = conn->ssl[sockindex].handle; + internals = conn->ssl[sockindex].handle; #endif #ifdef USE_QSOSSL - tsi->backend = CURLSSLBACKEND_QSOSSL; - tsi->internals = conn->ssl[sockindex].handle; + internals = conn->ssl[sockindex].handle; #endif #ifdef USE_GSKIT - tsi->backend = CURLSSLBACKEND_GSKIT; - tsi->internals = conn->ssl[sockindex].handle; + internals = conn->ssl[sockindex].handle; #endif + if(internals) { + tsi->backend = Curl_ssl_backend(); + tsi->internals = internals; + } /* NOTE: For other SSL backends, it is not immediately clear what data to return from 'struct ssl_connect_data'; thus, for now we keep the backend as CURLSSLBACKEND_NONE in those cases, which should be diff --git a/lib/vtls/axtls.h b/lib/vtls/axtls.h index 55247b8ecaa3efe108e38caa54808b3ee048e169..0459cf228aed98718dfddc092b3ec24b5df68902 100644 --- a/lib/vtls/axtls.h +++ b/lib/vtls/axtls.h @@ -66,7 +66,7 @@ int Curl_axtls_random(struct SessionHandle *data, #define curlssl_check_cxn(x) Curl_axtls_check_cxn(x) #define curlssl_data_pending(x,y) (x=x, y=y, 0) #define curlssl_random(x,y,z) Curl_axtls_random(x,y,z) - +#define CURL_SSL_BACKEND CURLSSLBACKEND_AXTLS #endif /* USE_AXTLS */ #endif /* HEADER_CURL_AXTLS_H */ diff --git a/lib/vtls/curl_darwinssl.h b/lib/vtls/curl_darwinssl.h index 25ad3d41978db9b74a39bed945a76ff3b0381cd0..f5c03d8388c4fd1830e8f7e28a9b6ead846a3722 100644 --- a/lib/vtls/curl_darwinssl.h +++ b/lib/vtls/curl_darwinssl.h @@ -71,6 +71,7 @@ void Curl_darwinssl_md5sum(unsigned char *tmp, /* input */ #define curlssl_data_pending(x,y) Curl_darwinssl_data_pending(x, y) #define curlssl_random(x,y,z) Curl_darwinssl_random(y,z) #define curlssl_md5sum(a,b,c,d) Curl_darwinssl_md5sum(a,b,c,d) +#define CURL_SSL_BACKEND CURLSSLBACKEND_DARWINSSL #endif /* USE_DARWINSSL */ #endif /* HEADER_CURL_DARWINSSL_H */ diff --git a/lib/vtls/curl_schannel.h b/lib/vtls/curl_schannel.h index b82c734a0aa2695749332e5b4b82a39baa1d09a9..e9333179eace538f4df82f38dec6a463ce1977f5 100644 --- a/lib/vtls/curl_schannel.h +++ b/lib/vtls/curl_schannel.h @@ -8,7 +8,7 @@ * \___|\___/|_| \_\_____| * * Copyright (C) 2012, Marc Hoersken, , et al. - * Copyright (C) 2012, Daniel Stenberg, , et al. + * Copyright (C) 2012 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -128,5 +128,6 @@ size_t Curl_schannel_version(char *buffer, size_t size); #define curlssl_version Curl_schannel_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending Curl_schannel_data_pending +#define CURL_SSL_BACKEND CURLSSLBACKEND_SCHANNEL #endif /* USE_SCHANNEL */ #endif /* HEADER_CURL_SCHANNEL_H */ diff --git a/lib/vtls/cyassl.h b/lib/vtls/cyassl.h index 78cba2ff8df037f5939f5853700e67541bec90f1..b10b607d7722a56ce9a6a192b7613ddff182a657 100644 --- a/lib/vtls/cyassl.h +++ b/lib/vtls/cyassl.h @@ -63,6 +63,7 @@ int Curl_cyassl_random(struct SessionHandle *data, #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) Curl_cyassl_data_pending(x,y) #define curlssl_random(x,y,z) Curl_cyassl_random(x,y,z) +#define CURL_SSL_BACKEND CURLSSLBACKEND_CYASSL #endif /* USE_CYASSL */ #endif /* HEADER_CURL_CYASSL_H */ diff --git a/lib/vtls/gskit.h b/lib/vtls/gskit.h index 7c50452ad8311710d7cb59716a78164af657c623..a4caa6f23e4987794bf9bc23af7762acef7d19cc 100644 --- a/lib/vtls/gskit.h +++ b/lib/vtls/gskit.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -59,6 +59,7 @@ int Curl_gskit_check_cxn(struct connectdata * cxn); #define curlssl_version Curl_gskit_version #define curlssl_check_cxn(x) Curl_gskit_check_cxn(x) #define curlssl_data_pending(x,y) 0 +#define CURL_SSL_BACKEND CURLSSLBACKEND_GSKIT #endif /* USE_GSKIT */ #endif /* HEADER_CURL_GSKIT_H */ diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h index 9f99042cf7a249e904fff803a4a9bc85b693eb53..cd6152ca1eee24ad9ac786c405ecb2b6223dbd80 100644 --- a/lib/vtls/gtls.h +++ b/lib/vtls/gtls.h @@ -73,6 +73,7 @@ void Curl_gtls_md5sum(unsigned char *tmp, /* input */ #define curlssl_data_pending(x,y) (x=x, y=y, 0) #define curlssl_random(x,y,z) Curl_gtls_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_gtls_md5sum(a,b,c,d) +#define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS #endif /* USE_GNUTLS */ #endif /* HEADER_CURL_GTLS_H */ diff --git a/lib/vtls/nssg.h b/lib/vtls/nssg.h index d441de9d9458db432af976c0f7b5903506666833..311f873d7ab69ae8c56215aa4b8ccf72507006bb 100644 --- a/lib/vtls/nssg.h +++ b/lib/vtls/nssg.h @@ -83,6 +83,7 @@ void Curl_nss_md5sum(unsigned char *tmp, /* input */ #define curlssl_data_pending(x,y) (x=x, y=y, 0) #define curlssl_random(x,y,z) Curl_nss_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_nss_md5sum(a,b,c,d) +#define CURL_SSL_BACKEND CURLSSLBACKEND_NSS #endif /* USE_NSS */ #endif /* HEADER_CURL_NSSG_H */ diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h index fecad7f5495051db09857ed4720c4d3e82eda71f..1a55ffc2f14c30af2bbe90d5b033a1317e0ac02b 100644 --- a/lib/vtls/openssl.h +++ b/lib/vtls/openssl.h @@ -93,6 +93,7 @@ void Curl_ossl_md5sum(unsigned char *tmp, /* input */ #define curlssl_data_pending(x,y) Curl_ossl_data_pending(x,y) #define curlssl_random(x,y,z) Curl_ossl_random(x,y,z) #define curlssl_md5sum(a,b,c,d) Curl_ossl_md5sum(a,b,c,d) +#define CURL_SSL_BACKEND CURLSSLBACKEND_OPENSSL #define DEFAULT_CIPHER_SELECTION "ALL!EXPORT!EXPORT40!EXPORT56!aNULL!LOW!RC4" diff --git a/lib/vtls/polarssl.h b/lib/vtls/polarssl.h index 6c5b872c86ac7a5b5df2c79a5a438916cd5f8527..9ab7e47e5a16d6fb27c6142217802e9704b35ca6 100644 --- a/lib/vtls/polarssl.h +++ b/lib/vtls/polarssl.h @@ -62,6 +62,7 @@ int Curl_polarssl_shutdown(struct connectdata *conn, int sockindex); #define curlssl_version Curl_polarssl_version #define curlssl_check_cxn(x) (x=x, -1) #define curlssl_data_pending(x,y) (x=x, y=y, 0) +#define CURL_SSL_BACKEND CURLSSLBACKEND_POLARSSL /* This might cause libcurl to use a weeker random! TODO: implement proper use of Polarssl's CTR-DRBG or HMAC-DRBG and use that diff --git a/lib/vtls/qssl.h b/lib/vtls/qssl.h index c0ce15508b208dcb143f008304cde253db4491e5..9764eecbe7a284547a553ce10b211f2d1fa73cc0 100644 --- a/lib/vtls/qssl.h +++ b/lib/vtls/qssl.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -56,6 +56,7 @@ int Curl_qsossl_check_cxn(struct connectdata * cxn); #define curlssl_version Curl_qsossl_version #define curlssl_check_cxn(x) Curl_qsossl_check_cxn(x) #define curlssl_data_pending(x,y) 0 +#define CURL_SSL_BACKEND CURLSSLBACKEND_QSOSSL #endif /* USE_QSOSSL */ #endif /* HEADER_CURL_QSSL_H */ diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 3c7bc98655e0732ec24e71ea7fb1ea5c02ac9efc..e418955bd3372fcfd5a3a59d51dd39634e533f54 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -697,4 +697,9 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */ } #endif +int Curl_ssl_backend(void) +{ + return (int)CURL_SSL_BACKEND; +} + #endif /* USE_SSL */ diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index 72c512d507cdbaec8a944ad3dbec3ac9ca251263..e3fa20b7ae62a72767c20b49903cdfdfe4235732 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -96,6 +96,7 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */ size_t tmplen, unsigned char *md5sum, /* output */ size_t md5len); +int Curl_ssl_backend(void); #define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */ @@ -124,6 +125,7 @@ void Curl_ssl_md5sum(unsigned char *tmp, /* input */ #define Curl_ssl_connect_nonblocking(x,y,z) CURLE_NOT_BUILT_IN #define Curl_ssl_kill_session(x) Curl_nop_stmt #define Curl_ssl_random(x,y,z) CURLE_NOT_BUILT_IN +#define CURL_SSL_BACKEND CURLSSLBACKEND_NONE #endif #endif /* HEADER_CURL_VTLS_H */