md_rand.c: don't stop polling until properly initialized
authorDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Thu, 18 Oct 2018 21:17:46 +0000 (23:17 +0200)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Thu, 18 Oct 2018 21:46:31 +0000 (23:46 +0200)
commit896e8c5713b50ff2ef1478d5c6709874ce57cf05
tree17251912fe7cb47bd08e2825aff72c367c70d406
parent35cf781c20b65e51c6d0d3e9a199e74534b60b4a
md_rand.c: don't stop polling until properly initialized

Previously, the RNG sets `initialized=1` after the first call to
RAND_poll(), although its criterion for being initialized actually
is whether condition `entropy >= ENTROPY_NEEDED` is true.

This commit now assigns `initialized=(entropy >= ENTROPY_NEEDED)`,
which has the effect that on the next call, RAND_poll() will be
called again, if it previously failed to obtain enough entropy.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7439)
crypto/rand/md_rand.c