From 3d5ed793e7c6ddcd54e4ca114cf99ae9b7b24c8c Mon Sep 17 00:00:00 2001 From: Waleed Elmelegy Date: Wed, 20 Nov 2024 11:55:18 +0000 Subject: [PATCH] Add PSA internal iop export public-key abort function Signed-off-by: Waleed Elmelegy --- tf-psa-crypto/core/psa_crypto.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tf-psa-crypto/core/psa_crypto.c b/tf-psa-crypto/core/psa_crypto.c index 4fb6ab5097..9fd908dce2 100644 --- a/tf-psa-crypto/core/psa_crypto.c +++ b/tf-psa-crypto/core/psa_crypto.c @@ -1665,6 +1665,23 @@ exit: /* Interruptible ECC Export Public-key */ /****************************************************************/ +#if defined(MBEDTLS_ECP_RESTARTABLE) +static psa_status_t psa_export_public_key_iop_abort_internal(psa_export_public_key_iop_t *operation) +{ + psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED; + + if (operation->id == 0) { + return PSA_SUCCESS; + } + + status = mbedtls_psa_ecp_export_public_key_iop_abort(&operation->ctx); + + operation->id = 0; + + return status; +} +#endif + uint32_t psa_export_public_key_iop_get_num_ops(psa_export_public_key_iop_t *operation) { (void) operation;