Rename function to conform to the library

Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
This commit is contained in:
gabor-mezei-arm 2021-06-28 14:05:00 +02:00
parent c8720c4857
commit 98a3435a10
No known key found for this signature in database
GPG Key ID: 106F5A41ECC305BD
4 changed files with 26 additions and 21 deletions

View File

@ -192,7 +192,7 @@ psa_status_t mbedtls_test_record_status( psa_status_t status,
* permissions of other usage policies
* (like PSA_KEY_USAGE_SIGN_HASH involves PSA_KEY_USAGE_SIGN_MESSGAE).
*/
psa_key_usage_t update_key_usage_flags( psa_key_usage_t usage_flags );
psa_key_usage_t mbedtls_test_update_key_usage_flags( psa_key_usage_t usage_flags );
/** Skip a test case if the given key is a 192 bits AES key and the AES
* implementation is at least partially provided by an accelerator or

View File

@ -114,7 +114,7 @@ psa_status_t mbedtls_test_record_status( psa_status_t status,
}
#endif /* defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
psa_key_usage_t update_key_usage_flags( psa_key_usage_t usage_flags )
psa_key_usage_t mbedtls_test_update_key_usage_flags( psa_key_usage_t usage_flags )
{
psa_key_usage_t updated_usage = usage_flags;

View File

@ -323,7 +323,7 @@ void import_with_policy( int type_arg,
PSA_ASSERT( psa_get_key_attributes( key, &got_attributes ) );
TEST_EQUAL( psa_get_key_type( &got_attributes ), type );
TEST_EQUAL( psa_get_key_usage_flags( &got_attributes ),
update_key_usage_flags( usage ) );
mbedtls_test_update_key_usage_flags( usage ) );
TEST_EQUAL( psa_get_key_algorithm( &got_attributes ), alg );
ASSERT_NO_SLOT_NUMBER( &got_attributes );
@ -711,9 +711,9 @@ void effective_key_attributes( int type_arg, int expected_type_arg,
psa_key_usage_t expected_usage = expected_usage_arg;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
/* Check if all extended usage flags are deployed
/* Check if all implicit usage flags are deployed
in the expected usage flags. */
TEST_EQUAL( expected_usage, update_key_usage_flags( usage ) );
TEST_EQUAL( expected_usage, mbedtls_test_update_key_usage_flags( usage ) );
PSA_ASSERT( psa_crypto_init( ) );
@ -810,9 +810,10 @@ void mac_key_policy( int policy_usage_arg,
psa_status_t expected_status = expected_status_arg;
unsigned char mac[PSA_MAC_MAX_SIZE];
/* Check if all extended usage flags are deployed
/* Check if all implicit usage flags are deployed
in the expected usage flags. */
TEST_EQUAL( expected_usage, update_key_usage_flags( policy_usage ) );
TEST_EQUAL( expected_usage,
mbedtls_test_update_key_usage_flags( policy_usage ) );
PSA_ASSERT( psa_crypto_init( ) );
@ -869,8 +870,9 @@ void cipher_key_policy( int policy_usage_arg,
PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
&key ) );
/* Check if no key usage extension is done */
TEST_EQUAL( policy_usage, update_key_usage_flags( policy_usage ) );
/* Check if no key usage flag implication is done */
TEST_EQUAL( policy_usage,
mbedtls_test_update_key_usage_flags( policy_usage ) );
status = psa_cipher_encrypt_setup( &operation, key, exercise_alg );
if( policy_alg == exercise_alg &&
@ -927,8 +929,9 @@ void aead_key_policy( int policy_usage_arg,
PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
&key ) );
/* Check if no key usage extension is done */
TEST_EQUAL( policy_usage, update_key_usage_flags( policy_usage ) );
/* Check if no key usage implication is done */
TEST_EQUAL( policy_usage,
mbedtls_test_update_key_usage_flags( policy_usage ) );
status = psa_aead_encrypt( key, exercise_alg,
nonce, nonce_length,
@ -986,8 +989,9 @@ void asymmetric_encryption_key_policy( int policy_usage_arg,
PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
&key ) );
/* Check if no key usage extension is done */
TEST_EQUAL( policy_usage, update_key_usage_flags( policy_usage ) );
/* Check if no key usage implication is done */
TEST_EQUAL( policy_usage,
mbedtls_test_update_key_usage_flags( policy_usage ) );
PSA_ASSERT( psa_get_key_attributes( key, &attributes ) );
key_bits = psa_get_key_bits( &attributes );
@ -1057,9 +1061,10 @@ void asymmetric_signature_key_policy( int policy_usage_arg,
unsigned char signature[PSA_SIGNATURE_MAX_SIZE] = {0};
size_t signature_length;
/* Check if all extended usage flags are deployed
/* Check if all implicit usage flags are deployed
in the expected usage flags. */
TEST_EQUAL( expected_usage, update_key_usage_flags( policy_usage ) );
TEST_EQUAL( expected_usage,
mbedtls_test_update_key_usage_flags( policy_usage ) );
PSA_ASSERT( psa_crypto_init( ) );
@ -1223,8 +1228,8 @@ void key_policy_alg2( int key_type_arg, data_t *key_data,
PSA_ASSERT( psa_import_key( &attributes, key_data->x, key_data->len,
&key ) );
/* Update the usage flags to obtain extended usage flags */
usage = update_key_usage_flags( usage );
/* Update the usage flags to obtain implicit usage flags */
usage = mbedtls_test_update_key_usage_flags( usage );
PSA_ASSERT( psa_get_key_attributes( key, &got_attributes ) );
TEST_EQUAL( psa_get_key_usage_flags( &got_attributes ), usage );
TEST_EQUAL( psa_get_key_algorithm( &got_attributes ), alg );
@ -5250,7 +5255,7 @@ void persistent_key_load_key_from_storage( data_t *data,
TEST_EQUAL( psa_get_key_type( &attributes ), type );
TEST_EQUAL( psa_get_key_bits( &attributes ), bits );
TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
update_key_usage_flags( usage_flags ) );
mbedtls_test_update_key_usage_flags( usage_flags ) );
TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
/* Export the key again if permitted by the key policy. */

View File

@ -243,7 +243,7 @@ void persistent_slot_lifecycle( int lifetime_arg, int owner_id_arg, int id_arg,
TEST_ASSERT( mbedtls_svc_key_id_equal(
psa_get_key_id( &attributes ), id ) );
TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
update_key_usage_flags( usage_flags ) );
mbedtls_test_update_key_usage_flags( usage_flags ) );
TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ), alg2 );
TEST_EQUAL( psa_get_key_type( &attributes ), type );
@ -263,7 +263,7 @@ void persistent_slot_lifecycle( int lifetime_arg, int owner_id_arg, int id_arg,
TEST_ASSERT( mbedtls_svc_key_id_equal(
psa_get_key_id( &attributes ), id ) );
TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
update_key_usage_flags( usage_flags ) );
mbedtls_test_update_key_usage_flags( usage_flags ) );
TEST_EQUAL( psa_get_key_algorithm( &attributes ), alg );
TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ), alg2 );
TEST_EQUAL( psa_get_key_type( &attributes ), type );
@ -296,7 +296,7 @@ void persistent_slot_lifecycle( int lifetime_arg, int owner_id_arg, int id_arg,
psa_get_key_id( &attributes ),
psa_get_key_id( &read_attributes ) ) );
TEST_EQUAL( psa_get_key_usage_flags( &attributes ),
update_key_usage_flags( usage_flags ) );
mbedtls_test_update_key_usage_flags( usage_flags ) );
TEST_EQUAL( psa_get_key_algorithm( &attributes ),
psa_get_key_algorithm( &read_attributes ) );
TEST_EQUAL( psa_get_key_enrollment_algorithm( &attributes ),