Map INVALID_PADDING from PSA to MbedTLS error in rsa_verify_wrap()
@@ -214,8 +214,15 @@ static int rsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
status = psa_verify_hash( key_id, psa_alg_md, hash, hash_len,
sig, sig_len );
if( status != PSA_SUCCESS )
+ {
+ if ( status == PSA_ERROR_INVALID_PADDING )
+ {
+ ret = MBEDTLS_ERR_RSA_INVALID_PADDING;
+ }
+ else
{
ret = mbedtls_psa_err_translate_pk( status );
+ }
goto cleanup;
}
ret = 0;
