Return right error code.

Issue : 126
https://github.com/ARMmbed/mbed-crypto/issues/126

PSA_ERROR_BUFFER_TOO_SMALL error returned when we check for output_size.
This commit is contained in:
Vikas Katariya 2019-08-02 12:26:29 +01:00
parent fe93bc4ed4
commit 21599b6622

View File

@ -2755,7 +2755,7 @@ psa_status_t psa_asymmetric_encrypt( psa_key_handle_t handle,
mbedtls_rsa_context *rsa = slot->data.rsa; mbedtls_rsa_context *rsa = slot->data.rsa;
int ret; int ret;
if( output_size < mbedtls_rsa_get_len( rsa ) ) if( output_size < mbedtls_rsa_get_len( rsa ) )
return( PSA_ERROR_INVALID_ARGUMENT ); return( PSA_ERROR_BUFFER_TOO_SMALL );
#if defined(MBEDTLS_PKCS1_V15) #if defined(MBEDTLS_PKCS1_V15)
if( alg == PSA_ALG_RSA_PKCS1V15_CRYPT ) if( alg == PSA_ALG_RSA_PKCS1V15_CRYPT )
{ {