mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
vtls: use the Curl_ssl struct to access all SSL backends' functionality
This is the first step to unify the SSL backend handling. Now all the SSL backend-specific functionality is accessed via a global instance of the Curl_ssl struct. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
e09bb63ed8
commit
52e8237bfc
@ -724,4 +724,6 @@ const struct Curl_ssl Curl_ssl_axtls = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_axtls;
|
||||
|
||||
#endif /* USE_AXTLS */
|
||||
|
@ -51,23 +51,6 @@ extern const struct Curl_ssl Curl_ssl_axtls;
|
||||
/* Set the API backend definition to axTLS */
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_AXTLS
|
||||
|
||||
/* API setup for axTLS */
|
||||
#define curlssl_init Curl_axtls_init
|
||||
#define curlssl_cleanup Curl_axtls_cleanup
|
||||
#define curlssl_connect Curl_axtls_connect
|
||||
#define curlssl_connect_nonblocking Curl_axtls_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_axtls_session_free(x)
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_axtls_close
|
||||
#define curlssl_shutdown(x,y) Curl_axtls_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_axtls_version
|
||||
#define curlssl_check_cxn(x) Curl_axtls_check_cxn(x)
|
||||
#define curlssl_data_pending(x,y) ((void)x, (void)y, 0)
|
||||
#define curlssl_random(x,y,z) Curl_axtls_random(x,y,z)
|
||||
|
||||
#endif /* USE_AXTLS */
|
||||
#endif /* HEADER_CURL_AXTLS_H */
|
||||
|
||||
|
@ -973,4 +973,6 @@ const struct Curl_ssl Curl_ssl_cyassl = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_cyassl;
|
||||
|
||||
#endif
|
||||
|
@ -72,22 +72,6 @@ extern const struct Curl_ssl Curl_ssl_cyassl;
|
||||
#define have_curlssl_pinnedpubkey 1
|
||||
#endif
|
||||
|
||||
/* API setup for CyaSSL */
|
||||
#define curlssl_init Curl_cyassl_init
|
||||
#define curlssl_cleanup() Curl_nop_stmt
|
||||
#define curlssl_connect Curl_cyassl_connect
|
||||
#define curlssl_connect_nonblocking Curl_cyassl_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_cyassl_session_free(x)
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_cyassl_close
|
||||
#define curlssl_shutdown(x,y) Curl_cyassl_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_cyassl_version
|
||||
#define curlssl_check_cxn(x) ((void)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 curlssl_sha256sum(a,b,c,d) Curl_cyassl_sha256sum(a,b,c,d)
|
||||
|
||||
#endif /* USE_CYASSL */
|
||||
|
@ -2878,6 +2878,8 @@ const struct Curl_ssl Curl_ssl_darwinssl = {
|
||||
Curl_darwinssl_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_darwinssl;
|
||||
|
||||
#ifdef __clang__
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
@ -78,25 +78,8 @@ extern const struct Curl_ssl Curl_ssl_darwinssl;
|
||||
#define have_curlssl_pinnedpubkey 1
|
||||
#endif /* DARWIN_SSL_PINNEDPUBKEY */
|
||||
|
||||
/* API setup for SecureTransport */
|
||||
#define curlssl_init() (1)
|
||||
#define curlssl_cleanup() Curl_nop_stmt
|
||||
#define curlssl_connect Curl_darwinssl_connect
|
||||
#define curlssl_connect_nonblocking Curl_darwinssl_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_darwinssl_session_free(x)
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_darwinssl_close
|
||||
#define curlssl_shutdown(x,y) 0
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_darwinssl_version
|
||||
#define curlssl_check_cxn Curl_darwinssl_check_cxn
|
||||
#define curlssl_data_pending(x,y) Curl_darwinssl_data_pending(x, y)
|
||||
#define curlssl_random(x,y,z) Curl_darwinssl_random(x, y,z)
|
||||
#define curlssl_md5sum(a,b,c,d) Curl_darwinssl_md5sum(a,b,c,d)
|
||||
#define curlssl_sha256sum(a,b,c,d) Curl_darwinssl_sha256sum(a, b, c, d)
|
||||
#define curlssl_false_start() Curl_darwinssl_false_start()
|
||||
|
||||
#endif /* USE_DARWINSSL */
|
||||
#endif /* HEADER_CURL_DARWINSSL_H */
|
||||
|
@ -1357,4 +1357,6 @@ const struct Curl_ssl Curl_ssl_gskit = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_gskit;
|
||||
|
||||
#endif /* USE_GSKIT */
|
||||
|
@ -52,25 +52,6 @@ extern const struct Curl_ssl Curl_ssl_gskit;
|
||||
/* this backend supports CURLOPT_CERTINFO */
|
||||
#define have_curlssl_certinfo 1
|
||||
|
||||
/* API setup for GSKit */
|
||||
#define curlssl_init Curl_gskit_init
|
||||
#define curlssl_cleanup Curl_gskit_cleanup
|
||||
#define curlssl_connect Curl_gskit_connect
|
||||
#define curlssl_connect_nonblocking Curl_gskit_connect_nonblocking
|
||||
|
||||
/* No session handling for GSKit */
|
||||
#define curlssl_session_free(x) Curl_nop_stmt
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_gskit_close
|
||||
#define curlssl_shutdown(x,y) Curl_gskit_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) CURLE_NOT_BUILT_IN
|
||||
#define curlssl_set_engine_default(x) CURLE_NOT_BUILT_IN
|
||||
#define curlssl_engines_list(x) NULL
|
||||
#define curlssl_version Curl_gskit_version
|
||||
#define curlssl_check_cxn(x) Curl_gskit_check_cxn(x)
|
||||
#define curlssl_data_pending(x,y) 0
|
||||
#define curlssl_random(x,y,z) (x=x, y=y, z=z, CURLE_NOT_BUILT_IN)
|
||||
|
||||
#endif /* USE_GSKIT */
|
||||
|
||||
#endif /* HEADER_CURL_GSKIT_H */
|
||||
|
@ -1807,4 +1807,5 @@ const struct Curl_ssl Curl_ssl_gnutls = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_gnutls;
|
||||
#endif /* USE_GNUTLS */
|
||||
|
@ -74,25 +74,8 @@ extern const struct Curl_ssl Curl_ssl_gnutls;
|
||||
/* this backend supports CURLOPT_PINNEDPUBLICKEY */
|
||||
#define have_curlssl_pinnedpubkey 1
|
||||
|
||||
/* API setup for GnuTLS */
|
||||
#define curlssl_init Curl_gtls_init
|
||||
#define curlssl_cleanup Curl_gtls_cleanup
|
||||
#define curlssl_connect Curl_gtls_connect
|
||||
#define curlssl_connect_nonblocking Curl_gtls_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_gtls_session_free(x)
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_gtls_close
|
||||
#define curlssl_shutdown(x,y) Curl_gtls_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_gtls_version
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending(x,y) Curl_gtls_data_pending(x,y)
|
||||
#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 curlssl_sha256sum(a,b,c,d) Curl_gtls_sha256sum(a,b,c,d)
|
||||
#define curlssl_cert_status_request() Curl_gtls_cert_status_request()
|
||||
|
||||
#endif /* USE_GNUTLS */
|
||||
#endif /* HEADER_CURL_GTLS_H */
|
||||
|
@ -1029,4 +1029,6 @@ const struct Curl_ssl Curl_ssl_mbedtls = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_mbedtls;
|
||||
|
||||
#endif /* USE_MBEDTLS */
|
||||
|
@ -61,24 +61,8 @@ CURLcode Curl_mbedtls_random(struct Curl_easy *data, unsigned char *entropy,
|
||||
|
||||
extern const struct Curl_ssl Curl_ssl_mbedtls;
|
||||
|
||||
/* API setup for mbedTLS */
|
||||
#define curlssl_init() Curl_mbedtls_init()
|
||||
#define curlssl_cleanup() Curl_mbedtls_cleanup()
|
||||
#define curlssl_connect Curl_mbedtls_connect
|
||||
#define curlssl_connect_nonblocking Curl_mbedtls_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_mbedtls_session_free(x)
|
||||
#define curlssl_close_all Curl_mbedtls_close_all
|
||||
#define curlssl_close Curl_mbedtls_close
|
||||
#define curlssl_shutdown(x,y) 0
|
||||
#define curlssl_set_engine(x,y) (x=x, y=y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) (x=x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) (x=x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_mbedtls_version
|
||||
#define curlssl_check_cxn(x) (x=x, -1)
|
||||
#define curlssl_data_pending(x,y) Curl_mbedtls_data_pending(x, y)
|
||||
#define CURL_SSL_BACKEND CURLSSLBACKEND_MBEDTLS
|
||||
#define curlssl_sha256sum(a,b,c,d) mbedtls_sha256(a,b,c,0)
|
||||
#define curlssl_random(x,y,z) Curl_mbedtls_random(x, y, z)
|
||||
|
||||
#endif /* USE_MBEDTLS */
|
||||
#endif /* HEADER_CURL_MBEDTLS_H */
|
||||
|
@ -2346,4 +2346,5 @@ const struct Curl_ssl Curl_ssl_nss = {
|
||||
Curl_nss_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_nss;
|
||||
#endif /* USE_NSS */
|
||||
|
@ -82,29 +82,8 @@ extern const struct Curl_ssl Curl_ssl_nss;
|
||||
/* this backends supports CURLOPT_PINNEDPUBLICKEY */
|
||||
#define have_curlssl_pinnedpubkey 1
|
||||
|
||||
/* API setup for NSS */
|
||||
#define curlssl_init Curl_nss_init
|
||||
#define curlssl_cleanup Curl_nss_cleanup
|
||||
#define curlssl_connect Curl_nss_connect
|
||||
#define curlssl_connect_nonblocking Curl_nss_connect_nonblocking
|
||||
|
||||
/* NSS has its own session ID cache */
|
||||
#define curlssl_session_free(x) Curl_nop_stmt
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_nss_close
|
||||
/* NSS has no shutdown function provided and thus always fail */
|
||||
#define curlssl_shutdown(x,y) ((void)x, (void)y, 1)
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_nss_version
|
||||
#define curlssl_check_cxn(x) Curl_nss_check_cxn(x)
|
||||
#define curlssl_data_pending(x,y) ((void)x, (void)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 curlssl_sha256sum(a,b,c,d) Curl_nss_sha256sum(a,b,c,d)
|
||||
#define curlssl_cert_status_request() Curl_nss_cert_status_request()
|
||||
#define curlssl_false_start() Curl_nss_false_start()
|
||||
|
||||
#endif /* USE_NSS */
|
||||
#endif /* HEADER_CURL_NSSG_H */
|
||||
|
@ -3408,4 +3408,6 @@ const struct Curl_ssl Curl_ssl_openssl = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_openssl;
|
||||
|
||||
#endif /* USE_OPENSSL */
|
||||
|
@ -99,27 +99,10 @@ extern const struct Curl_ssl Curl_ssl_openssl;
|
||||
/* this backend supports CURLOPT_PINNEDPUBLICKEY */
|
||||
#define have_curlssl_pinnedpubkey 1
|
||||
|
||||
/* API setup for OpenSSL */
|
||||
#define curlssl_init Curl_ossl_init
|
||||
#define curlssl_cleanup Curl_ossl_cleanup
|
||||
#define curlssl_connect Curl_ossl_connect
|
||||
#define curlssl_connect_nonblocking Curl_ossl_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_ossl_session_free(x)
|
||||
#define curlssl_close_all Curl_ossl_close_all
|
||||
#define curlssl_close Curl_ossl_close
|
||||
#define curlssl_shutdown(x,y) Curl_ossl_shutdown(x,y)
|
||||
#define curlssl_set_engine(x,y) Curl_ossl_set_engine(x,y)
|
||||
#define curlssl_set_engine_default(x) Curl_ossl_set_engine_default(x)
|
||||
#define curlssl_engines_list(x) Curl_ossl_engines_list(x)
|
||||
#define curlssl_version Curl_ossl_version
|
||||
#define curlssl_check_cxn Curl_ossl_check_cxn
|
||||
#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)
|
||||
#if (OPENSSL_VERSION_NUMBER >= 0x0090800fL) && !defined(OPENSSL_NO_SHA256)
|
||||
#define curlssl_sha256sum(a,b,c,d) Curl_ossl_sha256sum(a,b,c,d)
|
||||
#endif
|
||||
#define curlssl_cert_status_request() Curl_ossl_cert_status_request()
|
||||
|
||||
#define DEFAULT_CIPHER_SELECTION \
|
||||
"ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH"
|
||||
|
@ -895,4 +895,6 @@ const struct Curl_ssl Curl_ssl_polarssl = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_polarssl;
|
||||
|
||||
#endif /* USE_POLARSSL */
|
||||
|
@ -58,27 +58,7 @@ extern const struct Curl_ssl Curl_ssl_polarssl;
|
||||
/* this backends supports CURLOPT_PINNEDPUBLICKEY */
|
||||
#define have_curlssl_pinnedpubkey 1
|
||||
|
||||
/* API setup for PolarSSL */
|
||||
#define curlssl_init() Curl_polarssl_init()
|
||||
#define curlssl_cleanup() Curl_polarssl_cleanup()
|
||||
#define curlssl_connect Curl_polarssl_connect
|
||||
#define curlssl_connect_nonblocking Curl_polarssl_connect_nonblocking
|
||||
#define curlssl_session_free(x) Curl_polarssl_session_free(x)
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_polarssl_close
|
||||
#define curlssl_shutdown(x,y) 0
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_polarssl_version
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending(x,y) Curl_polarssl_data_pending(x, y)
|
||||
#define curlssl_sha256sum(a,b,c,d) sha256(a,b,c,0)
|
||||
|
||||
/* This might cause libcurl to use a weeker random!
|
||||
TODO: implement proper use of Polarssl's CTR-DRBG or HMAC-DRBG and use that
|
||||
*/
|
||||
#define curlssl_random(x,y,z) ((void)x, (void)y, (void)z, CURLE_NOT_BUILT_IN)
|
||||
|
||||
#endif /* USE_POLARSSL */
|
||||
#endif /* HEADER_CURL_POLARSSL_H */
|
||||
|
@ -1748,4 +1748,6 @@ const struct Curl_ssl Curl_ssl_schannel = {
|
||||
Curl_none_false_start /* false_start */
|
||||
};
|
||||
|
||||
const struct Curl_ssl *Curl_ssl = &Curl_ssl_schannel;
|
||||
|
||||
#endif /* USE_SCHANNEL */
|
||||
|
@ -103,22 +103,5 @@ extern const struct Curl_ssl Curl_ssl_schannel;
|
||||
/* this backend supports CURLOPT_CERTINFO */
|
||||
#define have_curlssl_certinfo 1
|
||||
|
||||
/* API setup for Schannel */
|
||||
#define curlssl_init Curl_schannel_init
|
||||
#define curlssl_cleanup Curl_schannel_cleanup
|
||||
#define curlssl_connect Curl_schannel_connect
|
||||
#define curlssl_connect_nonblocking Curl_schannel_connect_nonblocking
|
||||
#define curlssl_session_free Curl_schannel_session_free
|
||||
#define curlssl_close_all(x) ((void)x)
|
||||
#define curlssl_close Curl_schannel_close
|
||||
#define curlssl_shutdown Curl_schannel_shutdown
|
||||
#define curlssl_set_engine(x,y) ((void)x, (void)y, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_set_engine_default(x) ((void)x, CURLE_NOT_BUILT_IN)
|
||||
#define curlssl_engines_list(x) ((void)x, (struct curl_slist *)NULL)
|
||||
#define curlssl_version Curl_schannel_version
|
||||
#define curlssl_check_cxn(x) ((void)x, -1)
|
||||
#define curlssl_data_pending Curl_schannel_data_pending
|
||||
#define curlssl_random(x,y,z) Curl_schannel_random(x,y,z)
|
||||
|
||||
#endif /* USE_SCHANNEL */
|
||||
#endif /* HEADER_CURL_SCHANNEL_H */
|
||||
|
@ -37,8 +37,8 @@
|
||||
Curl_schannel_ - prefix for Schannel SSPI ones
|
||||
Curl_darwinssl_ - prefix for SecureTransport (Darwin) ones
|
||||
|
||||
Note that this source code uses curlssl_* functions, and they are all
|
||||
defines/macros #defined by the lib-specific header files.
|
||||
Note that this source code uses the functions of the configured SSL
|
||||
backend via the global Curl_ssl instance.
|
||||
|
||||
"SSL/TLS Strong Encryption: An Introduction"
|
||||
https://httpd.apache.org/docs/2.0/ssl/ssl_intro.html
|
||||
@ -161,7 +161,7 @@ int Curl_ssl_init(void)
|
||||
return 1;
|
||||
init_ssl = TRUE; /* never again */
|
||||
|
||||
return curlssl_init();
|
||||
return Curl_ssl->init();
|
||||
}
|
||||
|
||||
|
||||
@ -170,7 +170,7 @@ void Curl_ssl_cleanup(void)
|
||||
{
|
||||
if(init_ssl) {
|
||||
/* only cleanup if we did a previous init */
|
||||
curlssl_cleanup();
|
||||
Curl_ssl->cleanup();
|
||||
init_ssl = FALSE;
|
||||
}
|
||||
}
|
||||
@ -233,7 +233,7 @@ Curl_ssl_connect(struct connectdata *conn, int sockindex)
|
||||
conn->ssl[sockindex].use = TRUE;
|
||||
conn->ssl[sockindex].state = ssl_connection_negotiating;
|
||||
|
||||
result = curlssl_connect(conn, sockindex);
|
||||
result = Curl_ssl->connect(conn, sockindex);
|
||||
|
||||
if(!result)
|
||||
Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSL is connected */
|
||||
@ -257,12 +257,7 @@ Curl_ssl_connect_nonblocking(struct connectdata *conn, int sockindex,
|
||||
|
||||
/* mark this is being ssl requested from here on. */
|
||||
conn->ssl[sockindex].use = TRUE;
|
||||
#ifdef curlssl_connect_nonblocking
|
||||
result = curlssl_connect_nonblocking(conn, sockindex, done);
|
||||
#else
|
||||
*done = TRUE; /* fallback to BLOCKING */
|
||||
result = curlssl_connect(conn, sockindex);
|
||||
#endif /* non-blocking connect support */
|
||||
result = Curl_ssl->connect_nonblocking(conn, sockindex, done);
|
||||
if(!result && *done)
|
||||
Curl_pgrsTime(conn->data, TIMER_APPCONNECT); /* SSL is connected */
|
||||
return result;
|
||||
@ -361,7 +356,7 @@ void Curl_ssl_kill_session(struct curl_ssl_session *session)
|
||||
/* defensive check */
|
||||
|
||||
/* free the ID the SSL-layer specific way */
|
||||
curlssl_session_free(session->sessionid);
|
||||
Curl_ssl->session_free(session->sessionid);
|
||||
|
||||
session->sessionid = NULL;
|
||||
session->age = 0; /* fresh */
|
||||
@ -499,7 +494,7 @@ void Curl_ssl_close_all(struct Curl_easy *data)
|
||||
Curl_safefree(data->state.session);
|
||||
}
|
||||
|
||||
curlssl_close_all(data);
|
||||
Curl_ssl->close_all(data);
|
||||
}
|
||||
|
||||
#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \
|
||||
@ -542,12 +537,12 @@ int Curl_ssl_getsock(struct connectdata *conn,
|
||||
void Curl_ssl_close(struct connectdata *conn, int sockindex)
|
||||
{
|
||||
DEBUGASSERT((sockindex <= 1) && (sockindex >= -1));
|
||||
curlssl_close(conn, sockindex);
|
||||
Curl_ssl->close(conn, sockindex);
|
||||
}
|
||||
|
||||
CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex)
|
||||
{
|
||||
if(curlssl_shutdown(conn, sockindex))
|
||||
if(Curl_ssl->shutdown(conn, sockindex))
|
||||
return CURLE_SSL_SHUTDOWN_FAILED;
|
||||
|
||||
conn->ssl[sockindex].use = FALSE; /* get back to ordinary socket usage */
|
||||
@ -563,20 +558,20 @@ CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex)
|
||||
*/
|
||||
CURLcode Curl_ssl_set_engine(struct Curl_easy *data, const char *engine)
|
||||
{
|
||||
return curlssl_set_engine(data, engine);
|
||||
return Curl_ssl->set_engine(data, engine);
|
||||
}
|
||||
|
||||
/* Selects the default SSL crypto engine
|
||||
*/
|
||||
CURLcode Curl_ssl_set_engine_default(struct Curl_easy *data)
|
||||
{
|
||||
return curlssl_set_engine_default(data);
|
||||
return Curl_ssl->set_engine_default(data);
|
||||
}
|
||||
|
||||
/* Return list of OpenSSL crypto engine names. */
|
||||
struct curl_slist *Curl_ssl_engines_list(struct Curl_easy *data)
|
||||
{
|
||||
return curlssl_engines_list(data);
|
||||
return Curl_ssl->engines_list(data);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -604,7 +599,7 @@ CURLcode Curl_ssl_initsessions(struct Curl_easy *data, size_t amount)
|
||||
|
||||
size_t Curl_ssl_version(char *buffer, size_t size)
|
||||
{
|
||||
return curlssl_version(buffer, size);
|
||||
return Curl_ssl->version(buffer, size);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -617,13 +612,13 @@ size_t Curl_ssl_version(char *buffer, size_t size)
|
||||
*/
|
||||
int Curl_ssl_check_cxn(struct connectdata *conn)
|
||||
{
|
||||
return curlssl_check_cxn(conn);
|
||||
return Curl_ssl->check_cxn(conn);
|
||||
}
|
||||
|
||||
bool Curl_ssl_data_pending(const struct connectdata *conn,
|
||||
int connindex)
|
||||
{
|
||||
return curlssl_data_pending(conn, connindex);
|
||||
return Curl_ssl->data_pending(conn, connindex);
|
||||
}
|
||||
|
||||
void Curl_ssl_free_certinfo(struct Curl_easy *data)
|
||||
@ -721,7 +716,7 @@ CURLcode Curl_ssl_random(struct Curl_easy *data,
|
||||
unsigned char *entropy,
|
||||
size_t length)
|
||||
{
|
||||
return curlssl_random(data, entropy, length);
|
||||
return Curl_ssl->random(data, entropy, length);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -965,11 +960,7 @@ CURLcode Curl_ssl_md5sum(unsigned char *tmp, /* input */
|
||||
*/
|
||||
bool Curl_ssl_cert_status_request(void)
|
||||
{
|
||||
#ifdef curlssl_cert_status_request
|
||||
return curlssl_cert_status_request();
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
return Curl_ssl->cert_status_request();
|
||||
}
|
||||
|
||||
/*
|
||||
@ -977,11 +968,7 @@ bool Curl_ssl_cert_status_request(void)
|
||||
*/
|
||||
bool Curl_ssl_false_start(void)
|
||||
{
|
||||
#ifdef curlssl_false_start
|
||||
return curlssl_false_start();
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
return Curl_ssl->false_start();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -56,6 +56,10 @@ struct Curl_ssl {
|
||||
bool (*false_start)(void);
|
||||
};
|
||||
|
||||
#ifdef USE_SSL
|
||||
extern const struct Curl_ssl *Curl_ssl;
|
||||
#endif
|
||||
|
||||
int Curl_none_init(void);
|
||||
void Curl_none_cleanup(void);
|
||||
int Curl_none_shutdown(struct connectdata *conn, int sockindex);
|
||||
|
Loading…
Reference in New Issue
Block a user