vtls: fold the backend ID into the Curl_ssl structure

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2017-06-24 00:25:29 +02:00 committed by Daniel Stenberg
parent a243ce7ab2
commit a53bda35e9
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
22 changed files with 17 additions and 33 deletions

View File

@ -703,6 +703,7 @@ static void *Curl_axtls_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_axtls = {
"axtls", /* name */
CURLSSLBACKEND_AXTLS,
0, /* have_ca_path */
0, /* have_certinfo */

View File

@ -29,9 +29,6 @@
extern const struct Curl_ssl Curl_ssl_axtls;
/* Set the API backend definition to axTLS */
#define CURL_SSL_BACKEND CURLSSLBACKEND_AXTLS
#endif /* USE_AXTLS */
#endif /* HEADER_CURL_AXTLS_H */

View File

@ -979,6 +979,7 @@ static void *Curl_cyassl_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_cyassl = {
"cyassl", /* name */
CURLSSLBACKEND_CYASSL,
0, /* have_ca_path */
0, /* have_certinfo */

View File

@ -27,8 +27,5 @@
extern const struct Curl_ssl Curl_ssl_cyassl;
/* Set the API backend definition to CyaSSL */
#define CURL_SSL_BACKEND CURLSSLBACKEND_CYASSL
#endif /* USE_CYASSL */
#endif /* HEADER_CURL_CYASSL_H */

View File

@ -2891,6 +2891,7 @@ static void *Curl_darwinssl_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_darwinssl = {
"darwinssl", /* name */
CURLSSLBACKEND_DARWINSSL,
0, /* have_ca_path */
0, /* have_certinfo */

View File

@ -28,8 +28,5 @@
extern const struct Curl_ssl Curl_ssl_darwinssl;
/* Set the API backend definition to SecureTransport */
#define CURL_SSL_BACKEND CURLSSLBACKEND_DARWINSSL
#endif /* USE_DARWINSSL */
#endif /* HEADER_CURL_DARWINSSL_H */

View File

@ -1354,6 +1354,7 @@ static void *Curl_gskit_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_gskit = {
"gskit", /* name */
CURLSSLBACKEND_GSKIT,
0, /* have_ca_path */
1, /* have_certinfo */

View File

@ -33,9 +33,6 @@
extern const struct Curl_ssl Curl_ssl_gskit;
/* Set the API backend definition to GSKit */
#define CURL_SSL_BACKEND CURLSSLBACKEND_GSKIT
#endif /* USE_GSKIT */
#endif /* HEADER_CURL_GSKIT_H */

View File

@ -1807,6 +1807,7 @@ static void *Curl_gtls_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_gnutls = {
"gnutls", /* name */
CURLSSLBACKEND_GNUTLS,
1, /* have_ca_path */
1, /* have_certinfo */
@ -1829,7 +1830,7 @@ const struct Curl_ssl Curl_ssl_gnutls = {
Curl_gtls_get_internals, /* get_internals */
Curl_gtls_close, /* close */
Curl_none_close_all, /* close_all */
Curl_glts_session_free, /* session_free */
Curl_gtls_session_free, /* session_free */
Curl_none_set_engine, /* set_engine */
Curl_none_set_engine_default, /* set_engine_default */
Curl_none_engines_list, /* engines_list */

View File

@ -30,8 +30,5 @@
extern const struct Curl_ssl Curl_ssl_gnutls;
/* Set the API backend definition to GnuTLS */
#define CURL_SSL_BACKEND CURLSSLBACKEND_GNUTLS
#endif /* USE_GNUTLS */
#endif /* HEADER_CURL_GTLS_H */

View File

@ -1040,6 +1040,7 @@ static void *Curl_mbedtls_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_mbedtls = {
"mbedtls", /* name */
CURLSSLBACKEND_MBEDTLS,
0, /* have_ca_path */
0, /* have_certinfo */

View File

@ -28,7 +28,5 @@
extern const struct Curl_ssl Curl_ssl_mbedtls;
#define CURL_SSL_BACKEND CURLSSLBACKEND_MBEDTLS
#endif /* USE_MBEDTLS */
#endif /* HEADER_CURL_MBEDTLS_H */

View File

@ -2344,6 +2344,7 @@ static void *Curl_nss_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_nss = {
"nss", /* name */
CURLSSLBACKEND_NSS,
1, /* have_ca_path */
1, /* have_certinfo */

View File

@ -35,8 +35,5 @@ CURLcode Curl_nss_force_init(struct Curl_easy *data);
extern const struct Curl_ssl Curl_ssl_nss;
/* Set the API backend definition to NSS */
#define CURL_SSL_BACKEND CURLSSLBACKEND_NSS
#endif /* USE_NSS */
#endif /* HEADER_CURL_NSSG_H */

View File

@ -3417,6 +3417,7 @@ static void *Curl_ossl_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_openssl = {
"openssl", /* name */
CURLSSLBACKEND_OPENSSL,
1, /* have_ca_path */
1, /* have_certinfo */

View File

@ -33,8 +33,5 @@
extern const struct Curl_ssl Curl_ssl_openssl;
/* Set the API backend definition to OpenSSL */
#define CURL_SSL_BACKEND CURLSSLBACKEND_OPENSSL
#endif /* USE_OPENSSL */
#endif /* HEADER_CURL_SSLUSE_H */

View File

@ -902,6 +902,7 @@ static void *Curl_polarssl_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_polarssl = {
"polarssl", /* name */
CURLSSLBACKEND_POLARSSL,
1, /* have_ca_path */
0, /* have_certinfo */

View File

@ -28,8 +28,5 @@
extern const struct Curl_ssl Curl_ssl_polarssl;
/* Set the API backend definition to PolarSSL */
#define CURL_SSL_BACKEND CURLSSLBACKEND_POLARSSL
#endif /* USE_POLARSSL */
#endif /* HEADER_CURL_POLARSSL_H */

View File

@ -1817,6 +1817,7 @@ static void *Curl_schannel_get_internals(struct ssl_connect_data *connssl,
const struct Curl_ssl Curl_ssl_schannel = {
"schannel", /* name */
CURLSSLBACKEND_SCHANNEL,
0, /* have_ca_path */
1, /* have_certinfo */

View File

@ -30,8 +30,5 @@
extern const struct Curl_ssl Curl_ssl_schannel;
/* Set the API backend definition to Schannel */
#define CURL_SSL_BACKEND CURLSSLBACKEND_SCHANNEL
#endif /* USE_SCHANNEL */
#endif /* HEADER_CURL_SCHANNEL_H */

View File

@ -132,7 +132,11 @@ void Curl_free_primary_ssl_config(struct ssl_primary_config* sslc)
int Curl_ssl_backend(void)
{
return (int)CURL_SSL_BACKEND;
#ifdef USE_SSL
return Curl_ssl->id;
#else
return (int)CURLSSLBACKEND_NONE;
#endif
}
#ifdef USE_SSL

View File

@ -28,6 +28,7 @@ struct ssl_connect_data;
struct Curl_ssl {
const char *name;
int id; /* one of the CURLSSLBACKEND_* constants */
unsigned have_ca_path:1; /* supports CAPATH */
unsigned have_certinfo:1; /* supports CURLOPT_CERTINFO */
@ -242,8 +243,6 @@ bool Curl_ssl_false_start(void);
#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
#else
/* Set the API backend definition to none */
#define CURL_SSL_BACKEND CURLSSLBACKEND_NONE
/* When SSL support is not present, just define away these function calls */
#define Curl_ssl_init() 1