From 1f186ff330de59140e9afae322b9284f89db6783 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 2 Feb 2021 21:04:06 +0100 Subject: [PATCH] Add missing calls to USE_PSA_DONE Some functions were not deinitializing the PSA subsystem. This could lead to resource leaks at the level of individual test cases, and possibly at the level of the whole test suite depending on the order and selection of test cases. Signed-off-by: Gilles Peskine --- tests/suites/test_suite_ssl.function | 1 + tests/suites/test_suite_x509parse.function | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index 93cf50ca0..b1ebf5b97 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -3850,6 +3850,7 @@ void ssl_tls_prf( int type, data_t * secret, data_t * random, exit: mbedtls_free( output ); + USE_PSA_DONE( ); } /* END_CASE */ diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index b09c55460..66f03768b 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -667,6 +667,7 @@ exit: mbedtls_x509_crt_free( &crt ); mbedtls_x509_crt_free( &ca ); mbedtls_x509_crl_free( &crl ); + USE_PSA_DONE( ); } /* END_CASE */ @@ -733,6 +734,7 @@ void x509_verify_callback( char *crt_file, char *ca_file, char *name, exit: mbedtls_x509_crt_free( &crt ); mbedtls_x509_crt_free( &ca ); + USE_PSA_DONE( ); } /* END_CASE */ @@ -1049,6 +1051,7 @@ void mbedtls_x509_crt_verify_max( char *ca_file, char *chain_dir, int nb_int, exit: mbedtls_x509_crt_free( &chain ); mbedtls_x509_crt_free( &trusted ); + USE_PSA_DONE( ); } /* END_CASE */ @@ -1092,6 +1095,7 @@ void mbedtls_x509_crt_verify_chain( char *chain_paths, char *trusted_ca, exit: mbedtls_x509_crt_free( &trusted ); mbedtls_x509_crt_free( &chain ); + USE_PSA_DONE( ); } /* END_CASE */