On Thu, 24 Nov 2022 at 17:18, <Pierre.Gondois@...> wrote:
From: Pierre Gondois <pierre.gondois@...>
- Reformulate commit message.
- Do not warn if no algorithm is found as the message
would be printed on non-Arm platforms.
- Add the following patches:
1. ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor()
Requested by Ard.
2. SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
Do not install EFI_RNG_PROTOCOL if no RNG algorithm is available.
3. SecurityPkg/RngDxe: Fix Rng algo selection for Arm
Coming from v2 patch being split.
Some issues were found by Ard/Sami on the RngDxe/ArmTrngLib after
recent patches were merged. This patch serie intends to fix them.
Pierre Gondois (4):
ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor()
Thanks for the fixed
Reviewed-by: Ard Biesheuvel <ardb@...>
I pushed this one as #3663 (pending CI verification atm)
SecurityPkg/RngDxe: Correctly update mAvailableAlgoArrayCount
SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
SecurityPkg/RngDxe: Fix Rng algo selection for Arm
The remaining code still looks a bit clunky to me. Can't we just
return an error from the library constructor of the library cannot
initialize due to a missing prerequisite?
ArmPkg/Library/ArmTrngLib/ArmTrngLib.c | 5 -----
.../RandomNumberGenerator/RngDxe/ArmRngDxe.c | 18 +++++-------------
.../RngDxe/Rand/RngDxe.c | 9 ++++++++-
.../RandomNumberGenerator/RngDxe/RngDxe.c | 19 ++++++++++++++-----
4 files changed, 27 insertions(+), 24 deletions(-)