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.

cherry-picked from master commit:

355f5b7f69075c010fe33aa5b10ac60c08fae0c7

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

Provenance
dtzWillAuthored on Jun 18 2018, 1:53 AM
gniibeCommitted on Jun 19 2018, 5:16 AM
Parents
rC6ca6344429e5: Post release updates
Branches
Unknown
Tags
Unknown
Tasks
T4034: libgcrypt: Fix for lock behavior broken in 1.8.3