mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
vtls: fold the backend ID into the Curl_ssl structure
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
a243ce7ab2
commit
a53bda35e9
@ -703,6 +703,7 @@ static void *Curl_axtls_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_axtls = {
|
const struct Curl_ssl Curl_ssl_axtls = {
|
||||||
"axtls", /* name */
|
"axtls", /* name */
|
||||||
|
CURLSSLBACKEND_AXTLS,
|
||||||
|
|
||||||
0, /* have_ca_path */
|
0, /* have_ca_path */
|
||||||
0, /* have_certinfo */
|
0, /* have_certinfo */
|
||||||
|
@ -29,9 +29,6 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_axtls;
|
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 /* USE_AXTLS */
|
||||||
#endif /* HEADER_CURL_AXTLS_H */
|
#endif /* HEADER_CURL_AXTLS_H */
|
||||||
|
|
||||||
|
@ -979,6 +979,7 @@ static void *Curl_cyassl_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_cyassl = {
|
const struct Curl_ssl Curl_ssl_cyassl = {
|
||||||
"cyassl", /* name */
|
"cyassl", /* name */
|
||||||
|
CURLSSLBACKEND_CYASSL,
|
||||||
|
|
||||||
0, /* have_ca_path */
|
0, /* have_ca_path */
|
||||||
0, /* have_certinfo */
|
0, /* have_certinfo */
|
||||||
|
@ -27,8 +27,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_cyassl;
|
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 /* USE_CYASSL */
|
||||||
#endif /* HEADER_CURL_CYASSL_H */
|
#endif /* HEADER_CURL_CYASSL_H */
|
||||||
|
@ -2891,6 +2891,7 @@ static void *Curl_darwinssl_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_darwinssl = {
|
const struct Curl_ssl Curl_ssl_darwinssl = {
|
||||||
"darwinssl", /* name */
|
"darwinssl", /* name */
|
||||||
|
CURLSSLBACKEND_DARWINSSL,
|
||||||
|
|
||||||
0, /* have_ca_path */
|
0, /* have_ca_path */
|
||||||
0, /* have_certinfo */
|
0, /* have_certinfo */
|
||||||
|
@ -28,8 +28,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_darwinssl;
|
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 /* USE_DARWINSSL */
|
||||||
#endif /* HEADER_CURL_DARWINSSL_H */
|
#endif /* HEADER_CURL_DARWINSSL_H */
|
||||||
|
@ -1354,6 +1354,7 @@ static void *Curl_gskit_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_gskit = {
|
const struct Curl_ssl Curl_ssl_gskit = {
|
||||||
"gskit", /* name */
|
"gskit", /* name */
|
||||||
|
CURLSSLBACKEND_GSKIT,
|
||||||
|
|
||||||
0, /* have_ca_path */
|
0, /* have_ca_path */
|
||||||
1, /* have_certinfo */
|
1, /* have_certinfo */
|
||||||
|
@ -33,9 +33,6 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_gskit;
|
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 /* USE_GSKIT */
|
||||||
|
|
||||||
#endif /* HEADER_CURL_GSKIT_H */
|
#endif /* HEADER_CURL_GSKIT_H */
|
||||||
|
@ -1807,6 +1807,7 @@ static void *Curl_gtls_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_gnutls = {
|
const struct Curl_ssl Curl_ssl_gnutls = {
|
||||||
"gnutls", /* name */
|
"gnutls", /* name */
|
||||||
|
CURLSSLBACKEND_GNUTLS,
|
||||||
|
|
||||||
1, /* have_ca_path */
|
1, /* have_ca_path */
|
||||||
1, /* have_certinfo */
|
1, /* have_certinfo */
|
||||||
@ -1829,7 +1830,7 @@ const struct Curl_ssl Curl_ssl_gnutls = {
|
|||||||
Curl_gtls_get_internals, /* get_internals */
|
Curl_gtls_get_internals, /* get_internals */
|
||||||
Curl_gtls_close, /* close */
|
Curl_gtls_close, /* close */
|
||||||
Curl_none_close_all, /* close_all */
|
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, /* set_engine */
|
||||||
Curl_none_set_engine_default, /* set_engine_default */
|
Curl_none_set_engine_default, /* set_engine_default */
|
||||||
Curl_none_engines_list, /* engines_list */
|
Curl_none_engines_list, /* engines_list */
|
||||||
|
@ -30,8 +30,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_gnutls;
|
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 /* USE_GNUTLS */
|
||||||
#endif /* HEADER_CURL_GTLS_H */
|
#endif /* HEADER_CURL_GTLS_H */
|
||||||
|
@ -1040,6 +1040,7 @@ static void *Curl_mbedtls_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_mbedtls = {
|
const struct Curl_ssl Curl_ssl_mbedtls = {
|
||||||
"mbedtls", /* name */
|
"mbedtls", /* name */
|
||||||
|
CURLSSLBACKEND_MBEDTLS,
|
||||||
|
|
||||||
0, /* have_ca_path */
|
0, /* have_ca_path */
|
||||||
0, /* have_certinfo */
|
0, /* have_certinfo */
|
||||||
|
@ -28,7 +28,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_mbedtls;
|
extern const struct Curl_ssl Curl_ssl_mbedtls;
|
||||||
|
|
||||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_MBEDTLS
|
|
||||||
|
|
||||||
#endif /* USE_MBEDTLS */
|
#endif /* USE_MBEDTLS */
|
||||||
#endif /* HEADER_CURL_MBEDTLS_H */
|
#endif /* HEADER_CURL_MBEDTLS_H */
|
||||||
|
@ -2344,6 +2344,7 @@ static void *Curl_nss_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_nss = {
|
const struct Curl_ssl Curl_ssl_nss = {
|
||||||
"nss", /* name */
|
"nss", /* name */
|
||||||
|
CURLSSLBACKEND_NSS,
|
||||||
|
|
||||||
1, /* have_ca_path */
|
1, /* have_ca_path */
|
||||||
1, /* have_certinfo */
|
1, /* have_certinfo */
|
||||||
|
@ -35,8 +35,5 @@ CURLcode Curl_nss_force_init(struct Curl_easy *data);
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_nss;
|
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 /* USE_NSS */
|
||||||
#endif /* HEADER_CURL_NSSG_H */
|
#endif /* HEADER_CURL_NSSG_H */
|
||||||
|
@ -3417,6 +3417,7 @@ static void *Curl_ossl_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_openssl = {
|
const struct Curl_ssl Curl_ssl_openssl = {
|
||||||
"openssl", /* name */
|
"openssl", /* name */
|
||||||
|
CURLSSLBACKEND_OPENSSL,
|
||||||
|
|
||||||
1, /* have_ca_path */
|
1, /* have_ca_path */
|
||||||
1, /* have_certinfo */
|
1, /* have_certinfo */
|
||||||
|
@ -33,8 +33,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_openssl;
|
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 /* USE_OPENSSL */
|
||||||
#endif /* HEADER_CURL_SSLUSE_H */
|
#endif /* HEADER_CURL_SSLUSE_H */
|
||||||
|
@ -902,6 +902,7 @@ static void *Curl_polarssl_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_polarssl = {
|
const struct Curl_ssl Curl_ssl_polarssl = {
|
||||||
"polarssl", /* name */
|
"polarssl", /* name */
|
||||||
|
CURLSSLBACKEND_POLARSSL,
|
||||||
|
|
||||||
1, /* have_ca_path */
|
1, /* have_ca_path */
|
||||||
0, /* have_certinfo */
|
0, /* have_certinfo */
|
||||||
|
@ -28,8 +28,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_polarssl;
|
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 /* USE_POLARSSL */
|
||||||
#endif /* HEADER_CURL_POLARSSL_H */
|
#endif /* HEADER_CURL_POLARSSL_H */
|
||||||
|
@ -1817,6 +1817,7 @@ static void *Curl_schannel_get_internals(struct ssl_connect_data *connssl,
|
|||||||
|
|
||||||
const struct Curl_ssl Curl_ssl_schannel = {
|
const struct Curl_ssl Curl_ssl_schannel = {
|
||||||
"schannel", /* name */
|
"schannel", /* name */
|
||||||
|
CURLSSLBACKEND_SCHANNEL,
|
||||||
|
|
||||||
0, /* have_ca_path */
|
0, /* have_ca_path */
|
||||||
1, /* have_certinfo */
|
1, /* have_certinfo */
|
||||||
|
@ -30,8 +30,5 @@
|
|||||||
|
|
||||||
extern const struct Curl_ssl Curl_ssl_schannel;
|
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 /* USE_SCHANNEL */
|
||||||
#endif /* HEADER_CURL_SCHANNEL_H */
|
#endif /* HEADER_CURL_SCHANNEL_H */
|
||||||
|
@ -132,7 +132,11 @@ void Curl_free_primary_ssl_config(struct ssl_primary_config* sslc)
|
|||||||
|
|
||||||
int Curl_ssl_backend(void)
|
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
|
#ifdef USE_SSL
|
||||||
|
@ -28,6 +28,7 @@ struct ssl_connect_data;
|
|||||||
|
|
||||||
struct Curl_ssl {
|
struct Curl_ssl {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
int id; /* one of the CURLSSLBACKEND_* constants */
|
||||||
|
|
||||||
unsigned have_ca_path:1; /* supports CAPATH */
|
unsigned have_ca_path:1; /* supports CAPATH */
|
||||||
unsigned have_certinfo:1; /* supports CURLOPT_CERTINFO */
|
unsigned have_certinfo:1; /* supports CURLOPT_CERTINFO */
|
||||||
@ -242,8 +243,6 @@ bool Curl_ssl_false_start(void);
|
|||||||
#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
|
#define SSL_SHUTDOWN_TIMEOUT 10000 /* ms */
|
||||||
|
|
||||||
#else
|
#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 */
|
/* When SSL support is not present, just define away these function calls */
|
||||||
#define Curl_ssl_init() 1
|
#define Curl_ssl_init() 1
|
||||||
|
Loading…
Reference in New Issue
Block a user