diff --git a/library/pk_wrap.c b/library/pk_wrap.c index 2d1c238eec..66a62f82f6 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -283,7 +283,10 @@ static int rsa_decrypt_wrap( void *ctx, ret = 0; cleanup: - psa_destroy_key( key_id ); + status = psa_destroy_key( key_id ); + if( ret == 0 && status != PSA_SUCCESS ) + ret = mbedtls_psa_err_translate_pk( status ); + return( ret ); } #else