Make multi-part key derivation operations thread-safe

One can input a key using a key identifier through the two changed functions.
Inputted keys are copied into the operation object.
Any material inputted in byte form is separate to the key slot system.
Outputting a key is threadsafe as per the key loading work.
The verification API is yet to be implemented.

Simultaneous API calls on the same operation object are not thread-safe.

Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
Ryan Everett 2024-02-14 17:11:36 +00:00
parent c0053cc499
commit 5ac6fa7aae

View File

@ -7061,7 +7061,7 @@ psa_status_t psa_key_derivation_input_key(
slot->key.data,
slot->key.bytes);
unlock_status = psa_unregister_read(slot);
unlock_status = psa_unregister_read_under_mutex(slot);
return (status == PSA_SUCCESS) ? unlock_status : status;
}
@ -7218,7 +7218,7 @@ psa_status_t psa_key_derivation_key_agreement(psa_key_derivation_operation_t *op
}
}
unlock_status = psa_unregister_read(slot);
unlock_status = psa_unregister_read_under_mutex(slot);
return (status == PSA_SUCCESS) ? unlock_status : status;
}