Skip to content

Commit

Permalink
core: ltc: configure internal MD5
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
jenswi-linaro committed Oct 6, 2023
1 parent 2b0d0c5 commit f037308
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions core/crypto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ endif
# 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 \
Expand Down
2 changes: 1 addition & 1 deletion core/lib/libtomcrypt/rsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static TEE_Result tee_algo_to_ltc_hashindex(uint32_t algo, int *ltc_hashindex)
*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:
Expand Down
2 changes: 1 addition & 1 deletion core/lib/libtomcrypt/src/hashes/sub.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/lib/libtomcrypt/sub.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ endif

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)
Expand Down
2 changes: 1 addition & 1 deletion core/lib/libtomcrypt/tomcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static void tee_ltc_reg_algs(void)
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)
Expand Down

0 comments on commit f037308

Please sign in to comment.