Make multi-part cipher operations thread-safe
Within setup we create a copy of the key and put it in the operation field. After setup, we only ever use the new copy, and do not interact with any key slots. Therefore we need only register as a reader of the key during setup, then unregister after we stop accessing the key. 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:
parent
291267f486
commit
c0053cc499
1 changed files with 1 additions and 1 deletions
|
@ -4088,7 +4088,7 @@ exit:
|
|||
psa_cipher_abort(operation);
|
||||
}
|
||||
|
||||
unlock_status = psa_unregister_read(slot);
|
||||
unlock_status = psa_unregister_read_under_mutex(slot);
|
||||
|
||||
return (status == PSA_SUCCESS) ? unlock_status : status;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue