Open misch7 opened 1 month ago
To reproduce this warning, you need:
MBEDTLS_SSL_SRV_C
and MBEDTLS_SSL_PROTO_TLS1_2
);MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
);PSA_WANT_ALG_FFDH
or MBEDTLS_DHM_C
);PSA_EXPORT_PUBLIC_KEY_MAX_SIZE >= 256
(that's where 528 comes from in the diagnostic);MBEDTLS_USE_PSA_CRYPTO
enabled;We don't get this warning in the CI because we don't have a build with all of these characteristics. Checking the outcome file from https://github.com/Mbed-TLS/mbedtls/pull/9172, only the following builds have MBEDTLS_RSA_C
but not MBEDTLS_DHM_C
:
component_test_full_no_bignum
component_test_psa_crypto_config_accel_ffdh
config-no-entropy.h
full_no_bignum
having RSA enabled is a bug, but anyway it legitimately doesn't have DHM. psa_crypto_config_accel_ffdh
has FFDH, just accelerated. config-no-entropy.h
doesn't have TLS.
So we have a test coverage gap. I need to think a little what new configuration(s) we should be testing. Considering how the relative sizes of various things in TLS depend on whether RSA or FFDH are enabled, there are potential buffer overflows that we aren't checking.
Summary
Build fails with the following custom configuration:
MBEDTLS_USE_PSA_CRYPTO
MBEDTLS_DHM_C
MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED
MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
System information
Mbed TLS version: v3.6.0 and development branch Operating system and version: macOS 12.6 Configuration: please see "Steps to reproduce" section below Compiler and options: Apple clang version 14.0.0 (clang-1400.0.29.202), Xcode 14.2 (14C18), SDK:
MacOSX13.1.sdk
Expected behavior
Compilation should work with
MBEDTLS_USE_PSA_CRYPTO
set, regardless ofMBEDTLS_DHM_C
being set or unset.Actual behavior
Build fails with following output:
Steps to reproduce
development
ormbedtls-3.6
branchrelease
using CMakeAdditional information
I've already created a working local patch and the PR will follow soon.