diff options
author | Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com> | 2020-08-24 10:29:30 +0200 |
---|---|---|
committer | Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com> | 2020-08-24 10:29:30 +0200 |
commit | 8a79b9b68c3e30bd9654fe74d0ee48ef2062f7a0 (patch) | |
tree | b13551c6885e8df7ea23787d7c7ae06b9e6810a9 | |
parent | de1cf2c5e1df1206f02633581eea3e86c3d7d985 (diff) | |
download | mbed-tls-8a79b9b68c3e30bd9654fe74d0ee48ef2062f7a0.tar.gz |
Fix "unused function" warning in some configs
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
-rw-r--r-- | tests/suites/test_suite_x509write.function | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index b205b74d7..de6a1064b 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -6,7 +6,13 @@ #include "mbedtls/oid.h" #include "mbedtls/rsa.h" -#if defined(MBEDTLS_USE_PSA_CRYPTO) +/* 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) #include "psa/crypto.h" #include "mbedtls/psa_util.h" #include "test/psa_crypto_helpers.h" @@ -17,7 +23,7 @@ * MBEDTLS_USE_PSA_CRYPTO. */ #define PSA_INIT( ) ( (void) 0 ) #define PSA_DONE( ) ( (void) 0 ) -#endif +#endif /* MBEDTLS_USE_PSA_CRYPTO && MBEDTLS_PEM_WRITE_C && MBEDTLS_X509_CSR_WRITE_C */ #if defined(MBEDTLS_RSA_C) int mbedtls_rsa_decrypt_func( void *ctx, int mode, size_t *olen, |