refactor(tbbr): enforce compile-time error for invalid algorithm selection

Enforced compile-time error on invalid algorithm selection.

Change-Id: I517aa11c9fa9fda49483f95587f43529085c9d5d
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
This commit is contained in:
Manish V Badarkhe 2023-10-26 11:06:23 +01:00
parent 0e1dc0f2bc
commit 2ea42fec35

View file

@ -45,7 +45,7 @@
#else
#error "Invalid value for TF_MBEDTLS_KEY_SIZE"
#endif
#else /* Only using ECDSA keys. */
#elif TF_MBEDTLS_USE_ECDSA
#if TF_MBEDTLS_KEY_SIZE == 384
#define PK_DER_LEN 120
#elif TF_MBEDTLS_KEY_SIZE == 256
@ -53,7 +53,9 @@
#else
#error "Invalid value for TF_MBEDTLS_KEY_SIZE"
#endif
#endif
#else
#error "Invalid value of algorithm"
#endif /* TF_MBEDTLS_USE_RSA */
#if TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA256
#define HASH_DER_LEN 51