switch arc4random to chacha

Konstantin Belousov kostikbel at gmail.com
Fri May 30 15:41:14 UTC 2014


On Thu, May 29, 2014 at 09:04:11PM -0400, Ted Unangst wrote:
> This syncs libc arc4random.c with OpenBSD, mostly to change the
> implementation to ChaCha20.
> 
> I removed the more complicated seed fetching code and changed it to
> just sysctl(). A quick check revealed that the FreeBSD kernel supports
> this for at least five years now. It's much simpler to use code that
> always works instead of a series of untested fallbacks that are even
> less likely to work.
> 
> Also removes the addrandom interface as a useless complication. If the
> kernel is incapable of properly seeding arc4random, application code
> can't do any better.
> 
> Unfortunately, I don't have any FreeBSD systems running at the moment,
> so I can't make any promises that this will even compile, but it
> passed the eyeball test.

Am I right that the patch removes arc4random_stir and
arc4random_addrandom symbols ?  If yes, this is done incorrect,
and it in fact is disallowed, since it breaks ABI.

The compat shims must be provided, possibly issuing a warning,
and default version for the symbols must be removed to prevent
linking new consumers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140530/d43af3d3/attachment.sig>


More information about the freebsd-hackers mailing list