core: ltc: configure internal MD5
Adds _CFG_CORE_LTC_MD5_DESC to allow enabling support for MD5 224
internally in LTC.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Acked-By: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a, mbedtls)
diff --git a/core/crypto.mk b/core/crypto.mk
index 368f1f8..ac651ee 100644
--- a/core/crypto.mk
+++ b/core/crypto.mk
@@ -251,6 +251,8 @@
# libtomcrypt (LTC) specifics, phase #2
###############################################################
+_CFG_CORE_LTC_MD5_DESC := $(call cfg-one-enabled, _CFG_CORE_LTC_MD5_DESC \
+ _CFG_CORE_LTC_MD5)
_CFG_CORE_LTC_SHA1_DESC := $(call cfg-one-enabled, _CFG_CORE_LTC_SHA1_DESC \
_CFG_CORE_LTC_SHA1)
_CFG_CORE_LTC_SHA224_DESC := $(call cfg-one-enabled, _CFG_CORE_LTC_SHA224_DESC \
diff --git a/core/lib/libtomcrypt/rsa.c b/core/lib/libtomcrypt/rsa.c
index 4a2b1d8..f63bfe9 100644
--- a/core/lib/libtomcrypt/rsa.c
+++ b/core/lib/libtomcrypt/rsa.c
@@ -36,7 +36,7 @@
*ltc_hashindex = find_hash("sha1");
break;
#endif
-#if defined(_CFG_CORE_LTC_MD5)
+#if defined(_CFG_CORE_LTC_MD5_DESC)
case TEE_ALG_RSASSA_PKCS1_V1_5_MD5:
case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_MD5:
case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_MD5:
diff --git a/core/lib/libtomcrypt/src/hashes/sub.mk b/core/lib/libtomcrypt/src/hashes/sub.mk
index d58f920..6a35fe2 100644
--- a/core/lib/libtomcrypt/src/hashes/sub.mk
+++ b/core/lib/libtomcrypt/src/hashes/sub.mk
@@ -1,4 +1,4 @@
-srcs-$(_CFG_CORE_LTC_MD5) += md5.c
+srcs-$(_CFG_CORE_LTC_MD5_DESC) += md5.c
ifeq ($(_CFG_CORE_LTC_SHA1_DESC),y)
ifneq ($(_CFG_CORE_LTC_SHA1_ACCEL),y)
diff --git a/core/lib/libtomcrypt/sub.mk b/core/lib/libtomcrypt/sub.mk
index 08cb085..de11ccc 100644
--- a/core/lib/libtomcrypt/sub.mk
+++ b/core/lib/libtomcrypt/sub.mk
@@ -36,7 +36,7 @@
cppflags-lib-y += -DLTC_NO_HASHES
-ifeq ($(_CFG_CORE_LTC_MD5),y)
+ifeq ($(_CFG_CORE_LTC_MD5_DESC),y)
cppflags-lib-y += -DLTC_MD5
endif
ifeq ($(_CFG_CORE_LTC_SHA1_DESC),y)
diff --git a/core/lib/libtomcrypt/tomcrypt.c b/core/lib/libtomcrypt/tomcrypt.c
index a7b58a3..cdff8f3 100644
--- a/core/lib/libtomcrypt/tomcrypt.c
+++ b/core/lib/libtomcrypt/tomcrypt.c
@@ -99,7 +99,7 @@
register_cipher(&des_desc);
register_cipher(&des3_desc);
#endif
-#if defined(_CFG_CORE_LTC_MD5)
+#if defined(_CFG_CORE_LTC_MD5_DESC)
register_hash(&md5_desc);
#endif
#if defined(_CFG_CORE_LTC_SHA1) || defined(_CFG_CORE_LTC_SHA1_DESC)