Break random_harvestq_prime up into some logical subroutines.
No functional change.
The goal is that it becomes easier to add other early entropy sources.
Differential D22482
random(4): Abstract loader entropy injection cem on Nov 21 2019, 6:02 PM. Authored by Tags None Referenced Files
Details
Break random_harvestq_prime up into some logical subroutines. No functional change. The goal is that it becomes easier to add other early entropy sources.
Diff Detail
Event TimelineComment Actions I think the proposed change actually does change the code behavior slightly. What the old code does is basically "if we don't see an object of type 'boot_entropy_cache', try looking up the one with type '/boot/entropy' instead". The new code validates both whether the object of 'boot_entroy_cache' is preloaded (existing behavior), and if the loaded object was sane (newly added behavior; previously we would not check the sanity before proceeding further, and it seemed to be reasonable because the expectation was that the type is either boot_entropy_cache, or '/boot/entropy' and the loaded file would be the same one). The compatibility code wrapped in the NO_BACKWARD_COMPATIBILITY block was delivered in 12.0-RELEASE, but we didn't issued a warning that "please please update your /boot/defaults/loader.conf now" in the fallback case (we should have done that ~3 years ago, but now it's probably less relevant). I would suggest that we simply delete that compatibility shim instead: it wasn't the intention to support both types permanently, and the code is already short enough to fit in one page. |