@@ -143,7 +143,8 @@ void persistent_slot_lifecycle( int lifetime_arg, int id_arg,
143143 PSA_ASSERT( psa_crypto_init( ) );
144144
145145 /* Get a handle and import a key. */
146- psa_make_key_persistent( &attributes, id, lifetime );
146+ psa_set_key_id( &attributes, id );
147+ psa_set_key_lifetime( &attributes, lifetime );
147148 psa_set_key_type( &attributes, type );
148149 psa_set_key_usage_flags( &attributes, usage_flags );
149150 psa_set_key_algorithm( &attributes, alg );
@@ -221,7 +222,8 @@ void create_existent( int lifetime_arg, int id_arg,
221222 PSA_ASSERT( psa_crypto_init( ) );
222223
223224 /* Create a key. */
224- psa_make_key_persistent( &attributes, id, lifetime );
225+ psa_set_key_id( &attributes, id );
226+ psa_set_key_lifetime( &attributes, lifetime );
225227 psa_set_key_type( &attributes, type1 );
226228 psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_EXPORT );
227229 psa_set_key_algorithm( &attributes, 0 );
@@ -298,7 +300,8 @@ void create_fail( int lifetime_arg, int id_arg,
298300
299301 PSA_ASSERT( psa_crypto_init( ) );
300302
301- psa_make_key_persistent( &attributes, id, lifetime );
303+ psa_set_key_id( &attributes, id );
304+ psa_set_key_lifetime( &attributes, lifetime );
302305 psa_set_key_type( &attributes, PSA_KEY_TYPE_RAW_DATA );
303306 TEST_EQUAL( psa_import_key( &attributes, material, sizeof( material ),
304307 &handle ),
@@ -345,8 +348,10 @@ void copy_across_lifetimes( int source_lifetime_arg, int source_id_arg,
345348
346349 /* Populate the source slot. */
347350 if( source_lifetime != PSA_KEY_LIFETIME_VOLATILE )
348- psa_make_key_persistent( &source_attributes,
349- source_id, source_lifetime );
351+ {
352+ psa_set_key_id( &source_attributes, source_id );
353+ psa_set_key_lifetime( &source_attributes, source_lifetime );
354+ }
350355 psa_set_key_type( &source_attributes, source_type );
351356 psa_set_key_usage_flags( &source_attributes, source_usage );
352357 psa_set_key_algorithm( &source_attributes, source_alg );
@@ -358,8 +363,10 @@ void copy_across_lifetimes( int source_lifetime_arg, int source_id_arg,
358363
359364 /* Prepare the target slot. */
360365 if( target_lifetime != PSA_KEY_LIFETIME_VOLATILE )
361- psa_make_key_persistent( &target_attributes,
362- target_id, target_lifetime );
366+ {
367+ psa_set_key_id( &target_attributes, target_id );
368+ psa_set_key_lifetime( &target_attributes, target_lifetime );
369+ }
363370 psa_set_key_usage_flags( &target_attributes, target_usage );
364371 psa_set_key_algorithm( &target_attributes, target_alg );
365372
@@ -449,8 +456,10 @@ void copy_to_occupied( int source_lifetime_arg, int source_id_arg,
449456
450457 /* Populate the source slot. */
451458 if( source_lifetime != PSA_KEY_LIFETIME_VOLATILE )
452- psa_make_key_persistent( &attributes,
453- source_id, source_lifetime );
459+ {
460+ psa_set_key_id( &attributes, source_id );
461+ psa_set_key_lifetime( &attributes, source_lifetime );
462+ }
454463 psa_set_key_type( &attributes, source_type );
455464 psa_set_key_usage_flags( &attributes, source_usage );
456465 psa_set_key_algorithm( &attributes, source_alg );
@@ -465,7 +474,8 @@ void copy_to_occupied( int source_lifetime_arg, int source_id_arg,
465474 }
466475 else
467476 {
468- psa_make_key_persistent( &attributes1, target_id, target_lifetime );
477+ psa_set_key_id( &attributes1, target_id );
478+ psa_set_key_lifetime( &attributes1, target_lifetime );
469479 psa_set_key_type( &attributes1, target_type );
470480 psa_set_key_usage_flags( &attributes1, target_usage );
471481 psa_set_key_algorithm( &attributes1, target_alg );
@@ -476,7 +486,8 @@ void copy_to_occupied( int source_lifetime_arg, int source_id_arg,
476486 PSA_ASSERT( psa_get_key_attributes( target_handle, &attributes1 ) );
477487
478488 /* Make a copy attempt. */
479- psa_make_key_persistent( &attributes, target_id, target_lifetime );
489+ psa_set_key_id( &attributes, target_id );
490+ psa_set_key_lifetime( &attributes, target_lifetime );
480491 TEST_EQUAL( psa_copy_key( source_handle,
481492 &attributes, &new_handle ),
482493 PSA_ERROR_ALREADY_EXISTS );
0 commit comments