mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:23:31 +03:00
getinfo: Add support for mbedTLS TLS session info
.. and preprocessor check TLS session info is defined for all backends.
This commit is contained in:
parent
6f1735926f
commit
2e0a3b935c
3 changed files with 22 additions and 24 deletions
|
|
@ -296,35 +296,31 @@ static CURLcode getinfo_slist(struct SessionHandle *data, CURLINFO info,
|
|||
unsigned int i;
|
||||
for(i = 0; i < (sizeof(conn->ssl) / sizeof(conn->ssl[0])); ++i) {
|
||||
if(conn->ssl[i].use) {
|
||||
#ifdef USE_AXTLS
|
||||
#if defined(USE_AXTLS)
|
||||
tsi->internals = (void *)conn->ssl[i].ssl;
|
||||
#endif
|
||||
#ifdef USE_CYASSL
|
||||
#elif defined(USE_CYASSL)
|
||||
tsi->internals = (void *)conn->ssl[i].handle;
|
||||
#endif
|
||||
#ifdef USE_DARWINSSL
|
||||
#elif defined(USE_DARWINSSL)
|
||||
tsi->internals = (void *)conn->ssl[i].ssl_ctx;
|
||||
#endif
|
||||
#ifdef USE_GNUTLS
|
||||
#elif defined(USE_GNUTLS)
|
||||
tsi->internals = (void *)conn->ssl[i].session;
|
||||
#endif
|
||||
#ifdef USE_GSKIT
|
||||
#elif defined(USE_GSKIT)
|
||||
tsi->internals = (void *)conn->ssl[i].handle;
|
||||
#endif
|
||||
#ifdef USE_NSS
|
||||
#elif defined(USE_MBEDTLS)
|
||||
tsi->internals = (void *)conn->ssl[i].ssn;
|
||||
#elif defined(USE_NSS)
|
||||
tsi->internals = (void *)conn->ssl[i].handle;
|
||||
#endif
|
||||
#ifdef USE_OPENSSL
|
||||
#elif defined(USE_OPENSSL)
|
||||
/* Legacy: CURLINFO_TLS_SESSION must return an SSL_CTX pointer. */
|
||||
tsi->internals = ((info == CURLINFO_TLS_SESSION) ?
|
||||
(void *)conn->ssl[i].ctx :
|
||||
(void *)conn->ssl[i].handle);
|
||||
#endif
|
||||
#ifdef USE_POLARSSL
|
||||
#elif defined(USE_POLARSSL)
|
||||
tsi->internals = (void *)&conn->ssl[i].ssn;
|
||||
#endif
|
||||
#ifdef USE_SCHANNEL
|
||||
#elif defined(USE_SCHANNEL)
|
||||
tsi->internals = (void *)&conn->ssl[i].ctxt->ctxt_handle;
|
||||
#elif defined(USE_SSL)
|
||||
#error "SSL backend specific information missing for CURLINFO_TLS_SSL_PTR"
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue