HomeFreeBSD

random(4): deduplicate explicit_bzero() in harvest

Description

random(4): deduplicate explicit_bzero() in harvest

Pull the responsibility for zeroing events, which is general to any
conceivable implementation of a random device algorithm, out of the
algorithm-specific Fortuna code and into the callers. Most callers
indirect through random_fortuna_process_event(), so add the logic there.
Most callers already explicitly bzeroed the events they provided, so the
logic in Fortuna was mostly redundant.

Add one missing bzero in randomdev_accumulate(). Also, remove a redundant
bzero in the same function -- randomdev_hash_finish() is obliged to bzero
the hash state.

Reviewed by: delphij
Approved by: secteam(delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20318

(cherry picked from commit 00e0e488a023967ad9a650f64cb4d77ec83a812d)

Details

Provenance
cemAuthored on May 23 2019, 9:02 PM
obrienCommitted on Feb 14 2022, 2:01 AM
Reviewer
delphij
Differential Revision
D20318: random(4): deduplicate explicit_bzero() in harvest
Parents
rG5740196b0d68: APEI: Make sure event data fit into the buffer.
Branches
Unknown
Tags
Unknown