Page MenuHomeFreeBSD

arc4random(3): Reduce diff with OpenBSD.
ClosedPublic

Authored by delphij on Aug 9 2022, 6:48 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 11, 11:11 AM
Unknown Object (File)
Tue, Nov 11, 9:08 AM
Unknown Object (File)
Tue, Nov 11, 7:05 AM
Unknown Object (File)
Wed, Nov 5, 12:05 PM
Unknown Object (File)
Wed, Nov 5, 1:35 AM
Unknown Object (File)
Wed, Nov 5, 12:57 AM
Unknown Object (File)
Mon, Nov 3, 1:01 PM
Unknown Object (File)
Wed, Oct 29, 9:46 PM
Subscribers

Details

Summary

The main change was v1.57 by djm@:

Randomise the rekey interval a little. Previously, the chacha20
instance would be rekeyed every 1.6MB. This makes it happen at a
random point somewhere in the 1-2MB range.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

r1.56 -- Not revalent to us
r1.57 -- the main change
r1.58 -- indent fix (follow up of r1.57)

This is mostly for diff reduction; the rs_count value of 1600000 was an arbitrary value.

With the change, we would use the entropy obtained from kernel to create a "fuzz" value for the initial rs_count when doing stir, the new rs_count would now be in range of [1048576,2097151]. This makes the stir interval less predicable for a very small cost for each stir.

This revision is now accepted and ready to land.Aug 9 2022, 8:12 AM
cem added a subscriber: cem.

As mentioned in email, we might also consider publishing a seed generation to the VDSO page from Fortuna.

This revision was automatically updated to reflect the committed changes.