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)
Jan 2 2025, 8:42 PM
Unknown Object (File)
Dec 19 2024, 9:43 PM
Unknown Object (File)
Nov 15 2024, 7:37 AM
Unknown Object (File)
Nov 14 2024, 9:32 AM
Unknown Object (File)
Nov 8 2024, 1:18 AM
Unknown Object (File)
Oct 31 2024, 11:47 PM
Unknown Object (File)
Oct 31 2024, 11:38 PM
Unknown Object (File)
Oct 13 2024, 11:34 AM
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.