Fix "unused function" warning in some configs

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard 2020-08-24 10:29:30 +02:00
parent de1cf2c5e1
commit 8a79b9b68c

View File

@ -6,7 +6,13 @@
#include "mbedtls/oid.h" #include "mbedtls/oid.h"
#include "mbedtls/rsa.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 "psa/crypto.h"
#include "mbedtls/psa_util.h" #include "mbedtls/psa_util.h"
#include "test/psa_crypto_helpers.h" #include "test/psa_crypto_helpers.h"
@ -17,7 +23,7 @@
* MBEDTLS_USE_PSA_CRYPTO. */ * MBEDTLS_USE_PSA_CRYPTO. */
#define PSA_INIT( ) ( (void) 0 ) #define PSA_INIT( ) ( (void) 0 )
#define PSA_DONE( ) ( (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) #if defined(MBEDTLS_RSA_C)
int mbedtls_rsa_decrypt_func( void *ctx, int mode, size_t *olen, int mbedtls_rsa_decrypt_func( void *ctx, int mode, size_t *olen,