HomePhabricator

random: stop feeding RNG output back into OpenSSL

Description

random: stop feeding RNG output back into OpenSSL

Summary:

On the ::SLOW or ::SLEEP paths, we would feed our RNG output back into
OpenSSL using RAND_add. This commit removes that functionality.

RAND_add(): https://www.openssl.org/docs/manmaster/man3/RAND_add.html

RAND_add() mixes the num bytes at buf into the internal state of the
random generator. This function will not normally be needed, as
mentioned above. The randomness argument is an estimate of how much
randomness is contained in buf, in bytes, and should be a number
between zero and num.

Partial backport of core PR17265:
https://github.com/bitcoin/bitcoin/pull/17265/commits/5624ab0b4f844dc7c17aeb1b009f002c33c38fb3

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6240

Details

Provenance
fanquake <fanquake@gmail.com>Authored on Oct 26 2019, 12:15
FabienCommitted on May 25 2020, 14:43
FabienPushed on May 25 2020, 14:43
Reviewer
Restricted Project
Differential Revision
D6240: random: stop feeding RNG output back into OpenSSL
Parents
rABC0e99f4cdb9bd: [build] set _FORTIFY_SOURCE=2 for -O* builds only
Branches
Unknown
Tags
Unknown