mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-30 11:34:15 +01:00
fix import_export_public_key test to use policy
This commit is contained in:
parent
338a0cf569
commit
b34879b61a
@ -545,6 +545,7 @@ void import_export_public_key( char *hex,
|
|||||||
size_t exported_length;
|
size_t exported_length;
|
||||||
psa_key_type_t got_type;
|
psa_key_type_t got_type;
|
||||||
size_t got_bits;
|
size_t got_bits;
|
||||||
|
psa_key_policy_t policy = {0};
|
||||||
|
|
||||||
data = unhexify_alloc( hex, &data_size );
|
data = unhexify_alloc( hex, &data_size );
|
||||||
TEST_ASSERT( data != NULL );
|
TEST_ASSERT( data != NULL );
|
||||||
@ -554,6 +555,13 @@ void import_export_public_key( char *hex,
|
|||||||
|
|
||||||
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
|
TEST_ASSERT( psa_crypto_init( ) == PSA_SUCCESS );
|
||||||
|
|
||||||
|
psa_key_policy_init( &policy );
|
||||||
|
|
||||||
|
psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_EXPORT,
|
||||||
|
PSA_ALG_VENDOR_FLAG );
|
||||||
|
|
||||||
|
TEST_ASSERT( psa_set_key_policy( slot, &policy ) == PSA_SUCCESS );
|
||||||
|
|
||||||
/* Import the key */
|
/* Import the key */
|
||||||
TEST_ASSERT( psa_import_key( slot, type,
|
TEST_ASSERT( psa_import_key( slot, type,
|
||||||
data, data_size ) == PSA_SUCCESS );
|
data, data_size ) == PSA_SUCCESS );
|
||||||
|
Loading…
Reference in New Issue
Block a user