mbedtls: MBEDTLS_ENTROPY_POLL_ZEPHYR default on if MBEDTLS_ENTROPY_C

As long as MBEDTLS_ENTROPY_C is enabled, Mbed TLS needs to
poll some entropy source to gather data that will then be
processed by CTR/HMAC-DRBG modules. This means that in most
of the cases, once MBEDTLS_ENTROPY_C is enabled then also
MBEDTLS_ENTROPY_POLL_ZEPHYR needs to be enabled. This was
done manually until now, as the long list of samples/tests
demonstrate.

This commit solves this dependency by defaulting
MBEDTLS_ENTROPY_POLL_ZEPHYR to on as soon as
MBEDTLS_ENTROPY_C is set. As a consequence, all manual
enablement of MBEDTLS_ENTROPY_POLL_ZEPHYR in samples/tests
are removed.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2024-11-05 14:59:24 +01:00 committed by Anas Nashif
commit 516886be1b
12 changed files with 2 additions and 10 deletions

View file

@ -112,7 +112,6 @@ config BT_SILABS_EFR32
select MBEDTLS
select MBEDTLS_PSA_CRYPTO_C
select MBEDTLS_ENTROPY_C
select MBEDTLS_ENTROPY_POLL_ZEPHYR
help
Use Silicon Labs binary Bluetooth library to connect to the
controller.

View file

@ -377,7 +377,6 @@ config ESP32_WIFI_MBEDTLS_CRYPTO
select MBEDTLS_CIPHER_MODE_CTR_ENABLED
select MBEDTLS_CMAC
select MBEDTLS_ENTROPY_C
select MBEDTLS_ENTROPY_POLL_ZEPHYR
help
Select this option to use MbedTLS crypto APIs which utilize hardware acceleration.

View file

@ -398,6 +398,7 @@ config MBEDTLS_ENTROPY_C
config MBEDTLS_ENTROPY_POLL_ZEPHYR
bool "Provide entropy data to Mbed TLS through entropy driver or random generator"
default y
depends on MBEDTLS_ENTROPY_C
help
Provide entropy data to the Mbed TLS's entropy module through either

View file

@ -103,7 +103,6 @@ CONFIG_MBEDTLS_USER_CONFIG_FILE="wpa_supp_els_pkc_mbedtls_config.h"
CONFIG_ENTROPY_GENERATOR=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENTROPY_C=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=8192
# power management

View file

@ -102,7 +102,6 @@ CONFIG_MBEDTLS_USER_CONFIG_FILE="wpa_supp_els_pkc_mbedtls_config.h"
CONFIG_ENTROPY_GENERATOR=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENTROPY_C=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=8192
# power management

View file

@ -2,4 +2,3 @@
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_TIMER_RANDOM_GENERATOR=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y

View file

@ -2,4 +2,3 @@
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_TIMER_RANDOM_GENERATOR=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y

View file

@ -1476,7 +1476,6 @@ config BT_MESH_USES_MBEDTLS_PSA
select EXPERIMENTAL
select MBEDTLS
select MBEDTLS_ENTROPY_C
select MBEDTLS_ENTROPY_POLL_ZEPHYR
select MBEDTLS_PSA_CRYPTO_C
select MBEDTLS_USE_PSA_CRYPTO
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT

View file

@ -13,7 +13,6 @@ CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=2048
CONFIG_MBEDTLS_ENTROPY_C=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y
# PSA Crypto options

View file

@ -4,7 +4,6 @@ CONFIG_MAIN_STACK_SIZE=2048
CONFIG_MBEDTLS=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_TIMER_RANDOM_GENERATOR=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_SECURE_STORAGE=y

View file

@ -1,7 +1,6 @@
CONFIG_MBEDTLS=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_TIMER_RANDOM_GENERATOR=y
CONFIG_MBEDTLS_ENTROPY_POLL_ZEPHYR=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
# SETTINGS_MAX_VAL_LEN (256) - flags (1) - CONFIG_SECURE_STORAGE_ITS_TRANSFORM_OUTPUT_OVERHEAD (28)

View file

@ -1,3 +1,4 @@
CONFIG_FLASH_AREA_CHECK_INTEGRITY_PSA=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_TEST_RANDOM_GENERATOR=y