From 415d1bc99c88f7e5a8bc96d2687714e8fffae690 Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Wed, 2 Oct 2024 13:20:14 +0100 Subject: [PATCH] Fix issues with new GCM overlap buffer test cases This commit code style and initialisation issues with the new buffer overlap test cases for GCM. Signed-off-by: Harry Ramsey --- .../tests/suites/test_suite_gcm.function | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tf-psa-crypto/tests/suites/test_suite_gcm.function b/tf-psa-crypto/tests/suites/test_suite_gcm.function index 5cc692ec61..2dcf366c94 100644 --- a/tf-psa-crypto/tests/suites/test_suite_gcm.function +++ b/tf-psa-crypto/tests/suites/test_suite_gcm.function @@ -607,12 +607,12 @@ exit: /* BEGIN_CASE */ void gcm_encrypt_input_output_buffer_overlap(int cipher_id, data_t *key_str, - data_t *src_str, data_t *iv_str, - data_t *add_str, data_t *dst, - int tag_len_bits, data_t *tag, - int init_result) + data_t *src_str, data_t *iv_str, + data_t *add_str, data_t *dst, + int tag_len_bits, data_t *tag, + int init_result) { - unsigned char *buffer; + unsigned char *buffer = NULL; size_t buffer_len; unsigned char tag_output[16]; mbedtls_gcm_context ctx; @@ -672,12 +672,12 @@ exit: /* BEGIN_CASE */ void gcm_decrypt_input_output_buffer_overlap(int cipher_id, data_t *key_str, - data_t *src_str, data_t *iv_str, - data_t *add_str, int tag_len_bits, - data_t *tag_str, char *result, - data_t *pt_result, int init_result) + data_t *src_str, data_t *iv_str, + data_t *add_str, int tag_len_bits, + data_t *tag_str, char *result, + data_t *pt_result, int init_result) { - unsigned char *buffer; + unsigned char *buffer = NULL; size_t buffer_len; mbedtls_gcm_context ctx; int ret;