From 7f5a31915b6e80731cbd4504746fcd925a5aab63 Mon Sep 17 00:00:00 2001 From: Nir Sonnenschein Date: Sun, 6 May 2018 22:26:54 +0300 Subject: [PATCH] code fixes for internal code review: 1. change to correct error code 2. removed unneeded comment --- library/psa_crypto.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index a18abcd95..e24638a3a 100755 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1367,7 +1367,7 @@ psa_status_t psa_asymmetric_verify(psa_key_slot_t key, (void) salt_length; if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT ) - return( PSA_ERROR_EMPTY_SLOT ); + return( PSA_ERROR_INVALID_ARGUMENT ); slot = &global_data.key_slots[key]; if( slot->type == PSA_KEY_TYPE_NONE ) return( PSA_ERROR_EMPTY_SLOT ); @@ -1460,14 +1460,13 @@ psa_status_t psa_asymmetric_encrypt(psa_key_slot_t key, (void) salt_length; if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT ) - return( PSA_ERROR_EMPTY_SLOT ); + return( PSA_ERROR_INVALID_ARGUMENT ); slot = &global_data.key_slots[key]; if( slot->type == PSA_KEY_TYPE_NONE ) return( PSA_ERROR_EMPTY_SLOT ); if( ! PSA_KEY_TYPE_IS_KEYPAIR( slot->type ) ) return( PSA_ERROR_INVALID_ARGUMENT ); - // check output size? #if defined(MBEDTLS_RSA_C) if( slot->type == PSA_KEY_TYPE_RSA_KEYPAIR )