On Fri, Apr 24, 2026 at 01:15:52PM +0800, Kevin J. McCarthy wrote:
Use getrandom() if available, or else arc4random_buf().  Only fall
back to using the built-in PRNG if those aren't found on the system.

For the sizes of data mutt typically requests, getrandom() should
never fail, but nonetheless add code to make it retry on interrupt,
and fall back to the built-in PRNG only if it has to.

FreeBSD and OpenBSD have rewritten arc4random() to use ChaCha20, which
should provide more than sufficient randomness.  The call has no
return value and always succeeds, so there is no error handling
written for it.

Many thanks to Werner Koch, Greg KH, Alejandro Colomar, and Kurt
Hackenberg for their feedback.

I've pushed this up.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to