From 657ff4fd09d51d6ab48b1ee2e5dfe143c2ccb8a4 Mon Sep 17 00:00:00 2001 From: Mircea Udrea Date: Mon, 31 Jan 2022 13:51:56 +0100 Subject: [PATCH] Fix AEAD multipart incorrect offset in test_suite_psa_crypto.function When working with block cipher modes like GCM(PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER), aead_multipart_internal_func() should calculate the offset in output buffer based on output_length, not using the offset of the input buffer(part_offset). Signed-off-by: Mircea Udrea --- tests/suites/test_suite_psa_crypto.function | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index 8a08b1c520..a66ad7587f 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -506,7 +506,7 @@ static int aead_multipart_internal_func( int key_type_arg, data_t *key_data, if( output_data && output_part_length ) { - memcpy( ( output_data + part_offset ), part_data, + memcpy( ( output_data + output_length ), part_data, output_part_length ); }