aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2016-02-27 19:01:00 -0500
committerJay Satiro <raysatiro@yahoo.com>2016-02-27 19:01:00 -0500
commit2e0a3b935c8bc8fc8e3267aae7ad50f452ecadb3 (patch)
tree39b55ed8144c91d420c676ea9d4473f21f2b9413 /lib
parent6f1735926fc44b12f984f19538befd3502c8a237 (diff)
getinfo: Add support for mbedTLS TLS session info
.. and preprocessor check TLS session info is defined for all backends.
Diffstat (limited to 'lib')
-rw-r--r--lib/getinfo.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 2508b291f..117d513a5 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -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;
}