diff options
author | Jaeden Amero <jaeden.amero@arm.com> | 2019-01-28 12:28:49 +0000 |
---|---|---|
committer | Jaeden Amero <jaeden.amero@arm.com> | 2019-01-28 12:28:49 +0000 |
commit | 7b9575c654c61e9515963d92e045a7fdc2a668cb (patch) | |
tree | ff92f2df4fa67618f2a8f758eefc3f27465ec371 /tests/suites/test_suite_pk.function | |
parent | d253bb49e70060aab771b2fae10113070e85242d (diff) | |
parent | 2192c27720aba777c81dec0ec2ab865ee60686d5 (diff) | |
download | mbedtls-7b9575c654c61e9515963d92e045a7fdc2a668cb.zip mbedtls-7b9575c654c61e9515963d92e045a7fdc2a668cb.tar.gz mbedtls-7b9575c654c61e9515963d92e045a7fdc2a668cb.tar.bz2 |
Merge remote-tracking branch 'origin/pr/2376' into development-psa
Resolve conflict in updating crypto submodule by manually pointing the
submodule to 2169a5e54ded ("PSA: Adapt pk.c, pk_wrap.c, cipher.c to new
key policy init API").
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; |