From 6614d3d3d479348904562694d27f3f9b87cfbfe3 Mon Sep 17 00:00:00 2001 From: Harish Jenny K N Date: Tue, 15 Feb 2022 19:24:08 +0530 Subject: [PATCH] crypto_test: Add test cases for PSS sign and verify Added test cases for PSS sign and verify Signed-off-by: Harish Jenny K N Change-Id: I8051d933776ecc5eb4db249e13c9de211ffdb474 --- internal_api/crypto_test.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal_api/crypto_test.c b/internal_api/crypto_test.c index 9984b27..3ceadac 100644 --- a/internal_api/crypto_test.c +++ b/internal_api/crypto_test.c @@ -1363,12 +1363,11 @@ static uint32_t run_ecdsa_tests() return 0; } -static uint32_t RSA_sig_and_ver() +static uint32_t RSA_sig_and_ver_algos(uint32_t rsa_alg) { TEE_Result ret; TEE_ObjectHandle rsa_keypair = (TEE_ObjectHandle)NULL; size_t key_size = 512; - uint32_t rsa_alg = TEE_ALG_RSASSA_PKCS1_V1_5_SHA1; char *dig_msg = "TEST"; uint32_t fn_ret = 1; /* Initialized error return */ @@ -1419,6 +1418,17 @@ static uint32_t RSA_sig_and_ver() return fn_ret; } +static uint32_t RSA_sig_and_ver() +{ + // run the tests for all the algorithms + if (RSA_sig_and_ver_algos(TEE_ALG_RSASSA_PKCS1_V1_5_SHA1) || + RSA_sig_and_ver_algos(TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1)) + return 1; + + PRI_OK("-"); + return 0; +} + static uint32_t HMAC_computation_basic() { TEE_Result ret;