aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-10-18 14:13:19 -0400
committerfanquake <fanquake@gmail.com>2019-10-18 14:23:47 -0400
commitddc3cf26ff1272e905f31406d1f365a3c3c6bd9e (patch)
tree7a2ff556b7814cbd6b76be3f6cffbc27b6007bae /src
parent0ff7cd7d0c074448db636bcc73e7879b7e4b21ec (diff)
parentcc3b5289ef648dca30469ee4afa615a1ed5b4e04 (diff)
downloadbitcoin-ddc3cf26ff1272e905f31406d1f365a3c3c6bd9e.tar.xz
Merge #17151: gui: remove OpenSSL PRNG seeding (Windows, Qt only)
cc3b5289ef648dca30469ee4afa615a1ed5b4e04 gui: remove OpenSSL PRNG seeding (Windows, Qt only) (fanquake) Pull request description: 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 `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 cc3b5289ef648dca30469ee4afa615a1ed5b4e04 MarcoFalke: unsigned ACK cc3b5289ef648dca30469ee4afa615a1ed5b4e04 theuni: ACK cc3b5289ef648dca30469ee4afa615a1ed5b4e04. Tree-SHA512: 0bb18779cf37f6670e3e5ac6a6a38e5f95199491b2684f9e56391c76f030fe1621d6df064239c2a398f228129fdf3f2220fc8cd15b2b92ecf2ea6d98a79b2175
Diffstat (limited to 'src')
-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: