From e3cdf284b2673e5f345b018bc414e58bb2fcc58f Mon Sep 17 00:00:00 2001 From: Jaeden Amero Date: Tue, 20 Aug 2019 12:58:20 +0100 Subject: [PATCH] psa: Adapt set_key_id() for when owner is included --- include/psa/crypto_struct.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 5296202e95..804bd340c4 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -422,7 +422,14 @@ static inline void psa_set_key_lifetime(psa_key_attributes_t *attributes, { attributes->core.lifetime = lifetime; if( lifetime == PSA_KEY_LIFETIME_VOLATILE ) + { +#ifdef MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER + attributes->core.id.key_id = 0; + attributes->core.id.owner = 0; +#else attributes->core.id = 0; +#endif + } } static inline psa_key_lifetime_t psa_get_key_lifetime(