summaryrefslogtreecommitdiff
path: root/lib/vtls/mbedtls.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-11 14:30:23 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-02-12 10:27:47 +0100
commitaabe0a73120366005589b1ef9024399ec50e68dd (patch)
tree656d9ba50188e26a9fe610b70a48fbdf3087df40 /lib/vtls/mbedtls.c
parent5c31aebf64716c9ea644dde0a5c3034e5d41144b (diff)
downloadcurl-aabe0a73120366005589b1ef9024399ec50e68dd.tar.gz
mbedtls: make it build even if MBEDTLS_VERSION_C isn't set
Reported-by: MAntoniak on github Fixes #3553 Closes #3556
Diffstat (limited to 'lib/vtls/mbedtls.c')
-rw-r--r--lib/vtls/mbedtls.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c
index bb6a757bf..c36c93e3f 100644
--- a/lib/vtls/mbedtls.c
+++ b/lib/vtls/mbedtls.c
@@ -813,9 +813,14 @@ static void Curl_mbedtls_session_free(void *ptr)
static size_t Curl_mbedtls_version(char *buffer, size_t size)
{
+#ifdef MBEDTLS_VERSION_C
+ /* if mbedtls_version_get_number() is available it is better */
unsigned int version = mbedtls_version_get_number();
return msnprintf(buffer, size, "mbedTLS/%u.%u.%u", version>>24,
(version>>16)&0xff, (version>>8)&0xff);
+#else
+ return msnprintf(buffer, size, "mbedTLS/%s", MBEDTLS_VERSION_STRING);
+#endif
}
static CURLcode Curl_mbedtls_random(struct Curl_easy *data,