Use arc4random for entropy on supported systems #9676

issue mlmikael opened this issue on February 3, 2017
  1. mlmikael commented at 12:28 PM on February 3, 2017: none

    Please add a check for arc4random support on all OS:es.

    When found, GetOSRand() of src/random.cpp should use it for getting entropy from the OS.

    https://github.com/bitcoin/bitcoin/blob/27765b6403cece54320374b37afb01a0cfe571c3/src/random.cpp#L109

    This will have the benefit that BitcoinD will work also in Unix environments where there is no /dev/urandom file, such as certain chroot:ed environments, in particular where the filesystem not supports the creation of device files.

    The patch in src/random.cpp will amount to adding this before line 108:

    #elif arc4random_supported arc4random_buf(ent32,32);

    I.e. if arc4random() is supported, then simply use this arc4random_buf() call as only code in GetOSRand(). arc4random_buf() has no failure states.

    Then, the configure script must check if arc4random is supported, and if so set the arc4random_supported define.

  2. mlmikael referenced this in commit 06de840fa7 on Feb 3, 2017
  3. mlmikael cross-referenced this on Feb 3, 2017 from issue Use arc4random for entropy on supported systems by mlmikael
  4. mlmikael commented at 12:33 PM on February 3, 2017: none

    Pull request for half the solution in #9677 .

  5. laanwj added the label Utils and libraries on Feb 3, 2017
  6. laanwj referenced this in commit 224e6eb089 on Feb 21, 2017
  7. laanwj cross-referenced this on Feb 21, 2017 from issue util: Specific GetOSRandom for Linux/FreeBSD/OpenBSD by laanwj
  8. laanwj closed this on Mar 1, 2017

  9. practicalswift referenced this in commit 471e36b90d on Apr 27, 2017
  10. HashUnlimited referenced this in commit 64a59bdb1a on Feb 28, 2018
  11. lateminer referenced this in commit 95558dd191 on Jan 7, 2019
  12. Warrows referenced this in commit beca93d57c on Jan 24, 2019
  13. Warrows referenced this in commit fe5b6344ae on Jun 30, 2019
  14. Warrows referenced this in commit 372436da16 on Jul 7, 2019
  15. Warrows referenced this in commit ce60c2bd12 on Jul 8, 2019
  16. Warrows referenced this in commit caeb36c80e on Jul 9, 2019
  17. Warrows referenced this in commit 646f4f5fb3 on Jul 9, 2019
  18. Warrows referenced this in commit 9e8c266b15 on Jul 31, 2019
  19. CaveSpectre11 referenced this in commit 9e5b864a79 on Dec 14, 2019
  20. KolbyML referenced this in commit 245ba5fe79 on Nov 21, 2020
  21. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC