diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 4384a4310..61f0ad4a4 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -1870,7 +1870,7 @@ static psa_status_t psa_validate_key_attributes( } else { - status = psa_validate_key_id( psa_get_key_id( attributes ), 0, 0 ); + status = psa_validate_key_id( psa_get_key_id( attributes ), 0 ); if( status != PSA_SUCCESS ) return( status ); } diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c index 9075beb4e..d8a3ca8ec 100644 --- a/library/psa_crypto_slot_management.c +++ b/library/psa_crypto_slot_management.c @@ -52,7 +52,7 @@ typedef struct static psa_global_data_t global_data; psa_status_t psa_validate_key_id( - mbedtls_svc_key_id_t key, int vendor_ok, int volatile_ok ) + mbedtls_svc_key_id_t key, int vendor_ok ) { psa_key_id_t key_id = MBEDTLS_SVC_KEY_ID_GET_KEY_ID( key ); @@ -62,12 +62,7 @@ psa_status_t psa_validate_key_id( if( vendor_ok && ( PSA_KEY_ID_VENDOR_MIN <= key_id ) && - ( key_id < PSA_KEY_ID_VOLATILE_MIN ) ) - return( PSA_SUCCESS ); - - if( volatile_ok && - ( PSA_KEY_ID_VOLATILE_MIN <= key_id ) && - ( key_id <= PSA_KEY_ID_VOLATILE_MAX ) ) + ( key_id <= PSA_KEY_ID_VENDOR_MAX ) ) return( PSA_SUCCESS ); return( PSA_ERROR_INVALID_HANDLE ); @@ -122,7 +117,7 @@ static psa_status_t psa_search_key_in_slots( } else { - status = psa_validate_key_id( key, 1, 1 ); + status = psa_validate_key_id( key, 1 ); if( status != PSA_SUCCESS ) return( status ); diff --git a/library/psa_crypto_slot_management.h b/library/psa_crypto_slot_management.h index 8d3c3840a..75ce0ac6c 100644 --- a/library/psa_crypto_slot_management.h +++ b/library/psa_crypto_slot_management.h @@ -212,13 +212,10 @@ psa_status_t psa_validate_key_persistence( psa_key_lifetime_t lifetime ); * \param[in] vendor_ok Non-zero to indicate that key identifiers in the * vendor range are allowed, volatile key identifiers * excepted \c 0 otherwise. - * \param[in] volatile_ok Non-zero to indicate that volatile key identifiers - * are allowed \c 0 otherwise. * * \retval #PSA_SUCCESS The identifier is valid. * \retval #PSA_ERROR_INVALID_ARGUMENT The key identifier is not valid. */ -psa_status_t psa_validate_key_id( - mbedtls_svc_key_id_t key, int vendor_ok, int volatile_ok ); +psa_status_t psa_validate_key_id( mbedtls_svc_key_id_t key, int vendor_ok ); #endif /* PSA_CRYPTO_SLOT_MANAGEMENT_H */