Commit 17e28a4b authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by Greg Zaverucha

ssl: call mbedtls_version_get_string() only if available

The function mbedtls_version_get_string()  is only available if
MBEDTLS_VERSION_C is set in the mbedtls configuration. Check this
before calling this function and print the mbedtls version this was
compiled against instead if mbedtls_version_get_string()  is not
available.

This fixes a compile problem when MBEDTLS_VERSION_C is not set.

Change-Id: I54c2c2a3fc1f9d35afa475500e3db68420a1b54a
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16231Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarKevin Kane <kkane@microsoft.com>
Reviewed-by: default avatarGreg Zaverucha <gregz@microsoft.com>
parent 975ca0cb
......@@ -1368,9 +1368,13 @@ CAResult_t CAinitSslAdapter()
/* Initialize TLS library
*/
#if !defined(NDEBUG) || defined(TB_LOG)
#ifdef MBEDTLS_VERSION_C
char version[MBED_TLS_VERSION_LEN];
mbedtls_version_get_string(version);
OIC_LOG_V(INFO, NET_SSL_TAG, "mbed TLS version: %s", version);
#else
OIC_LOG_V(INFO, NET_SSL_TAG, "mbed TLS version: %s", MBEDTLS_VERSION_STRING);
#endif
#endif
/* Entropy settings
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment