Page MenuHomeFreeBSD

random(4): Correct a bare zero to the appropriate enum
ClosedPublic

Authored by cem on Sep 1 2018, 4:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 29, 6:08 AM
Unknown Object (File)
Feb 20 2024, 3:22 AM
Unknown Object (File)
Dec 20 2023, 1:00 AM
Unknown Object (File)
Dec 14 2023, 10:37 PM
Unknown Object (File)
Nov 10 2023, 9:46 AM
Unknown Object (File)
Nov 6 2023, 9:25 PM
Unknown Object (File)
Oct 5 2023, 8:24 PM
Unknown Object (File)
Sep 30 2023, 8:29 PM
Subscribers

Details

Summary

The convention for updating hc_destination[] is to index with a
random_entropy_source. Zero happens to match RANDOM_CACHED, which is
correct for this source (early random data). Spell the zero value as the
enum name instead of the magic constant.

No functional change.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

delphij added a subscriber: delphij.

Looks reasonable.

sys/dev/random/random_harvestq.c
421 ↗(On Diff #47555)

@markm -- Why is this explicit_bzero() done here in the loop instead of done below (e.g. line 423)?

This revision is now accepted and ready to land.Sep 1 2018, 5:54 AM
markm added inline comments.
sys/dev/random/random_harvestq.c
421 ↗(On Diff #47555)

Over-paranoia, I guess. I wouldn't object to it moving.

sys/dev/random/random_harvestq.c
421 ↗(On Diff #47555)

One other caveat is that random_harvestq_fast_process_event -> random_fortuna_process_event() also explicit_bzeros the event in the loop already.

This revision was automatically updated to reflect the committed changes.