From c9184fe7ab73d9cb00cc537d88d2f79d46a17ec2 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Mon, 27 May 2024 19:59:21 +0200 Subject: [PATCH] Fix server mode only build of v3.6 with MBEDTLS_SSL_CLI_C unset (fixes #9186) Signed-off-by: Michael Schuster --- ChangeLog.d/fix-server-mode-only-build.txt | 3 +++ library/ssl_misc.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 ChangeLog.d/fix-server-mode-only-build.txt diff --git a/ChangeLog.d/fix-server-mode-only-build.txt b/ChangeLog.d/fix-server-mode-only-build.txt new file mode 100644 index 0000000000..d1d8341f79 --- /dev/null +++ b/ChangeLog.d/fix-server-mode-only-build.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix server mode only build when MBEDTLS_SSL_SRV_C is enabled but + MBEDTLS_SSL_CLI_C is disabled. Reported by M-Bab on GitHub in #9186. diff --git a/library/ssl_misc.h b/library/ssl_misc.h index a8807f67c6..8402fe86ae 100644 --- a/library/ssl_misc.h +++ b/library/ssl_misc.h @@ -1507,7 +1507,7 @@ int mbedtls_ssl_psk_derive_premaster(mbedtls_ssl_context *ssl, #endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */ #if defined(MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED) -#if defined(MBEDTLS_SSL_CLI_C) +#if defined(MBEDTLS_SSL_CLI_C) || defined(MBEDTLS_SSL_SRV_C) MBEDTLS_CHECK_RETURN_CRITICAL int mbedtls_ssl_conf_has_static_psk(mbedtls_ssl_config const *conf); #endif