Seed insecure_rand during start #8903

pull crowning- wants to merge 1 commits into bitcoin:master from crowning-:patch-1 changing 1 files +3 −0
  1. crowning- commented at 1:18 PM on October 9, 2016: contributor

    I've noticed that (besides the Bitcoin test-code) insecure_rand() is only properly (=non-deterministic) seeded when a new transaction is created, which might be after it's already used. Seeding it here should ensure that current and futures usages don't accidentally start with the default seed.

  2. Seed insecure_rand during start
    I've noticed that (besides the Bitcoin test-code) `insecure_rand()` is only properly (=non-deterministic) seeded when a new transaction is created, which might be _after_ it's already used.
    Seeding it here should ensure that current and futures usages don't accidentally start with the default seed.
    3f6cdac684
  3. JeremyRubin commented at 2:07 PM on October 9, 2016: contributor

    This might be out of scope for what you want to do with this PR, but I think if you're trying to fix initialization to guarantee insecure_rand has good entropy it may also be worth trying to fix the race conditions in insecure_rand (there are a few that I've looked at).

  4. laanwj commented at 2:37 PM on October 9, 2016: member

    Not against this change, but I wouldn't suggest doing too much work for insecure_rand:

    • It's called insecure_rand because it shouldn't be used for anything requiring security, it shouldn't matter for its use case if it generates the same sequence every time. If anything does that is a bug.
    • One current goal is to replace replace the OpenSSL PRNG with built-in Fortuna implementation - as Fortuna is so fast it will also be used for insecure_rand, see #5885
  5. laanwj commented at 7:44 AM on October 15, 2016: member

    Closing in favor of #8914

  6. laanwj closed this on Oct 15, 2016

  7. crowning- deleted the branch on Nov 9, 2016
  8. DrahtBot 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 18:15 UTC

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