mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Make multi-part AEAD operations thread-safe
The setup calls are the only calls to use a key ID. The key is then copied into the operation object, all future API calls use the copy instead of the key in the slot. 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:
@ -4687,7 +4687,7 @@ static psa_status_t psa_aead_setup(psa_aead_operation_t *operation,
|
|||||||
operation->key_type = psa_get_key_type(&attributes);
|
operation->key_type = psa_get_key_type(&attributes);
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
unlock_status = psa_unregister_read(slot);
|
unlock_status = psa_unregister_read_under_mutex(slot);
|
||||||
|
|
||||||
if (status == PSA_SUCCESS) {
|
if (status == PSA_SUCCESS) {
|
||||||
status = unlock_status;
|
status = unlock_status;
|
||||||
|
Reference in New Issue
Block a user