random: only use getentropy on openbsd #10855

pull theuni wants to merge 1 commits into bitcoin:master from theuni:getentropy-openbsd changing 1 files +3 −1
  1. theuni commented at 5:17 PM on July 17, 2017: member

    Follow-up from #10335. I can confirm that this fixes my issue when building against a new glibc + old linux headers for back-compat.

  2. random: only use getentropy on openbsd 077d01f2fc
  3. laanwj added the label Build system on Jul 17, 2017
  4. laanwj added this to the milestone 0.15.0 on Jul 17, 2017
  5. sipa commented at 5:57 PM on July 17, 2017: member

    utACK 077d01f2fcc305809f084ccc34badc531ae2f30a

  6. paveljanik commented at 6:34 PM on July 17, 2017: contributor

    utACK 077d01f

  7. TheBlueMatt commented at 7:57 PM on July 17, 2017: member

    utACK 077d01f2fcc305809f084ccc34badc531ae2f30a

  8. gmaxwell approved
  9. gmaxwell commented at 11:02 PM on July 17, 2017: contributor

    utACK.

  10. laanwj merged this on Jul 18, 2017
  11. laanwj closed this on Jul 18, 2017

  12. laanwj referenced this in commit 81560b07ce on Jul 18, 2017
  13. laanwj commented at 6:33 AM on July 18, 2017: member

    Tested on OpenBSD that getentropy() is still used. ACK 077d01f

  14. in src/random.cpp:234 in 077d01f2fc
     226 | @@ -227,10 +227,12 @@ void GetOSRand(unsigned char *ent32)
     227 |              RandFailure();
     228 |          }
     229 |      }
     230 | -#elif defined(HAVE_GETENTROPY)
     231 | +#elif defined(HAVE_GETENTROPY) && defined(__OpenBSD__)
     232 |      /* On OpenBSD this can return up to 256 bytes of entropy, will return an
     233 |       * error if more are requested.
     234 |       * The call cannot return less than the requested number of bytes.
     235 | +       getentropy is explicitly limited to openbsd here, as a similar (but not
    


    jameshilliard commented at 3:18 PM on July 26, 2017:

    OSX also needs getentropy.


    theuni commented at 2:30 PM on July 31, 2017:

    hmm? I don't see any reference for that. Afaik everything for osx is just a wrapper around /dev/[u]random anyway.


    theuni commented at 3:06 PM on July 31, 2017:

    Ignore the above. See discussion in #10301.

  15. PastaPastaPasta referenced this in commit 2bb98eadd6 on Jul 6, 2019
  16. PastaPastaPasta referenced this in commit 5f95248dbc on Jul 8, 2019
  17. PastaPastaPasta referenced this in commit e84cde3e59 on Jul 9, 2019
  18. PastaPastaPasta referenced this in commit 3eeddbe7bb on Jul 11, 2019
  19. PastaPastaPasta referenced this in commit 65dcbb2e81 on Jul 13, 2019
  20. PastaPastaPasta referenced this in commit d7d8f4670d on Jul 13, 2019
  21. PastaPastaPasta referenced this in commit 06855a2722 on Jul 17, 2019
  22. PastaPastaPasta referenced this in commit 75d34370ad on Jul 23, 2019
  23. PastaPastaPasta referenced this in commit cea9e1cf01 on Jul 24, 2019
  24. barrystyle referenced this in commit d1e75f33ac on Jan 22, 2020
  25. MarcoFalke 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-04-13 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me