From 81a438b7d71555149b2901756d66815395953077 Mon Sep 17 00:00:00 2001 From: Sam Berry Date: Fri, 12 Jul 2024 14:42:08 +0100 Subject: [PATCH 1/2] Remove MBEDTLS_PSA_UTIL_HAVE_ECDSA so that functions are only enabled when PSA enabled Signed-off-by: Sam Berry --- include/mbedtls/config_adjust_legacy_crypto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mbedtls/config_adjust_legacy_crypto.h b/include/mbedtls/config_adjust_legacy_crypto.h index 7a375d864..3ba987ebb 100644 --- a/include/mbedtls/config_adjust_legacy_crypto.h +++ b/include/mbedtls/config_adjust_legacy_crypto.h @@ -428,7 +428,7 @@ /* psa_util file features some ECDSA conversion functions, to convert between * legacy's ASN.1 DER format and PSA's raw one. */ -#if defined(MBEDTLS_ECDSA_C) || (defined(MBEDTLS_PSA_CRYPTO_C) && \ +#if (defined(MBEDTLS_PSA_CRYPTO_CLIENT) && \ (defined(PSA_WANT_ALG_ECDSA) || defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA))) #define MBEDTLS_PSA_UTIL_HAVE_ECDSA #endif From 6474d906bbabcc36d760187ba754b0b1b40023e7 Mon Sep 17 00:00:00 2001 From: Sam Berry Date: Wed, 7 Aug 2024 13:56:21 +0100 Subject: [PATCH 2/2] Changelog entry Signed-off-by: Sam Berry --- ChangeLog.d/psa_util_in_builds_without_psa.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ChangeLog.d/psa_util_in_builds_without_psa.txt diff --git a/ChangeLog.d/psa_util_in_builds_without_psa.txt b/ChangeLog.d/psa_util_in_builds_without_psa.txt new file mode 100644 index 000000000..7c0866dd3 --- /dev/null +++ b/ChangeLog.d/psa_util_in_builds_without_psa.txt @@ -0,0 +1,5 @@ +Bugfix + * When MBEDTLS_PSA_CRYPTO_C was disabled and MBEDTLS_ECDSA_C enabled, + some code was defining 0-size arrays, resulting in compilation errors. + Fixed by disabling the offending code in configurations without PSA + Crypto, where it never worked. Fixes #9311.