aboutsummaryrefslogtreecommitdiff
path: root/src/qt/winshutdownmonitor.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-10-13 19:28:58 -0400
committerfanquake <fanquake@gmail.com>2019-10-15 09:48:50 -0400
commitcc3b5289ef648dca30469ee4afa615a1ed5b4e04 (patch)
treeed7ba9d5b673f349bf951b8d826edadf4a370081 /src/qt/winshutdownmonitor.cpp
parent029c65e04cc2826817e6b5b10696c0e390694ae8 (diff)
downloadbitcoin-cc3b5289ef648dca30469ee4afa615a1ed5b4e04.tar.xz
gui: remove OpenSSL PRNG seeding (Windows, Qt only)
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.
Diffstat (limited to 'src/qt/winshutdownmonitor.cpp')
-rw-r--r--src/qt/winshutdownmonitor.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/qt/winshutdownmonitor.cpp b/src/qt/winshutdownmonitor.cpp
index b177b22b3f..c6eb133cbd 100644
--- a/src/qt/winshutdownmonitor.cpp
+++ b/src/qt/winshutdownmonitor.cpp
@@ -6,14 +6,11 @@
#if defined(Q_OS_WIN)
#include <shutdown.h>
-#include <util/system.h>
#include <windows.h>
#include <QDebug>
-#include <openssl/rand.h>
-
// If we don't want a message to be processed by Qt, return true and set result to
// the value that the window procedure should return. Otherwise return false.
bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult)
@@ -22,16 +19,6 @@ bool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pM
MSG *pMsg = static_cast<MSG *>(pMessage);
- // Seed OpenSSL PRNG with Windows event data (e.g. mouse movements and other user interactions)
- if (RAND_event(pMsg->message, pMsg->wParam, pMsg->lParam) == 0) {
- // Warn only once as this is performance-critical
- static bool warned = false;
- if (!warned) {
- LogPrintf("%s: OpenSSL RAND_event() failed to seed OpenSSL PRNG with enough data.\n", __func__);
- warned = true;
- }
- }
-
switch(pMsg->message)
{
case WM_QUERYENDSESSION: