From a4e8c523cf26b0e30a7bede6429d6e746b403240 Mon Sep 17 00:00:00 2001 From: Parminder Singh Date: Mon, 30 Mar 2026 10:40:15 +0100 Subject: [PATCH] Fix PSA lifetime persistence argument Pass `PSA_KEY_PERSISTENCE_DEFAULT` to `PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION()` instead of `PSA_KEY_LIFETIME_PERSISTENT`. The macro expects a `psa_key_persistence_t`, but the previous code incorrectly passed a value already representing a constructed lifetime. This aligns the call with the API specification and ensures correct lifetime construction. Signed-off-by: Parminder Singh --- include/psa/crypto_struct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index 063808743e..0bdbc5ce8d 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -341,7 +341,7 @@ static inline void psa_set_key_id(psa_key_attributes_t *attributes, if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) { attributes->MBEDTLS_PRIVATE(lifetime) = PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION( - PSA_KEY_LIFETIME_PERSISTENT, + PSA_KEY_PERSISTENCE_DEFAULT, PSA_KEY_LIFETIME_GET_LOCATION(lifetime)); } }