Skip to content

Commit d4f7fe8

Browse files
committed
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.
1 parent ed3c7d2 commit d4f7fe8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/psa/crypto_struct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static inline void psa_set_key_id(psa_key_attributes_t *attributes,
341341
if (PSA_KEY_LIFETIME_IS_VOLATILE(lifetime)) {
342342
attributes->MBEDTLS_PRIVATE(lifetime) =
343343
PSA_KEY_LIFETIME_FROM_PERSISTENCE_AND_LOCATION(
344-
PSA_KEY_LIFETIME_PERSISTENT,
344+
PSA_KEY_PERSISTENCE_DEFAULT,
345345
PSA_KEY_LIFETIME_GET_LOCATION(lifetime));
346346
}
347347
}

0 commit comments

Comments
 (0)