]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libc arc4_stir: use only kern.arandom sysctl
authoremaste <emaste@FreeBSD.org>
Mon, 3 Oct 2016 13:12:44 +0000 (13:12 +0000)
committeremaste <emaste@FreeBSD.org>
Mon, 3 Oct 2016 13:12:44 +0000 (13:12 +0000)
commitc9dbc4b9f3561daa9719556f585e3ac0bc6d6464
tree460b7c9c44dcf3f0f37aed314f427c441751a878
parentd04a24c19222485aac670535d3ecf6054a813eaa
libc arc4_stir: use only kern.arandom sysctl

The sysctl cannot fail. If it does fail on some FreeBSD derivative or
after some future change, just abort() so that the problem will be found
and fixed.

It's preferable to provide an arc4random() function that cannot fail and
cannot return poor quality random data. While abort() is not normally
suitable for a library, it makes sense here.

Reviewed by: ed, jonathan, markm
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8077
lib/libc/gen/arc4random.c