mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-26 00:25:35 +00: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;
|
||||
psa_key_type_t got_type;
|
||||
size_t got_bits;
|
||||
psa_key_policy_t policy = {0};
|
||||
|
||||
data = unhexify_alloc( hex, &data_size );
|
||||
TEST_ASSERT( data != NULL );
|
||||
|
@ -554,6 +555,13 @@ void import_export_public_key( char *hex,
|
|||
|
||||
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 */
|
||||
TEST_ASSERT( psa_import_key( slot, type,
|
||||
data, data_size ) == PSA_SUCCESS );
|
||||
|
|
Loading…
Reference in a new issue