Page MenuHomePhabricator

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

Authored by Fabien on May 20 2020, 11:16.

Details

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.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien requested review of this revision.May 20 2020, 11:16

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.May 20 2020, 11:33