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

Details

Provenance
cemAuthored on
Reviewer
delphij
Differential Revision
D20318: random(4): deduplicate explicit_bzero() in harvest
Parents
rS348198: uart_cpu_acpi: Fix GCC build break from r348195
Branches
Unknown
Tags
Unknown