Map INVALID_PADDING from PSA to MbedTLS error in rsa_decrypt_wrap()
@@ -275,8 +275,15 @@ static int rsa_decrypt_wrap( void *ctx,
status = psa_asymmetric_decrypt( key_id, psa_sig_md, input, ilen,
NULL, 0, output, osize, olen );
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;
}
