Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 715a247

Browse files
fanquakegades
authored andcommitted
Merge bitcoin#17151: gui: remove OpenSSL PRNG seeding (Windows, Qt only)
cc3b528 gui: remove OpenSSL PRNG seeding (Windows, Qt only) (fanquake) Pull request description: This removes the code introduced in [dashpay#4399](bitcoin#4399) that attempts to add additional entroy to the OpenSSL PRNG using `RAND_event()`. 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](https://github.com/bitcoin/bitcoin/blob/master/src/random.cpp). Note that we are still also still doing other Windows specific gathering using [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) on top of the other generation we do. Also note that if RAND_event returns `0` here (PRNG has **NOT** been seeded with enough data), we're just logging a single message and continuing, which also seems less than ideal. ACKs for top commit: laanwj: ACK cc3b528 MarcoFalke: unsigned ACK cc3b528 theuni: ACK cc3b528. Tree-SHA512: 0bb18779cf37f6670e3e5ac6a6a38e5f95199491b2684f9e56391c76f030fe1621d6df064239c2a398f228129fdf3f2220fc8cd15b2b92ecf2ea6d98a79b2175
1 parent 5472a38 commit 715a247

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/qt/winshutdownmonitor.cpp

-13
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66

77
#if defined(Q_OS_WIN)
88
#include <shutdown.h>
9-
#include <util/system.h>
109

1110
#include <windows.h>
1211

1312
#include <QDebug>
1413

15-
#include <openssl/rand.h>
16-
1714
// If we don't want a message to be processed by Qt, return true and set result to
1815
// the value that the window procedure should return. Otherwise return false.
1916
bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult)
@@ -22,16 +19,6 @@ bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pM
2219

2320
MSG *pMsg = static_cast<MSG *>(pMessage);
2421

25-
// Seed OpenSSL PRNG with Windows event data (e.g. mouse movements and other user interactions)
26-
if (RAND_event(pMsg->message, pMsg->wParam, pMsg->lParam) == 0) {
27-
// Warn only once as this is performance-critical
28-
static bool warned = false;
29-
if (!warned) {
30-
LogPrintf("%s: OpenSSL RAND_event() failed to seed OpenSSL PRNG with enough data.\n", __func__);
31-
warned = true;
32-
}
33-
}
34-
3522
switch(pMsg->message)
3623
{
3724
case WM_QUERYENDSESSION:

0 commit comments

Comments
 (0)