MdePkg/Rng: Add GetRngGuid() to RngLib

The EFI_RNG_PROTOCOL can use the RngLib. The RngLib has multiple
implementations, some of them are unsafe (e.g. BaseRngLibTimerLib).
To allow the RngDxe to detect when such implementation is used,
add a GetRngGuid() function to the RngLib.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Kun Qin <kun.qin@microsoft.com>
This commit is contained in:
Pierre Gondois
2023-08-11 16:33:08 +02:00
committed by mergify[bot]
parent 414c0f2089
commit 5443c2dc31
9 changed files with 200 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
# BaseRng Library that uses CPU RNG instructions (e.g. RdRand) to
# provide random numbers.
#
# Copyright (c) 2023, Arm Limited. All rights reserved.<BR>
# Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
#
@@ -43,9 +44,18 @@
AArch64/ArmReadIdIsar0.asm | MSFT
AArch64/ArmRng.asm | MSFT
[Guids.AARCH64]
gEfiRngAlgorithmArmRndr
[Guids.Ia32, Guids.X64]
gEfiRngAlgorithmSp80090Ctr256Guid
[Packages]
MdePkg/MdePkg.dec
[Pcd.AARCH64]
gEfiMdePkgTokenSpaceGuid.PcdCpuRngSupportedAlgorithm
[LibraryClasses]
BaseLib
DebugLib