Skip to content

Commit 2169a5e

Browse files
author
Hanno Becker
committed
PSA: Adapt pk.c, pk_wrap.c, cipher.c to new key policy init API
1 parent 242da1e commit 2169a5e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

library/cipher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx,
322322
* mbedtls_cipher_free() needs to be called in any case. */
323323

324324
/* Setup policy for the new key slot. */
325-
psa_key_policy_init( &key_policy );
325+
key_policy = psa_key_policy_init();
326326

327327
/* Mbed TLS' cipher layer doesn't enforce the mode of operation
328328
* (encrypt vs. decrypt): it is possible to setup a key for encryption

library/pk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk,
580580
return( MBEDTLS_ERR_PK_HW_ACCEL_FAILED );
581581

582582
/* set policy */
583-
psa_key_policy_init( &policy );
583+
policy = psa_key_policy_init();
584584
psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_SIGN,
585585
PSA_ALG_ECDSA(hash_alg) );
586586
if( PSA_SUCCESS != psa_set_key_policy( key, &policy ) )

library/pk_wrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ static int ecdsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
580580
if( ( ret = psa_allocate_key( &key_slot ) ) != PSA_SUCCESS )
581581
return( mbedtls_psa_err_translate_pk( ret ) );
582582

583-
psa_key_policy_init( &policy );
583+
policy = psa_key_policy_init();
584584
psa_key_policy_set_usage( &policy, PSA_KEY_USAGE_VERIFY, psa_sig_md );
585585
if( ( ret = psa_set_key_policy( key_slot, &policy ) ) != PSA_SUCCESS )
586586
{

0 commit comments

Comments
 (0)