From 87d99fbd6cfe08e64f029c6857e614f5c38e3fa5 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Tue, 14 May 2024 10:57:35 +0200 Subject: [PATCH] psasim: create a seedfile to be used for the crypto server This allows to re-enable MBEDTLS_ENTROPY_NV_SEED since the seedfile is correctly found in the "test" folder at runtime. Signed-off-by: Valerio Setti --- tests/psa-client-server/psasim/Makefile | 6 +++++- tests/scripts/all.sh | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/psa-client-server/psasim/Makefile b/tests/psa-client-server/psasim/Makefile index 01e3486b65..396f5ad3f0 100644 --- a/tests/psa-client-server/psasim/Makefile +++ b/tests/psa-client-server/psasim/Makefile @@ -29,10 +29,13 @@ PSA_SERVER_SRC = $(PARTITION_SERVER_BOOTSTRAP) \ all: $(TEST_BIN) +test/seedfile: + dd if=/dev/urandom of=./test/seedfile bs=64 count=1 + test/psa_client: $(PSA_CLIENT_SRC) $(GENERATED_H_FILES) $(CC) $(COMMON_INCLUDE) $(CFLAGS) $(PSA_CLIENT_SRC) $(LIBPSACLIENT) $(LDFLAGS) -o $@ -test/psa_partition: $(PSA_SERVER_SRC) $(GENERATED_H_FILES) +test/psa_partition: $(PSA_SERVER_SRC) $(GENERATED_H_FILES) test/seedfile $(CC) $(COMMON_INCLUDE) $(CFLAGS) $(PSA_SERVER_SRC) $(LIBPSASERVER) $(LDFLAGS) -o $@ $(PARTITION_SERVER_BOOTSTRAP) $(GENERATED_H_FILES): src/manifest.json src/server.c @@ -56,4 +59,5 @@ clean: rm -rf include/psa_manifest rm -f test/psa_service_* test/psa_notify_* rm -r test/*.log + rm test/seedfile diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index fbe9523caf..6ce0fa9088 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -968,12 +968,6 @@ helper_crypto_client_build() { scripts/config.py crypto_full scripts/config.py unset MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS scripts/config.py set MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER - # scripts/config.py set MBEDTLS_PSA_CRYPTO_SPM - # Disable NV_SEED as the MBEDTLS_PLATFORM_STD_NV_SEED_FILE is not in - # right path for mbedtls_platform_std_nv_seed_read(). Just rely on - # mbedtls_platform_entropy_poll() as entropy source(). - scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED - scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT fi make -C tests/psa-client-server/psasim/ CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" $TARGET_LIB "$@"