From e65a41f2784b7fa0e85480d2a58961c1166abd2f Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 21 Nov 2022 15:38:29 +0100 Subject: [PATCH] test: psa_pake: fixes in ecjpake_setup() Both changes concern the ERR_INJECT_UNINITIALIZED_ACCESS case: - removed unnecessary psa_pake_abort() - added psa_pake_get_implicit_key() Signed-off-by: Valerio Setti --- tests/suites/test_suite_psa_crypto_pake.function | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/suites/test_suite_psa_crypto_pake.function b/tests/suites/test_suite_psa_crypto_pake.function index 52c7a7ab0..845b38f70 100644 --- a/tests/suites/test_suite_psa_crypto_pake.function +++ b/tests/suites/test_suite_psa_crypto_pake.function @@ -687,6 +687,7 @@ void ecjpake_setup( int alg_arg, int key_type_pw_arg, int key_usage_pw_arg, unsigned char *output_buffer = NULL; size_t output_len = 0; const uint8_t unsupp_id[] = "abcd"; + psa_key_derivation_operation_t key_derivation; PSA_INIT( ); @@ -713,23 +714,20 @@ void ecjpake_setup( int alg_arg, int key_type_pw_arg, int key_usage_pw_arg, { TEST_EQUAL( psa_pake_set_user( &operation, NULL, 0 ), expected_error ); - PSA_ASSERT( psa_pake_abort( &operation ) ); TEST_EQUAL( psa_pake_set_peer( &operation, NULL, 0 ), expected_error ); - PSA_ASSERT( psa_pake_abort( &operation ) ); TEST_EQUAL( psa_pake_set_password_key( &operation, key ), expected_error ); - PSA_ASSERT( psa_pake_abort( &operation ) ); TEST_EQUAL( psa_pake_set_role( &operation, role ), expected_error ); - PSA_ASSERT( psa_pake_abort( &operation ) ); TEST_EQUAL( psa_pake_output( &operation, PSA_PAKE_STEP_KEY_SHARE, NULL, 0, NULL ), expected_error ); - PSA_ASSERT( psa_pake_abort( &operation ) ); - TEST_EQUAL( psa_pake_input( &operation, PSA_PAKE_STEP_KEY_SHARE, NULL, 0), + TEST_EQUAL( psa_pake_input( &operation, PSA_PAKE_STEP_KEY_SHARE, + NULL, 0 ), + expected_error ); + TEST_EQUAL( psa_pake_get_implicit_key( &operation, &key_derivation ), expected_error ); - PSA_ASSERT( psa_pake_abort( &operation ) ); goto exit; }