From 54ba963575b0c0d34bf6507c52d09929f3bd8df7 Mon Sep 17 00:00:00 2001 From: Waleed Elmelegy Date: Tue, 3 Dec 2024 14:17:25 +0000 Subject: [PATCH] Add interuptible export public-key testing to invalid key tests Signed-off-by: Waleed Elmelegy --- tf-psa-crypto/tests/suites/test_suite_psa_crypto.function | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tf-psa-crypto/tests/suites/test_suite_psa_crypto.function b/tf-psa-crypto/tests/suites/test_suite_psa_crypto.function index 00b935be54..c72511b2f9 100644 --- a/tf-psa-crypto/tests/suites/test_suite_psa_crypto.function +++ b/tf-psa-crypto/tests/suites/test_suite_psa_crypto.function @@ -222,6 +222,9 @@ static int test_operations_on_invalid_key(mbedtls_svc_key_id_t key) { psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; mbedtls_svc_key_id_t key_id = mbedtls_svc_key_id_make(1, 0x6964); +#if defined(MBEDTLS_ECP_RESTARTABLE) + psa_export_public_key_iop_t export_key_iop = PSA_EXPORT_PUBLIC_KEY_IOP_INIT; +#endif uint8_t buffer[1]; size_t length; int ok = 0; @@ -248,6 +251,11 @@ static int test_operations_on_invalid_key(mbedtls_svc_key_id_t key) buffer, sizeof(buffer), &length), PSA_ERROR_INVALID_HANDLE); +#if defined(MBEDTLS_ECP_RESTARTABLE) + TEST_EQUAL(psa_export_public_key_iop_setup(&export_key_iop, key), + PSA_ERROR_INVALID_HANDLE); +#endif + ok = 1; exit: