read rng seed from random number source device

Linux and BSD system have random number source devices that can be used
as source for a unguessable seed source.

Other platforms fall back to generate the seed with gettime().
This commit is contained in:
Patric Mueller
2019-01-11 19:08:22 +01:00
parent 1083971228
commit 86d694c61b
4 changed files with 56 additions and 13 deletions

View File

@@ -408,5 +408,18 @@
# define RUNTIME_PASTEBUF_SUPPORT
#endif
/*
* /dev/random is blocking on Linux, so there we default to /dev/urandom which
* should still be good enough.
* BSD systems usually have /dev/random that is supposed to be used.
*/
#ifdef LINUX
# define DEV_RANDOM "/dev/urandom"
#else
# ifdef BSD
# define DEV_RANDOM "/dev/random"
# endif
#endif
#endif /* UNIXCONF_H */
#endif /* UNIX */