Rename test_driver_keygen to test_driver_key_management

```
perl -i -pe 's/test_driver_keygen/test_driver_key_management/g' tests/src/drivers/key_management.c tests/suites/test_suite_psa_crypto_driver_wrappers.function
```

Follow-up of c4813a6e80

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2020-11-22 18:47:43 +01:00
parent 0737c09c7b
commit c24023649e
2 changed files with 15 additions and 15 deletions

View file

@ -254,18 +254,18 @@ psa_status_t test_transparent_export_public_key(
const uint8_t *key, size_t key_length,
uint8_t *data, size_t data_size, size_t *data_length )
{
++test_driver_keygen_hooks.hits;
++test_driver_key_management_hooks.hits;
if( test_driver_keygen_hooks.forced_status != PSA_SUCCESS )
return( test_driver_keygen_hooks.forced_status );
if( test_driver_key_management_hooks.forced_status != PSA_SUCCESS )
return( test_driver_key_management_hooks.forced_status );
if( test_driver_keygen_hooks.forced_output != NULL )
if( test_driver_key_management_hooks.forced_output != NULL )
{
if( test_driver_keygen_hooks.forced_output_length > data_size )
if( test_driver_key_management_hooks.forced_output_length > data_size )
return( PSA_ERROR_BUFFER_TOO_SMALL );
memcpy( data, test_driver_keygen_hooks.forced_output,
test_driver_keygen_hooks.forced_output_length );
*data_length = test_driver_keygen_hooks.forced_output_length;
memcpy( data, test_driver_key_management_hooks.forced_output,
test_driver_key_management_hooks.forced_output_length );
*data_length = test_driver_key_management_hooks.forced_output_length;
return( PSA_SUCCESS );
}

View file

@ -238,7 +238,7 @@ void export_key( int force_status_arg,
psa_status_t actual_status;
uint8_t actual_output[PSA_KEY_EXPORT_ECC_PUBLIC_KEY_MAX_SIZE(256)] = {0};
size_t actual_output_length;
test_driver_keygen_hooks = test_driver_keygen_hooks_init();
test_driver_key_management_hooks = test_driver_key_management_hooks_init();
psa_set_key_type( &attributes, input_key_type );
psa_set_key_bits( &attributes, 256 );
@ -249,8 +249,8 @@ void export_key( int force_status_arg,
if( fake_output->len > 0 )
{
expected_output_ptr = test_driver_keygen_hooks.forced_output = fake_output->x;
expected_output_length = test_driver_keygen_hooks.forced_output_length =
expected_output_ptr = test_driver_key_management_hooks.forced_output = fake_output->x;
expected_output_length = test_driver_key_management_hooks.forced_output_length =
fake_output->len;
}
else
@ -259,8 +259,8 @@ void export_key( int force_status_arg,
expected_output_length = expected_output->len;
}
test_driver_keygen_hooks.hits = 0;
test_driver_keygen_hooks.forced_status = force_status;
test_driver_key_management_hooks.hits = 0;
test_driver_key_management_hooks.forced_status = force_status;
if( PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY( output_key_type ) )
actual_status = psa_export_public_key( handle, actual_output, sizeof(actual_output), &actual_output_length );
@ -270,7 +270,7 @@ void export_key( int force_status_arg,
if( PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY( output_key_type ) &&
!PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY( input_key_type ) )
TEST_EQUAL( test_driver_keygen_hooks.hits, 1 );
TEST_EQUAL( test_driver_key_management_hooks.hits, 1 );
if( actual_status == PSA_SUCCESS )
{
@ -281,7 +281,7 @@ exit:
psa_reset_key_attributes( &attributes );
psa_destroy_key( handle );
PSA_DONE( );
test_driver_keygen_hooks = test_driver_keygen_hooks_init();
test_driver_key_management_hooks = test_driver_key_management_hooks_init();
}
/* END_CASE */