Add a check in check_config.h for PK_WRITE_C when RSA is enabled

This is required for importing RSA keys, as 
mbedtls_psa_rsa_export_key is used internally.
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek 2022-01-28 09:03:03 -05:00
parent 699290de04
commit a16ffaf811

View File

@ -629,6 +629,12 @@
MBEDTLS_ECDSA_C requires MBEDTLS_PK_WRITE_C to be defined." MBEDTLS_ECDSA_C requires MBEDTLS_PK_WRITE_C to be defined."
#endif #endif
#if defined(MBEDTLS_RSA_C) && defined(MBEDTLS_PKCS1_V15) && \
!defined(MBEDTLS_PK_WRITE_C) && defined(MBEDTLS_PSA_CRYPTO_C)
#error "MBEDTLS_PSA_CRYPTO_C, MBEDTLS_RSA_C and MBEDTLS_PKCS1_V15 defined, \
but not all prerequisites"
#endif
#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ #if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \
!defined(MBEDTLS_OID_C) ) !defined(MBEDTLS_OID_C) )
#error "MBEDTLS_RSA_C defined, but not all prerequisites" #error "MBEDTLS_RSA_C defined, but not all prerequisites"