summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManish V Badarkhe <Manish.Badarkhe@arm.com>2023-10-26 11:06:23 +0100
committerManish V Badarkhe <Manish.Badarkhe@arm.com>2023-10-26 11:29:51 +0100
commit2ea42fec358a502bec0a0e24ee12e3e0352af32c (patch)
treef536f46f358c364d9a53e09c8e6c5ef0bc52cf02
parent0e1dc0f2bc2b0ee9bef9aabbdd52dd42fe4d41b4 (diff)
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>
-rw-r--r--include/common/tbbr/cot_def.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/common/tbbr/cot_def.h b/include/common/tbbr/cot_def.h
index 1d28772c9..0e007c58f 100644
--- a/include/common/tbbr/cot_def.h
+++ b/include/common/tbbr/cot_def.h
@@ -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