NetworkPkg: Do not enforce secure RNG #66
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since edk2-stable202405 we require EFI_RNG_PROTOCOL (RNG=Random Number Generator) for various network stack drivers.
We can't avoid requiring the protocol, but we do not want to insist that a secure algorithm is present. If we do leave the Pcd TRUE, DxeNetLib logs at level DEBUG_ERROR when using OVMF
-device virtio-rng-pci
(even though the supported RNG protocols check eventually succeeds), and it may do the same with the available Rng in various firmware too (and there, the RN generation may not succeed, if none of the required algos are present; even if some other RNG algorithm is present).Believe this is probably a change we want to make, for ease of use of OVMF (as above) and our shipped network drivers (which need to run on any firmware).
EDIT: This change is no longer required for ease of use of OVMF - the 202408 EDK 2 commit mentioned below fixes that; but I think we still want to be able to use whatever the existing RNG is (whether or not is is secure) with our network stack on other firmware - probably? Perhaps not - in which case maybe forget this change (i.e. if a user's firmware has only RNG considered insecure, then they will need to load RngDxe.efi).
EDIT: Obviously if compiling custom firmware which is supposed to include a secure algorithm, this value can and should be switched back to its previous default. (Note that in that case, it makes sense to downgrade this line from DEBUG_ERROR, a change which on checking now I find has already been introduced in edk2-stable202408 tianocore/edk2@6862b9d, see also tianocore/edk2#6171.)