From 8281d645aad6aa3a01dbf080e7794337f88947e9 Mon Sep 17 00:00:00 2001 From: Jens Wiklander Date: Mon, 22 Apr 2024 18:23:45 +0200 Subject: [PATCH] xtest: return out-buffer sizes unconditionally In ta_crypt_cmd_cipher_update(), ta_crypt_cmd_cipher_do_final(), ta_crypt_cmd_ae_update(), ta_crypt_cmd_ae_encrypt_final(), and ta_crypt_cmd_ae_decrypt_final(), always return out-buffer sizes even if the function doesn't return TEEC_SUCCESS. Signed-off-by: Jens Wiklander Reviewed-by: Etienne Carriere --- host/xtest/regression_4000.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/host/xtest/regression_4000.c b/host/xtest/regression_4000.c index 0d23e487f..4a0d45e16 100644 --- a/host/xtest/regression_4000.c +++ b/host/xtest/regression_4000.c @@ -398,8 +398,7 @@ static TEEC_Result ta_crypt_cmd_cipher_update(ADBG_Case_t *c, TEEC_Session *s, ret_orig); } - if (res == TEEC_SUCCESS) - *dst_len = op.params[2].tmpref.size; + *dst_len = op.params[2].tmpref.size; return res; } @@ -437,8 +436,7 @@ static TEEC_Result ta_crypt_cmd_cipher_do_final(ADBG_Case_t *c, ret_orig); } - if (res == TEEC_SUCCESS) - *dst_len = op.params[2].tmpref.size; + *dst_len = op.params[2].tmpref.size; return res; } @@ -564,8 +562,7 @@ static TEEC_Result ta_crypt_cmd_ae_update(ADBG_Case_t *c, ret_orig); } - if (res == TEEC_SUCCESS) - *dst_len = op.params[2].tmpref.size; + *dst_len = op.params[2].tmpref.size; return res; } @@ -607,10 +604,8 @@ static TEEC_Result ta_crypt_cmd_ae_encrypt_final(ADBG_Case_t *c, ret_orig); } - if (res == TEEC_SUCCESS) { - *dst_len = op.params[2].tmpref.size; - *tag_len = op.params[3].tmpref.size; - } + *dst_len = op.params[2].tmpref.size; + *tag_len = op.params[3].tmpref.size; return res; } @@ -651,8 +646,7 @@ static TEEC_Result ta_crypt_cmd_ae_decrypt_final(ADBG_Case_t *c, ret_orig); } - if (res == TEEC_SUCCESS) - *dst_len = op.params[2].tmpref.size; + *dst_len = op.params[2].tmpref.size; return res; }