mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Only set slot to OCCUPIED on successful key loading
Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
@ -1786,7 +1786,6 @@ static psa_status_t psa_start_key_creation(
|
||||
* definition. */
|
||||
|
||||
slot->attr = attributes->core;
|
||||
slot->status = PSA_SLOT_OCCUPIED;
|
||||
if (PSA_KEY_LIFETIME_IS_VOLATILE(slot->attr.lifetime)) {
|
||||
#if !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
|
||||
slot->attr.id = volatile_key_id;
|
||||
@ -1850,6 +1849,8 @@ static psa_status_t psa_start_key_creation(
|
||||
}
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
|
||||
|
||||
slot->status = PSA_SLOT_OCCUPIED;
|
||||
|
||||
return PSA_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user