Message 267810 - Python tracker (original) (raw)

Larry, /dev/urandom blocks on BSD when it hasn't been seeded yet. But it looks like we can use sysctl to fetch the seed state from kern.random.sys.seeded.

https://www.freebsd.org/cgi/man.cgi?query=random&sektion=4

 The software generator will start in an unseeded state, and will block
 reads until it is (re)seeded.  This may cause trouble at system boot when
 keys and the like are generated from /dev/random so steps should be taken
 to	ensure a reseed	as soon	as possible.  The sysctl(8) controlling	the
 seeded status (see	below) may be used if security is not an issue or for
 convenience during	setup or development.