aboutsummaryrefslogtreecommitdiff
path: root/drivers/auth/tbbr/tbbr_cot.c
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2019-09-13 12:00:59 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2019-09-13 12:00:59 +0000
commitc428fbaeab3191a5b7fda38fc2aa8da3d716ab97 (patch)
treed45974a3798396c1e0c56ccc9287ed0c3b625cab /drivers/auth/tbbr/tbbr_cot.c
parent76eac18647f3bb81e029309ea61f8c4c5336ca27 (diff)
parent6a415a508ea6acec321e4609d3f8e5c03ba67664 (diff)
downloadtrusted-firmware-a-c428fbaeab3191a5b7fda38fc2aa8da3d716ab97.tar.gz
Merge changes from topic "jc/rsa-pkcs" into integration
* changes: Remove RSA PKCS#1 v1.5 support from cert_tool Add documentation for new KEY_SIZE option Add cert_create tool support for RSA key sizes Support larger RSA key sizes when using MBEDTLS
Diffstat (limited to 'drivers/auth/tbbr/tbbr_cot.c')
-rw-r--r--drivers/auth/tbbr/tbbr_cot.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/auth/tbbr/tbbr_cot.c b/drivers/auth/tbbr/tbbr_cot.c
index da3631bbf..6dd4ae252 100644
--- a/drivers/auth/tbbr/tbbr_cot.c
+++ b/drivers/auth/tbbr/tbbr_cot.c
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <platform_def.h>
+#include <drivers/auth/mbedtls/mbedtls_config.h>
#include <drivers/auth/auth_mod.h>
#if USE_TBBR_DEFS
@@ -19,7 +20,22 @@
/*
* Maximum key and hash sizes (in DER format)
*/
+#if TF_MBEDTLS_USE_RSA
+#if TF_MBEDTLS_KEY_SIZE == 1024
+#define PK_DER_LEN 162
+#elif TF_MBEDTLS_KEY_SIZE == 2048
#define PK_DER_LEN 294
+#elif TF_MBEDTLS_KEY_SIZE == 3072
+#define PK_DER_LEN 422
+#elif TF_MBEDTLS_KEY_SIZE == 4096
+#define PK_DER_LEN 550
+#else
+#error "Invalid value for TF_MBEDTLS_KEY_SIZE"
+#endif
+#else
+#define PK_DER_LEN 294
+#endif
+
#define HASH_DER_LEN 83
/*