From 9a4baa13362c60372de6229e8b280162c80c2ebf Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 24 Nov 2020 18:31:19 +0100 Subject: [PATCH] Remove unnecessary precautions around #include psa_crypto_helpers.h psa_crypto_helpers.h no longer defines static functions, so it can be included anywhere without worrying about unused functions. Signed-off-by: Gilles Peskine --- tests/suites/test_suite_x509write.function | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index 3803377cc..6a28fa108 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -6,24 +6,12 @@ #include "mbedtls/oid.h" #include "mbedtls/rsa.h" -/* These are the same depends as the test function x509_crs_check_opaque(), - * the only function using PSA here. Using a weaker condition would result in - * warnings about the static functions defined in psa_crypto_helpers.h being - * unused. */ -#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ - defined(MBEDTLS_PEM_WRITE_C) && \ - defined(MBEDTLS_X509_CSR_WRITE_C) +#if defined(MBEDTLS_USE_PSA_CRYPTO) #include "psa/crypto.h" #include "mbedtls/psa_util.h" #include "test/psa_crypto_helpers.h" #define PSA_INIT( ) PSA_ASSERT( psa_crypto_init( ) ) -#else -/* Define empty macros so that we can use them in the preamble and teardown - * of every test function that uses PSA conditionally based on - * MBEDTLS_USE_PSA_CRYPTO. */ -#define PSA_INIT( ) ( (void) 0 ) -#define PSA_DONE( ) ( (void) 0 ) -#endif /* MBEDTLS_USE_PSA_CRYPTO && MBEDTLS_PEM_WRITE_C && MBEDTLS_X509_CSR_WRITE_C */ +#endif /* MBEDTLS_USE_PSA_CRYPTO */ #if defined(MBEDTLS_RSA_C) int mbedtls_rsa_decrypt_func( void *ctx, int mode, size_t *olen,