aboutsummaryrefslogtreecommitdiff
path: root/drivers/auth
diff options
context:
space:
mode:
authorSoby Mathew <soby.mathew@arm.com>2017-08-31 11:49:32 +0100
committerSoby Mathew <soby.mathew@arm.com>2017-08-31 16:42:11 +0100
commit2091755c5e3b8d94333b9aad742e61db9d754cc5 (patch)
tree39cd6c5b43132df7574b75e077d6daa77dabeaed /drivers/auth
parentd818a02cb489eae1f99cabf949d47e56347e4537 (diff)
downloadtrusted-firmware-a-2091755c5e3b8d94333b9aad742e61db9d754cc5.tar.gz
Export KEY_ALG as a user build option
The `KEY_ALG` variable is used to select the algorithm for key generation by `cert_create` tool for signing the certificates. This variable was previously undocumented and did not have a global default value. This patch corrects this and also adds changes to derive the value of `TF_MBEDTLS_KEY_ALG` based on `KEY_ALG` if it not set by the platform. The corresponding assignment of these variables are also now removed from the `arm_common.mk` makefile. Signed-off-by: Soby Mathew <soby.mathew@arm.com> Change-Id: I78e2d6f4fc04ed5ad35ce2266118afb63127a5a4
Diffstat (limited to 'drivers/auth')
-rw-r--r--drivers/auth/mbedtls/mbedtls_crypto.mk10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/auth/mbedtls/mbedtls_crypto.mk b/drivers/auth/mbedtls/mbedtls_crypto.mk
index cb81d4d674..38197164c9 100644
--- a/drivers/auth/mbedtls/mbedtls_crypto.mk
+++ b/drivers/auth/mbedtls/mbedtls_crypto.mk
@@ -7,9 +7,15 @@
include drivers/auth/mbedtls/mbedtls_common.mk
# The platform may define the variable 'TF_MBEDTLS_KEY_ALG' to select the key
-# algorithm to use. Default algorithm is RSA.
+# algorithm to use. If the variable is not defined, select it based on algorithm
+# used for key generation `KEY_ALG`. If `KEY_ALG` is not defined or is
+# defined to `rsa`, then set the variable to `rsa`.
ifeq (${TF_MBEDTLS_KEY_ALG},)
- TF_MBEDTLS_KEY_ALG := rsa
+ ifeq (${KEY_ALG}, ecdsa)
+ TF_MBEDTLS_KEY_ALG := ecdsa
+ else
+ TF_MBEDTLS_KEY_ALG := rsa
+ endif
endif
# If MBEDTLS_KEY_ALG build flag is defined use it to set TF_MBEDTLS_KEY_ALG for