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)
Tue, Apr 15, 10:01 PM
Unknown Object (File)
Tue, Apr 15, 10:01 PM
Unknown Object (File)
Tue, Apr 15, 10:00 PM
Unknown Object (File)
Tue, Apr 15, 10:00 PM
Unknown Object (File)
Feb 17 2025, 6:13 AM
Unknown Object (File)
Jan 29 2025, 2:54 PM
Unknown Object (File)
Dec 31 2024, 11:00 PM
Unknown Object (File)
Dec 30 2024, 11:04 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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19339
Build 18944: arc lint + arc unit

Event Timeline

delphij added a subscriber: delphij.

Looks reasonable.

sys/dev/random/random_harvestq.c
421

@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

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

sys/dev/random/random_harvestq.c
421

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.