From f4e672ec9e93d728a7e1761a7204b683276d1356 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Fri, 31 Jan 2020 14:22:10 +0100 Subject: [PATCH] Add missing compilation guards in test suite Fix the build when MBEDTLS_USE_PSA_CRYPTO is set but MBEDTLS_X509_CSR_WRITE_C is not. --- tests/suites/test_suite_x509write.function | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index 7b369bb87..0db2b0e94 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -33,7 +33,8 @@ size_t mbedtls_rsa_key_len_func( void *ctx ) } #endif /* MBEDTLS_RSA_C */ -#if defined(MBEDTLS_USE_PSA_CRYPTO) +#if defined(MBEDTLS_USE_PSA_CRYPTO) && \ + defined(MBEDTLS_PEM_WRITE_C) && defined(MBEDTLS_X509_CSR_WRITE_C) static int x509_crt_verifycsr( const unsigned char *buf, size_t buflen ) { unsigned char hash[MBEDTLS_MD_MAX_SIZE]; @@ -70,7 +71,7 @@ cleanup: mbedtls_x509_csr_free( &csr ); return( ret ); } -#endif /* MBEDTLS_USE_PSA_CRYPTO */ +#endif /* MBEDTLS_USE_PSA_CRYPTO && MBEDTLS_PEM_WRITE_C && MBEDTLS_X509_CSR_WRITE_C */ /* END_HEADER */