From 13e8b492b1c900deda34c73ae3ccd97ac5bb9cf0 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Mon, 27 May 2024 20:07:05 +0200 Subject: [PATCH] Fix build of v3.6 with unset MBEDTLS_DHM_C but MBEDTLS_USE_PSA_CRYPTO set (fixes #9188) Avoid compiler warning about size comparison (like in commit 7910cdd): Clang builds fail, warning about comparing uint8_t to a size that may be >255. Signed-off-by: Michael Schuster --- ChangeLog.d/fix-clang-psa-build-without-dhm.txt | 3 +++ library/ssl_tls12_server.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 ChangeLog.d/fix-clang-psa-build-without-dhm.txt diff --git a/ChangeLog.d/fix-clang-psa-build-without-dhm.txt b/ChangeLog.d/fix-clang-psa-build-without-dhm.txt new file mode 100644 index 000000000000..7ae1c68a409a --- /dev/null +++ b/ChangeLog.d/fix-clang-psa-build-without-dhm.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix Clang compilation error when MBEDTLS_USE_PSA_CRYPTO is enabled + but MBEDTLS_DHM_C is disabled. Reported by Michael Schuster in #9188. diff --git a/library/ssl_tls12_server.c b/library/ssl_tls12_server.c index b5b975ff40bd..81ee6002e1b1 100644 --- a/library/ssl_tls12_server.c +++ b/library/ssl_tls12_server.c @@ -3921,7 +3921,7 @@ static int ssl_parse_client_key_exchange(mbedtls_ssl_context *ssl) #if defined(MBEDTLS_USE_PSA_CRYPTO) psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; psa_status_t destruction_status = PSA_ERROR_CORRUPTION_DETECTED; - uint8_t ecpoint_len; + size_t ecpoint_len; mbedtls_ssl_handshake_params *handshake = ssl->handshake;