From 31e99bb0c751da69a2190b0babb02ce707be67d3 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 9 Dec 2022 14:35:10 +0100 Subject: [PATCH] test: pake: fix: destroy key only in opaque case Signed-off-by: Valerio Setti --- tests/suites/test_suite_ssl.function | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index 22620411f..7163d226c 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -6264,7 +6264,10 @@ void ssl_ecjpake_set_password( int use_opaque_arg ) ECJPAKE_TEST_SET_PASSWORD( 0 ); #if defined( MBEDTLS_USE_PSA_CRYPTO ) - psa_destroy_key( pwd_slot ); + if( use_opaque_arg ) + { + psa_destroy_key( pwd_slot ); + } #endif /* MBEDTLS_USE_PSA_CRYPTO */ mbedtls_ssl_free( &ssl ); mbedtls_ssl_config_free( &conf );