HomeFreeBSD

rc.d/random: add support for zero harvest_mask

Description

rc.d/random: add support for zero harvest_mask

Replace the check for zero harvest_mask with new check for empty string.
This allows one to specify harvest_mask="0" that disables harversting
entropy from all but "pure" sources. Exact bit values for "pure" sources
differ for stable/12 and later branches, so it is handy to use zero.
The check for zero pre-dates introduction of "pure" non-maskable sources
Use empty string to disable altering sysctl kern.random.harvest.mask.

Note that notion of "pure" random sources is not documented in user level
manual pages yet. Still, it helps to extend battery life for hardware
with embedded "Intel Secure Key RNG" by disabling all other sources.

Note that no defaults changed and default behaviour is not affected.

Reported by: Dmitry Luhtionov

Details

Provenance
eugen_grosbein.netAuthored on May 26 2021, 11:30 AM
Parents
R10:905d192d6f16: Unstaticize parts of coredumping code
Branches
Unknown
Tags
Unknown