aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2020-02-19 15:17:56 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-02-19 15:17:56 +0000
commit6cec5702469ab971ce4803d595ccc319657c333a (patch)
treeee1112fe04a8250611e6e1f63cb0e3a01a4c4448
parent564074c28409fda50ac3c7353ffa8ec575653062 (diff)
parent0b4e59211bf78db96b9f6a87869f623ea2810ebc (diff)
downloadtrusted-firmware-a-6cec5702469ab971ce4803d595ccc319657c333a.tar.gz
Merge "TBBR: Reduce size of hash buffers when possible" into integration
-rw-r--r--drivers/auth/tbbr/tbbr_cot.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/auth/tbbr/tbbr_cot.c b/drivers/auth/tbbr/tbbr_cot.c
index 2f1f451b1..6f00b180c 100644
--- a/drivers/auth/tbbr/tbbr_cot.c
+++ b/drivers/auth/tbbr/tbbr_cot.c
@@ -41,7 +41,15 @@
#define PK_DER_LEN 91
#endif
+#if TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA256
+#define HASH_DER_LEN 51
+#elif TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA384
+#define HASH_DER_LEN 67
+#elif TF_MBEDTLS_HASH_ALG_ID == TF_MBEDTLS_SHA512
#define HASH_DER_LEN 83
+#else
+#error "Invalid value for TF_MBEDTLS_HASH_ALG_ID"
+#endif
/*
* The platform must allocate buffers to store the authentication parameters