1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-06-23 05:33:55 +08:00

tests: remove usage of MBEDTLS_NO_PLATFORM_ENTROPY

Use MBEDTLS_PLATFORM_GET_ENTROPY_ALT instead.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2025-04-15 08:56:51 +02:00
parent 405d4adff2
commit 73bd210a94
5 changed files with 5 additions and 10 deletions

View File

@ -211,7 +211,7 @@ static int run_test_snprintf(void)
* back.
*/
#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_ENTROPY_C)
#if defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_NO_PLATFORM_ENTROPY)
#if defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_PLATFORM_GET_ENTROPY_ALT)
static void create_entropy_seed_file(void)
{
int result;
@ -244,7 +244,7 @@ static void create_entropy_seed_file(void)
static int mbedtls_entropy_self_test_wrapper(int verbose)
{
#if defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_NO_PLATFORM_ENTROPY)
#if defined(MBEDTLS_ENTROPY_NV_SEED) && !defined(MBEDTLS_PLATFORM_GET_ENTROPY_ALT)
create_entropy_seed_file();
#endif
return mbedtls_entropy_self_test(verbose);

View File

@ -88,7 +88,6 @@ EXCLUDE_FROM_FULL = frozenset([
'MBEDTLS_MEMORY_DEBUG', # depends on MEMORY_BUFFER_ALLOC_C
'MBEDTLS_NO_64BIT_MULTIPLICATION', # influences anything that uses bignum
'MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES', # removes a feature
'MBEDTLS_NO_PLATFORM_ENTROPY', # removes a feature
'MBEDTLS_NO_UDBL_DIVISION', # influences anything that uses bignum
'MBEDTLS_PSA_P256M_DRIVER_ENABLED', # influences SECP256R1 KeyGen/ECDH/ECDSA
'MBEDTLS_PLATFORM_NO_STD_FUNCTIONS', # removes a feature
@ -182,7 +181,7 @@ def baremetal_adapter(name, value, active):
"""Config adapter for "baremetal"."""
if not is_boolean_setting(name, value):
return active
if name == 'MBEDTLS_NO_PLATFORM_ENTROPY':
if name == 'MBEDTLS_PLATFORM_GET_ENTROPY_ALT':
# No OS-provided entropy source
return True
return include_in_full(name) and keep_in_baremetal(name)

View File

@ -64,7 +64,7 @@ doit()
scripts/config.py unset MBEDTLS_NET_C || true
scripts/config.py unset MBEDTLS_TIMING_C || true
scripts/config.py unset MBEDTLS_FS_IO || true
scripts/config.py --force set MBEDTLS_NO_PLATFORM_ENTROPY || true
scripts/config.py --force set MBEDTLS_PLATFORM_GET_ENTROPY_ALT || true
} >/dev/null 2>&1
make clean >/dev/null

View File

@ -121,7 +121,6 @@ class CoverageTask(outcome_analysis.CoverageTask):
# Obsolete configuration options, to be replaced by
# PSA entropy drivers.
# https://github.com/Mbed-TLS/mbedtls/issues/8150
'Config: MBEDTLS_NO_PLATFORM_ENTROPY',
'Config: MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES',
# Untested aspect of the platform interface.
# https://github.com/Mbed-TLS/mbedtls/issues/9589

View File

@ -26,7 +26,7 @@ component_build_no_sockets () {
msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s
scripts/config.py full
scripts/config.py unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
scripts/config.py set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
scripts/config.py set MBEDTLS_PLATFORM_GET_ENTROPY_ALT # prevent syscall() on GNU/Linux
make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1 -std=c99 -pedantic' lib
}
@ -106,6 +106,3 @@ component_test_no_64bit_multiplication () {
msg "test: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
make test
}