From 16a0c89d5f72faf97ff419d7e70e68ac75d87491 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 16 May 2024 09:55:01 -0300 Subject: [PATCH] unbreak MbedTLS in Linux --- src/tls_mbed.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tls_mbed.c b/src/tls_mbed.c index 2b729e20..4ca6d09b 100644 --- a/src/tls_mbed.c +++ b/src/tls_mbed.c @@ -105,8 +105,9 @@ void mg_tls_init(struct mg_connection *c, const struct mg_tls_opts *opts) { if (c->is_listening) goto fail; MG_DEBUG(("%lu Setting TLS", c->id)); MG_PROF_ADD(c, "mbedtls_init_start"); -#if defined(MBEDTLS_PSA_CRYPTO_C) - psa_crypto_init(); +#if defined(MBEDTLS_VERSION_NUMBER) && MBEDTLS_VERSION_NUMBER >= 0x03000000 && \ + defined(MBEDTLS_PSA_CRYPTO_C) + psa_crypto_init(); // https://github.com/Mbed-TLS/mbedtls/issues/9072#issuecomment-2084845711 #endif mbedtls_ssl_init(&tls->ssl); mbedtls_ssl_config_init(&tls->conf);