nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Use arc4random_buf() if available

2013-12-13 19:16:44
Pascal wrote:

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.

Verified that configure picks arc4random() on OpenBSD and
FreeBSD.

Test suite passes on all platforms.

Patch committed.

Thank you!

David

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>