Use new PSA to mbedtls PK error mapping functions in pk_wrap.c

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
Neil Armstrong 2022-03-03 16:37:33 +01:00
parent c921bfdf30
commit 3770e2483f

View file

@ -282,7 +282,7 @@ static int rsa_encrypt_wrap( void *ctx,
&key_id );
if( status != PSA_SUCCESS )
{
ret = mbedtls_psa_err_translate_pk( status );
ret = mbedtls_pk_error_from_psa( status );
goto cleanup;
}
@ -290,7 +290,7 @@ static int rsa_encrypt_wrap( void *ctx,
NULL, 0, output, osize, olen);
if( status != PSA_SUCCESS )
{
ret = mbedtls_psa_err_translate_pk( status );
ret = mbedtls_pk_error_from_psa_rsa( status );
goto cleanup;
}
@ -299,7 +299,7 @@ static int rsa_encrypt_wrap( void *ctx,
cleanup:
status = psa_destroy_key( key_id );
if( ret == 0 && status != PSA_SUCCESS )
ret = mbedtls_psa_err_translate_pk( status );
ret = mbedtls_pk_error_from_psa( status );
return( ret );
}
@ -797,7 +797,7 @@ static int ecdsa_verify_wrap( void *ctx_arg, mbedtls_md_type_t md_alg,
cleanup:
status = psa_destroy_key( key_id );
if( ret == 0 && status != PSA_SUCCESS )
ret = mbedtls_psa_err_translate_pk( status );
ret = mbedtls_pk_error_from_psa( status );
return( ret );
}