From dc256d093410db00a6d4ba1022ed5a2ba77a5535 Mon Sep 17 00:00:00 2001 From: Paul Elliott Date: Thu, 12 Dec 2024 11:53:34 +0000 Subject: [PATCH] Add test for incorrect key type in iop agreement Signed-off-by: Paul Elliott --- tests/src/psa_exercise_key.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/psa_exercise_key.c b/tests/src/psa_exercise_key.c index 3b287867e..b92c1f750 100644 --- a/tests/src/psa_exercise_key.c +++ b/tests/src/psa_exercise_key.c @@ -811,6 +811,11 @@ psa_status_t mbedtls_test_psa_raw_key_agreement_with_self( PSA_ASSERT(status); } + } else { + TEST_EQUAL(psa_key_agreement_iop_setup(&iop_operation, key, public_key, + public_key_length, alg, + &shared_secret_attributes), + PSA_ERROR_INVALID_ARGUMENT); } #endif // defined(MBEDTLS_ECP_RESTARTABLE) && defined(MBEDTLS_PSA_BUILTIN_ALG_ECDH)