]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
Cumulative update to arc4random(3).
authordelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Jun 2014 00:15:07 +0000 (00:15 +0000)
committerdelphij <delphij@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Jun 2014 00:15:07 +0000 (00:15 +0000)
commit778fd2979efd96be6fbe6ef22bfed012edb9f42c
tree9dcba96771e60814bf3dce5426cdbb078efa4db3
parent70f7cf607bf1bfef23ddadb6d253134b3076469c
Cumulative update to arc4random(3).

MFC r227519, r227520, r238118, r241046:

r227519 (das)

Sync the style, comments, and variable names of arc4random.c with
OpenBSD's version (r1.22).  No functional changes, as verified with
md5.

r227520 (das)

Further reduce diffs with OpenBSD's arc4random.  The main functional
change here is to ensure that when a process forks after arc4random
is seeded, the parent and child don't observe the same random sequence.
OpenBSD's fix introduces some additional overhead in the form of a
getpid() call.

The only significant remaining difference between our arc4random and
OpenBSD's is in how we seed the generator in arc4_stir().

r238118 (pjd):

Prefer sysctl to open/read/close for obtaining random data.

This method is more sandbox-friendly and also should be faster as only
one syscall is needed instead of three.
In case of an error fall back to the old method.

r241046 (jilles)

libc: Use O_CLOEXEC for various internal file descriptors.

Approved by: re (gjb)

git-svn-id: svn://svn.freebsd.org/base/stable/9@267379 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/gen/arc4random.c