From a006b8f6c1b73a0fc524d5562a90348cc7f4f012 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 16 Aug 2024 13:32:58 +0200 Subject: [PATCH] check_config: prevent fully dynamic and static key stores to be enabled simultaneously Signed-off-by: Valerio Setti --- include/mbedtls/check_config.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 20b0ed610e..a710208505 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -694,6 +694,11 @@ #error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG" #endif +#if defined(MBEDTLS_PSA_KEY_STORE_DYNAMIC) && \ + defined(MBEDTLS_PSA_STATIC_KEY_SLOTS) +#error "MBEDTLS_PSA_KEY_STORE_DYNAMIC and MBEDTLS_PSA_STATIC_KEY_SLOTS cannot be defined simultaneously" +#endif + #if defined(MBEDTLS_PSA_ITS_FILE_C) && \ !defined(MBEDTLS_FS_IO) #error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites"