Skip to content

Conversation

fanquake
Copy link
Member

This removes the code introduced in #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.

Note that we are still also still doing other Windows specific gathering using RandAddSeedPerfmon and RAND_screen() 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.

This removes the code introduced in [bitcoin#4399](bitcoin#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.
@TheBlueMatt
Copy link
Contributor

Can we snarf (some portion of) mouse movements via Qt directly (on all platforms)?

@sipa
Copy link
Member

sipa commented Oct 15, 2019

Concept ACK on removing this, especially as it's Windows only.

But it would be nice to use UI events in general and feed them into our own RNG (perhaps batches together when there are a bunch of events accumulated).

@maflcko
Copy link
Member

maflcko commented Oct 15, 2019

I think removing this (gui-only, windows-only) can be done independently from adding more randomness sources

@sipa
Copy link
Member

sipa commented Oct 15, 2019

I think removing this (gui-only, windows-only) can be done independently from adding more randomness sources

Agreed.

@laanwj
Copy link
Member

laanwj commented Oct 16, 2019

ACK cc3b528

Maybe get rid of RAND_screen calls too. They've been deprecated a while ago.

But it would be nice to use UI events in general and feed them into our own RNG (perhaps batches together when there are a bunch of events accumulated).

I'm not sure it's worth doing, especially with the GUI and node/wallet split on the horizon. Also conceptually not sure the presence of an UI or not should affect random generation, at least manually: the OS's cryptographic randomness generation on modern OSes is supposed to take care of this. It has access to much more timings and such than a user-space application ever would.

(in any case, Marco is correct that this is a separate concern and probably should be discussed somewhere else, or at least isn't a blocker here)

@carnhofdaki
Copy link
Contributor

carnhofdaki commented Oct 16, 2019

the OS's randomness generation on modern OSes is supposed to take care of this. It has access to much more timings and such than a user-space application ever would.

Yes. Just for fun, no offence: Reminds me of https://flak.tedunangst.com/post/random-in-the-wild

@fanquake fanquake mentioned this pull request Oct 16, 2019
@maflcko
Copy link
Member

maflcko commented Oct 16, 2019

unsigned ACK cc3b528

@DrahtBot
Copy link
Contributor

Gitian builds for commit 4cfb673 (master):

Gitian builds for commit 4093216 (master and this pull):

Copy link
Member

@theuni theuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK cc3b528.

Also agree with nuking the RAND_screen() as a follow-up.

fanquake added a commit that referenced this pull request Oct 18, 2019
cc3b528 gui: remove OpenSSL PRNG seeding (Windows, Qt only) (fanquake)

Pull request description:

  This removes the code introduced in [#4399](#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
@fanquake fanquake merged commit cc3b528 into bitcoin:master Oct 18, 2019
fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 18, 2019
Follow up to bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
@fanquake fanquake deleted the windows_qt_openssl_seeding branch October 18, 2019 18:24
fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 19, 2019
Follow up to bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
laanwj added a commit that referenced this pull request Oct 21, 2019
e892f96 random: remove call to RAND_screen() (Windows only) (fanquake)

Pull request description:

  Follow up to #17151 where there were multiple calls to also remove our call to RAND_screen().

ACKs for top commit:
  MarcoFalke:
    unsigned ACK e892f96
  laanwj:
    ACK e892f96

Tree-SHA512: 1b846016d91e8113f90466b61fcaf0574edb6b4726eba1947549e2ac28907e1318d893f7b303e756f19730c8507c79b10e08d54b97153224b585ff1e0ac1953e
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 21, 2019
cc3b528 gui: remove OpenSSL PRNG seeding (Windows, Qt only) (fanquake)

Pull request description:

  This removes the code introduced in [bitcoin#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
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 21, 2019
Follow up to bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 26, 2019
This should have been part of bitcoin#17151.
fanquake added a commit to fanquake/bitcoin that referenced this pull request Oct 28, 2019
This should have been part of bitcoin#17151.
sipa pushed a commit to sipa/bitcoin that referenced this pull request Oct 28, 2019
sipa pushed a commit to sipa/bitcoin that referenced this pull request Oct 29, 2019
sipa pushed a commit to sipa/bitcoin that referenced this pull request Nov 2, 2019
sipa pushed a commit to sipa/bitcoin that referenced this pull request Nov 2, 2019
Naviabheeman pushed a commit to Naviabheeman/tapyrus-core that referenced this pull request Apr 6, 2020
Follow up to bitcoin/bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Apr 6, 2020
- gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged bitcoin#18160
- gui: Drop PeerTableModel dependency to ClientModel bitcoin#18060
- gui: Break trivial circular dependencies bitcoin#18036
- gui: Improve "Hide" button tool-tip message bitcoin#17360
- gui: Shortcut to close ModalOverlay bitcoin#17998
- gui: Remove warning "unused variable 'wallet_model'" bitcoin#17939
- refactor: Use PACKAGE_NAME in GUI modal overlay and bitcoin-wallet bitcoin#17923
- gui: remove OpenSSL PRNG seeding (Windows, Qt only) bitcoin#17151
MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Apr 6, 2020
- gui: Avoid Wallet::GetBalance in WalletModel::pollBalanceChanged bitcoin#18160
- gui: Drop PeerTableModel dependency to ClientModel bitcoin#18060
- gui: Break trivial circular dependencies bitcoin#18036
- gui: Improve "Hide" button tool-tip message bitcoin#17360
- gui: Shortcut to close ModalOverlay bitcoin#17998
- gui: Remove warning "unused variable 'wallet_model'" bitcoin#17939
- refactor: Use PACKAGE_NAME in GUI modal overlay and bitcoin-wallet bitcoin#17923
- gui: remove OpenSSL PRNG seeding (Windows, Qt only) bitcoin#17151
- refactor: Remove unused defines in qt/bitcoinunits.h bitcoin#17869
Naviabheeman pushed a commit to Naviabheeman/tapyrus-core that referenced this pull request Apr 7, 2020
Follow up to bitcoin/bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Apr 17, 2020
This should have been part of bitcoin#17151.
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 20, 2020
Summary:
```
This removes the code introduced in
[#4399](bitcoin/bitcoin#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 [[bitcoin/bitcoin#17151 | 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
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request May 20, 2020
Summary:
```
Follow up to bitcoin/bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
```

Backport of core [[bitcoin/bitcoin#17191 | PR17191]].

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

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D6157
Naviabheeman pushed a commit to Naviabheeman/tapyrus-core that referenced this pull request Jun 5, 2020
Follow up to bitcoin/bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 17, 2020
Summary:
```
This removes the code introduced in
[#4399](bitcoin/bitcoin#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 [[bitcoin/bitcoin#17151 | 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
silence48 pushed a commit to FantasyGold/FantasyGold-Core that referenced this pull request Nov 14, 2020
Follow up to bitcoin/bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
silence48 pushed a commit to FantasyGold/FantasyGold-Core that referenced this pull request Nov 15, 2020
Follow up to bitcoin/bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
Fuzzbawls pushed a commit to Fuzzbawls/PIVX that referenced this pull request Mar 30, 2021
Follow up to bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
Fuzzbawls pushed a commit to Fuzzbawls/PIVX that referenced this pull request Mar 31, 2021
Fuzzbawls pushed a commit to Fuzzbawls/PIVX that referenced this pull request Apr 14, 2021
Follow up to bitcoin#17151 where
there were multiple calls to also remove our call to RAND_screen().
Fuzzbawls pushed a commit to Fuzzbawls/PIVX that referenced this pull request Apr 14, 2021
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Apr 14, 2021
cecbf6c Use secure.h header for secure allocators (Fuzzbawls)
d9f67da net: add ifaddrs.h include (fanquake)
e906436 build: check if -lsocket is required with *ifaddrs (fanquake)
414f405 rand: only try and use freeifaddrs if available (fanquake)
3a039d6 build: avoid getifaddrs when unavailable (Cory Fields)
77bddd7 Use GetStrongRandBytes in gmp bignum initialization (Fuzzbawls)
b70b26f Fix typo in comment in randomenv.cpp (Fuzzbawls)
fec460c Put bounds on the number of CPUID leaves explored (Pieter Wuille)
41ab1ff Fix CPUID subleaf iteration (Pieter Wuille)
8a9bbb1 Move events_hasher into RNGState() (Pieter Wuille)
88c2ae5 random: mark RandAddPeriodic and SeedPeriodic as noexcept (fanquake)
81d382f doc: correct random.h docs after bitcoin#17270 (fanquake)
f363ea9 Seed RNG with precision timestamps on receipt of net messages. (Matt Corallo)
7d6ddcb Run background seeding periodically instead of unpredictably (Pieter Wuille)
4679181 Add information gathered through getauxval() (Pieter Wuille)
88d97d0 Feed CPUID data into RNG (Pieter Wuille)
8f5b9c9 Use sysctl for seeding on MacOS/BSD (Pieter Wuille)
67de246 Gather additional entropy from the environment (Pieter Wuille)
6142e1f Seed randomness with process id / thread id / various clocks (Pieter Wuille)
7bde8b7 [MOVEONLY] Move cpuid code from random to compat/cpuid (Fuzzbawls)
52b5336 [MOVEONLY] Move perfmon data gathering to new randomenv module (Pieter Wuille)
27cf995 doc: minor corrections in random.cpp (fanquake)
fccd2b8 doc: correct function name in ReportHardwareRand() (fanquake)
909473e Fix FreeBSD build by including utilstrencodings.h (Fuzzbawls)
630931f break circular dependency: random/sync -> util -> random/sync (Fuzzbawls)
5eed08c random: remove call to RAND_screen() (Windows only) (fanquake)
ada9868 gui: remove OpenSSL PRNG seeding (Windows, Qt only) (fanquake)
22a7121 Fix non-deterministic coverage of test DoS_mapOrphans (Fuzzbawls)
79e7fd3 Add ChaCha20 bench (Jonas Schnelli)
6966aa9 Add ChaCha20 encryption option (XOR) (Jonas Schnelli)
28c9cdb tests: Add script checking for deterministic line coverage (practicalswift)
c82e359 test: Make bloom tests deterministic (MarcoFalke)
7b33223 Document strenghtening (Pieter Wuille)
0190dec Add hash strengthening to the RNG (Pieter Wuille)
67e336d Use RdSeed when available, and reduce RdRand load (Pieter Wuille)
4ffda1f Document RNG design in random.h (Pieter Wuille)
2b6381e Use secure allocator for RNG state (Pieter Wuille)
080deb3 Encapsulate RNGState better (Pieter Wuille)
787d72f DRY: Implement GetRand using FastRandomContext::randrange (Pieter Wuille)
5bc2583 Sprinkle some sweet noexcepts over the RNG code (Pieter Wuille)
774899f Remove hwrand_initialized. (Pieter Wuille)
698d133 Switch all RNG code to the built-in PRNG. (Pieter Wuille)
038a45a Integrate util/system's CInit into RNGState (Fuzzbawls)
5f20e62 Abstract out seeding/extracting entropy into RNGState::MixExtract (Pieter Wuille)
298f97c Add thread safety annotations to RNG state (Pieter Wuille)
2326535 Rename some hardware RNG related functions (Pieter Wuille)
d76ee83 Automatically initialize RNG on first use. (Pieter Wuille)
1a5dbc5 Don't log RandAddSeedPerfmon details (Pieter Wuille)
32e6c42 Simplify testing RNG code (Fuzzbawls)
972effa Make unit tests use the insecure_rand_ctx exclusively (Fuzzbawls)
af52bf5 Use a FastRandomContext in LimitOrphanTxSize (Fuzzbawls)
746d466 Introduce a Shuffle for FastRandomContext and use it in wallet (Fuzzbawls)
1cdf124 Use a local FastRandomContext in a few more places in net (Fuzzbawls)
e862564 Make addrman use its local RNG exclusively (Fuzzbawls)
94b2ead Make FastRandomContext support standard C++11 RNG interface (Pieter Wuille)

Pull request description:

  This is a collection of upstream PRs that have been backported to bring our RNG (`src/random`) code more up-to-date. The following upstream PRs have been included here:

  - bitcoin#12742
  - bitcoin#14624
    - some of this had already been merged previously
  - bitcoin#14955
  - bitcoin#15250
  - bitcoin#15224
  - bitcoin#15324
  - bitcoin#15296
  - bitcoin#15512
  - bitcoin#16878
  - bitcoin#17151
  - bitcoin#17191
  - bitcoin#13236
  - bitcoin#13314
  - bitcoin#17169
  - bitcoin#17270
    -  omitted last commit as our testing framework doesn't support it currently
    - omitted bitcoin@64e1e02, to be pulled in after our time utility is updated in a separate PR
  - bitcoin#17573
  - bitcoin#17507
  - bitcoin#17670
  - bitcoin#17527
  - bitcoin#14127
  - bitcoin#21486

ACKs for top commit:
  furszy:
    ACK cecbf6c with a minor nit that can be easily tackled later.
  random-zebra:
    rebase utACK cecbf6c and merging...

Tree-SHA512: 3463b693cc9bddc1ec15228d264a794f5c2f159073fafa2ccf6e2563abfeb4369e49505f97ca84f2478ca792bd07b66d2cd83c58044d6a0cae6af42d22f5784b
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 11, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 11, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 12, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 12, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 12, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 14, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 14, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 15, 2021
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
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 21, 2021
e892f96 random: remove call to RAND_screen() (Windows only) (fanquake)

Pull request description:

  Follow up to bitcoin#17151 where there were multiple calls to also remove our call to RAND_screen().

ACKs for top commit:
  MarcoFalke:
    unsigned ACK e892f96
  laanwj:
    ACK e892f96

Tree-SHA512: 1b846016d91e8113f90466b61fcaf0574edb6b4726eba1947549e2ac28907e1318d893f7b303e756f19730c8507c79b10e08d54b97153224b585ff1e0ac1953e
kwvg pushed a commit to kwvg/dash that referenced this pull request Oct 12, 2021
e892f96 random: remove call to RAND_screen() (Windows only) (fanquake)

Pull request description:

  Follow up to bitcoin#17151 where there were multiple calls to also remove our call to RAND_screen().

ACKs for top commit:
  MarcoFalke:
    unsigned ACK e892f96
  laanwj:
    ACK e892f96

Tree-SHA512: 1b846016d91e8113f90466b61fcaf0574edb6b4726eba1947549e2ac28907e1318d893f7b303e756f19730c8507c79b10e08d54b97153224b585ff1e0ac1953e
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants