From 44fed61e01486435d7c4e2248739e581fd1dd83e Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 21 Aug 2018 18:20:20 +0200 Subject: [PATCH] Create infrastructure for metadata validation unit tests --- crypto/tests/Makefile | 3 +++ scripts/mbed_crypto.make | 2 ++ .../suites/test_suite_psa_crypto_metadata.data | 0 .../test_suite_psa_crypto_metadata.function | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 tests/suites/test_suite_psa_crypto_metadata.data create mode 100644 tests/suites/test_suite_psa_crypto_metadata.function diff --git a/crypto/tests/Makefile b/crypto/tests/Makefile index 3315a6eca..2de5ffa7a 100644 --- a/crypto/tests/Makefile +++ b/crypto/tests/Makefile @@ -15,10 +15,12 @@ PYTHON ?= python APPS := \ test_suite_psa_crypto \ + test_suite_psa_crypto_metadata \ # Don't delete this line. # Look up for associated function files func.test_suite_psa_crypto := test_suite_psa_crypto +func.test_suite_psa_crypto_metadata := test_suite_psa_crypto_metadata .SILENT: @@ -52,6 +54,7 @@ clean: rm -rf data_files/ctr_drbg_seed data_files/hmac_drbg_seed data_files/mpi_write test: $(APPS) + ./test_suite_psa_crypto_metadata ./test_suite_psa_crypto # Create separate targets for generating embedded tests. diff --git a/scripts/mbed_crypto.make b/scripts/mbed_crypto.make index f06bdfba2..5da57084d 100644 --- a/scripts/mbed_crypto.make +++ b/scripts/mbed_crypto.make @@ -150,6 +150,8 @@ TEST_FILES := \ tests/suites/target_test.function \ tests/suites/test_suite_psa_crypto.data \ tests/suites/test_suite_psa_crypto.function \ + tests/suites/test_suite_psa_crypto_metadata.data \ + tests/suites/test_suite_psa_crypto_metadata.function \ # Don't delete this line. OTHER_FILES := \ diff --git a/tests/suites/test_suite_psa_crypto_metadata.data b/tests/suites/test_suite_psa_crypto_metadata.data new file mode 100644 index 000000000..e69de29bb diff --git a/tests/suites/test_suite_psa_crypto_metadata.function b/tests/suites/test_suite_psa_crypto_metadata.function new file mode 100644 index 000000000..51f7a5ef5 --- /dev/null +++ b/tests/suites/test_suite_psa_crypto_metadata.function @@ -0,0 +1,18 @@ +/* BEGIN_HEADER */ +/* Test macros that provide metadata about algorithms and key types. + * This test suite only contains tests that don't require executing + * code. Other test suites validate macros that require creating a key + * and using it. */ + +#if defined(MBEDTLS_PSA_CRYPTO_SPM) +#include "spm/psa_defs.h" +#endif + +#include "psa/crypto.h" + +/* END_HEADER */ + +/* BEGIN_DEPENDENCIES + * depends_on:MBEDTLS_PSA_CRYPTO_C + * END_DEPENDENCIES + */