HomePhabricator

gui: remove OpenSSL PRNG seeding (Windows, Qt only)

Authored by fanquake <fanquake@gmail.com> on Oct 13 2019, 23:28.

Description

gui: remove OpenSSL PRNG seeding (Windows, Qt only)

Summary:

This removes the code introduced in
[#4399](https://github.com/bitcoin/bitcoin/pull/4399)
that attempts to add additional entroy to the OpenSSL PRNG using Windows
messages.
Note that this is specific to bitcoin-qt running on Windows.

RAND_event() collects the entropy from Windows events such as mouse
movements and other user interaction.
It should be called with the iMsg, wParam and lParam arguments of all
messages sent to the window procedure.
It will estimate the entropy contained in the event message (if any),
and add it to the PRNG.
The program can then process the messages as usual.

Besides BIP70, this is the last place we are directly using OpenSSL in
the GUI code. All other OpenSSL usage is in random.cpp.

Note that we are still also doing Windows specific entropy gathering in
multiple other places. Such as
[RandAddSeedPerfmon](https://github.com/bitcoin/bitcoin/blob/master/src/random.cpp#L268)
and [RAND_screen()](https://github.com/bitcoin/bitcoin/blob/master/src/random.cpp#L600).

Also note that if RAND_event returns 0 (PRNG has NOT been seeded with
enough data), we're just logging a message and continuing on, which
seems less than ideal.

Backport of core PR17151.

Test Plan: Run the build-win64 CI build plan.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

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

Details

Committed
FabienMay 20 2020, 12:26
Pushed
FabienMay 20 2020, 12:26
Reviewer
Restricted Project
Differential Revision
D6156: gui: remove OpenSSL PRNG seeding (Windows, Qt only)
Parents
rABCff8237d54cfa: doc: correct function name in ReportHardwareRand()
Branches
Unknown
Tags
Unknown