]> diplodocus.org Git - nmh/commit
rand()/srand() are not cryptographically secure PRNGs. Some systems
authorPascal Stumpf <Pascal.Stumpf@cubes.de>
Sat, 14 Dec 2013 00:57:57 +0000 (18:57 -0600)
committerDavid Levine <levinedl@acm.org>
Sat, 14 Dec 2013 00:57:57 +0000 (18:57 -0600)
commit3800e2f1d7cbd085f8faf8df6141f92e8ee0617e
tree567f6729a9885270328dd0516c769e47ed9db5a0
parent27659f0aa30c07081f7b8647c51a6ca82837e5d1
rand()/srand() are not cryptographically secure PRNGs.  Some systems
have the much better suited arc4random() family of functions; there's
no reason to not use it if it is available.  Make m_rand() just a
wrapper around arc4random_buf() in that case.  (There's no need to
ever seed it manually.)

As a bonus, silences some warnings on OpenBSD.
configure.ac
sbr/m_rand.c