Closed
Description
In Mbed TLS 3.6.0, when MBEDTLS_ECDSA_C
is enabled but MBEDTLS_PSA_CRYPTO_C
is disabled, some code from psa_util.c
is included and declares a 0-size array, resulting in a compilation error (except under some non-picky compilers). In this configuration, no code from psa_util.c
should be included.
The culprit seems to be the definition of MBEDTLS_PSA_UTIL_HAVE_ECDSA
in include/mbedtls/config_adjust_legacy_crypto.h
:
#if defined(MBEDTLS_ECDSA_C) || (defined(MBEDTLS_PSA_CRYPTO_C) && \
(defined(PSA_WANT_ALG_ECDSA) || defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)))
#define MBEDTLS_PSA_UTIL_HAVE_ECDSA
#endif
MBEDTLS_PSA_UTIL_xxx
should be either undefined or ignored if MBEDTLS_PSA_CRYPTO_C
isn't defined. (Or should this be MBEDTLS_PSA_CRYPTO_CLIENT
?)
Originally reported on the mailing list
Definition of done:
- When
MBEDTLS_PSA_CRYPTO_C
is disabled, no code frompsa_util.c
should be enabled. - This should have been caught by the CI, in
component_test_no_psa_crypto_full_cmake_asan
and in some of the reference configurations. Figure out why it wasn't caught and fix that.
Metadata
Metadata
Assignees
Type
Projects
Status
Done
Status
3.6.1 patch release