From 64f13ef6ab5f642f597ff45252cfc008e2d51673 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 25 Aug 2020 23:15:20 +0200 Subject: [PATCH] Add missing cleanup to some multipart operation tests Signed-off-by: Gilles Peskine --- tests/suites/test_suite_psa_crypto.function | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/suites/test_suite_psa_crypto.function b/tests/suites/test_suite_psa_crypto.function index f4b9a8f67..635114137 100644 --- a/tests/suites/test_suite_psa_crypto.function +++ b/tests/suites/test_suite_psa_crypto.function @@ -3066,6 +3066,7 @@ void mac_sign( int key_type_arg, sizeof( actual_mac ) - mac_length ) ); exit: + psa_mac_abort( &operation ); psa_destroy_key( handle ); PSA_DONE( ); } @@ -3104,6 +3105,7 @@ void mac_verify( int key_type_arg, expected_mac->len ) ); exit: + psa_mac_abort( &operation ); psa_destroy_key( handle ); PSA_DONE( ); } @@ -3183,6 +3185,7 @@ void cipher_setup( int key_type_arg, #endif exit: + psa_cipher_abort( &operation ); PSA_DONE( ); } /* END_CASE */ @@ -3335,6 +3338,7 @@ void cipher_bad_order( ) PSA_ASSERT( psa_destroy_key( handle ) ); exit: + psa_cipher_abort( &operation ); PSA_DONE( ); } /* END_CASE */ @@ -3393,6 +3397,7 @@ void cipher_encrypt( int alg_arg, int key_type_arg, } exit: + psa_cipher_abort( &operation ); mbedtls_free( output ); psa_destroy_key( handle ); PSA_DONE( ); @@ -3461,6 +3466,7 @@ void cipher_encrypt_multipart( int alg_arg, int key_type_arg, output, total_output_length ); exit: + psa_cipher_abort( &operation ); mbedtls_free( output ); psa_destroy_key( handle ); PSA_DONE( ); @@ -3532,6 +3538,7 @@ void cipher_decrypt_multipart( int alg_arg, int key_type_arg, output, total_output_length ); exit: + psa_cipher_abort( &operation ); mbedtls_free( output ); psa_destroy_key( handle ); PSA_DONE( ); @@ -3593,6 +3600,7 @@ void cipher_decrypt( int alg_arg, int key_type_arg, } exit: + psa_cipher_abort( &operation ); mbedtls_free( output ); psa_destroy_key( handle ); PSA_DONE( ); @@ -3674,6 +3682,8 @@ void cipher_verify_output( int alg_arg, int key_type_arg, ASSERT_COMPARE( input->x, input->len, output2, output2_length ); exit: + psa_cipher_abort( &operation1 ); + psa_cipher_abort( &operation2 ); mbedtls_free( output1 ); mbedtls_free( output2 ); psa_destroy_key( handle ); @@ -3777,6 +3787,8 @@ void cipher_verify_output_multipart( int alg_arg, ASSERT_COMPARE( input->x, input->len, output2, output2_length ); exit: + psa_cipher_abort( &operation1 ); + psa_cipher_abort( &operation2 ); mbedtls_free( output1 ); mbedtls_free( output2 ); psa_destroy_key( handle );