Please see the attached patch. The flag jent_rng_is_initialized is not being handled correctly. - It is set to true before the corresponding jent_rng_collector structure is fully initialized. - It is not cleared when the jent_rng_collector is freed.
Subsequently, when trying to generate entropy in the function _gcry_rndjent_poll after the jent_rng_collector has been freed, jent_rng_is_initialized is true so jent_rng_collector is not re-initialized, but then when trying to generate entropy jent_rng_collector is null so entropy generation is skipped. In Ubuntu, we want to create a userspace FIPS mode that generates entropy solely through the jitter entropy library. Because of this bug, the modifications we made to rndgetentropy.c to get all of the entropy from _gcry_rndjent_poll goes into an infinite loop because _gcry_rndjent_poll generates 0 random entropy. Consequently I think the existing code that tries to generate 50% of the bytes from jitterentropy is actually getting none. This patch was generated against the master branch.
rndjent.fix.patch
Description: Binary data
_______________________________________________ Gcrypt-devel mailing list [email protected] https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
