On 25/06/2017 14:28, Kamil Rytarowski wrote:
On 25.06.2017 14:06, Martin Husemann wrote:You can also read random bytes from /dev/urandom. MartinRight this is the most portable solution right now. I don't think RANDOM_BITS or similar is currently useful, it will grow incompatible extension - better to prompt POSIX to standardize something.
Don't count on that happening soon. http://austingroupbugs.net/view.php?id=859dhcpcd ships with the the original OpenBSD version of arc4random that seeds off urandom if it cannot detect it in libc in configure. It also has arc4random_uniform as well.
All modern BSD's have arc4random (and most have arc4random_uniform) - some use something more modern like ChaCha, so it's just an interface really.
Just like sh, dhcpcd can start very early .... sometimwes before enough entropy has been generated just to pull blindly from /dev/urandom because it can block - or did in the past; it might be fixed now.
Roy