mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-08 17:42:09 +03:00
Merge pull request #199 from jainvikas8/dev/jainvikas8/fix-return-code
Return right error code in psa_asymmetric_encrypt
This commit is contained in:
@@ -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 )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user