code fixes for internal code review:
1. change to correct error code
2. removed unneeded comment
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index a18abcd..e24638a 100755
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -1367,7 +1367,7 @@
(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 @@
(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 )