Home GnuPG

random: Fix hang of _gcry_rndjent_get_version.

Description

random: Fix hang of _gcry_rndjent_get_version.

* random/rndjent.c (_gcry_rndjent_get_version): Move locking.

While the protection for jent_rng_collector is needed,
_gcry_rndjent_poll is also acquiring the lock for the variable.
Thus, it hangs.

This change is sub-optimal, the lock is once released after the call
of _gcry_rndjent_poll. It might be good to modify the API of
_gcry_rndjent_poll to explicitly allow this use case of forcing
initialization keeping the lock.

Comments and change log entry by gniibe.

Details

Auditors
outer
Provenance
dtzWillAuthored on Jun 18 2018, 1:53 AM
gniibeCommitted on Jun 19 2018, 5:14 AM
Parents
rC0d51ea9b88b6: Add NEWS from the 1.8 and 1.7 branches.
Branches
Unknown
Tags
Unknown
Tasks
T4034: libgcrypt: Fix for lock behavior broken in 1.8.3