Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:mod:`hashlib`: Fix a data race when accessing :attr:`~hashlib.hash.digest_size`
on BLAKE-2 objects. Patch by Bénédikt Tran.
2 changes: 2 additions & 0 deletions Modules/blake2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,9 @@ static PyObject *
py_blake2b_get_digest_size(PyObject *op, void *Py_UNUSED(closure))
{
Blake2Object *self = _Blake2Object_CAST(op);
HASHLIB_ACQUIRE_LOCK(self);
Hacl_Hash_Blake2b_index info = hacl_get_blake2_info(self);
HASHLIB_RELEASE_LOCK(self);
return PyLong_FromLong(info.digest_length);
}

Expand Down
Loading