[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] Use arc4random_buf() if available
From: |
David Levine |
Subject: |
Re: [Nmh-workers] Use arc4random_buf() if available |
Date: |
Fri, 13 Dec 2013 20:16:12 -0500 |
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