diff options
Diffstat (limited to 'tests/suites/test_suite_pk.function')
-rw-r--r-- | tests/suites/test_suite_pk.function | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index 9168b1d..120c171 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -74,21 +74,21 @@ size_t mbedtls_rsa_key_len_func( void *ctx ) * or PK_PSA_INVALID_SLOT if no slot was available. * The key uses NIST P-256 and is usable for signing with SHA-256. */ -psa_key_slot_t pk_psa_genkey( void ) +psa_key_handle_t pk_psa_genkey( void ) { - psa_key_slot_t key; + psa_key_handle_t key; const int curve = PSA_ECC_CURVE_SECP256R1; const psa_key_type_t type = PSA_KEY_TYPE_ECC_KEYPAIR(curve); const size_t bits = 256; psa_key_policy_t policy; - /* find a free key slot */ - if( PSA_SUCCESS != mbedtls_psa_get_free_key_slot( &key ) ) + /* Allocate a key slot */ + if( PSA_SUCCESS != psa_allocate_key( &key ) ) return( PK_PSA_INVALID_SLOT ); /* set up policy on key slot */ - psa_key_policy_init( &policy ); + policy = psa_key_policy_init(); psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_SIGN, PSA_ALG_ECDSA(PSA_ALG_SHA_256) ); if( PSA_SUCCESS != psa_set_key_policy( key, &policy ) ) @@ -112,7 +112,7 @@ psa_key_slot_t pk_psa_genkey( void ) void pk_psa_utils( ) { mbedtls_pk_context pk, pk2; - psa_key_slot_t key; + psa_key_handle_t key; const char * const name = "Opaque"; const size_t bitlen = 256; /* harcoded in genkey() */ @@ -778,7 +778,7 @@ exit: void pk_psa_sign( ) { mbedtls_pk_context pk; - psa_key_slot_t key; + psa_key_handle_t key; unsigned char hash[50], sig[100], pkey[100]; size_t sig_len, klen = 0; |