From fca651a285aa0676383e7a51dc8896fabc8e1f5d Mon Sep 17 00:00:00 2001 From: Amey Avinash Raghatate Date: Wed, 6 Nov 2024 15:18:07 +0530 Subject: [PATCH] xtest: regression 4002: add conditional statement to check for SM3 algorithm Add a conditional statement to check for the SM3 algorithm test case. Test cases related to the SM3 algorithm should not execute, as the SM3 algorithm is disabled on the platform side. Signed-off-by: Amey Avinash Raghatate Signed-off-by: Akshay Belsare Reviewed-by: Jens Wiklander --- host/xtest/regression_4000.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/host/xtest/regression_4000.c b/host/xtest/regression_4000.c index 3aa15be2b..2651fe314 100644 --- a/host/xtest/regression_4000.c +++ b/host/xtest/regression_4000.c @@ -1686,6 +1686,14 @@ static void xtest_tee_test_4002(ADBG_Case_t *c) size_t key_size = 0; size_t offs = 0; + if (mac_cases[n].algo == TEE_ALG_HMAC_SM3 && + !ta_crypt_cmd_is_algo_supported(c, &session, + TEE_ALG_HMAC_SM3, + TEE_CRYPTO_ELEMENT_NONE)) { + Do_ADBG_Log("SM3 not supported: skip subcase"); + continue; + } + Do_ADBG_BeginSubCase(c, "MAC case %d algo 0x%x", (int)n, (unsigned int)mac_cases[n].algo);