From: Daniel Stenberg Date: Mon, 11 Feb 2019 13:30:23 +0000 (+0100) Subject: mbedtls: make it build even if MBEDTLS_VERSION_C isn't set X-Git-Tag: curl-7_64_1~159 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aabe0a73120366005589b1ef9024399ec50e68dd;p=curl mbedtls: make it build even if MBEDTLS_VERSION_C isn't set Reported-by: MAntoniak on github Fixes #3553 Closes #3556 --- 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,