Skip to content

Commit dff92b8

Browse files
pierregondoissamimujawar
authored andcommitted
Platform/ARM/Juno: Use DxeRngLib.inf as default RngLib implementation
Juno's RngLib implementation is: - BaseRngLib.inf if a secure RngLib is enforced - BaseRngLibTimerLib.inf if a non-secure RngLib is tolerated BaseRngLib.inf relies on the Arm's RNDR instruction. The instruction returns a DRBG-generated random number. The DRBG used is considered as secure. The RNDR instruction is available if FEAT_RNG is set. The Juno doesn't support it. When security is enforced (i.e. ENABLE_UNSAFE_RNGLIB is not set), the Juno cannot generate secure random numbers through the RngLib. Secure random numbers could be generated by using the Juno's TRNG. This can be done by: - using the RngDxeLib implementation of the RngLib - RngDxeLib relies on the RngDxe - the RngDxe has access to the TRNG Signed-off-by: Pierre Gondois <[email protected]>
1 parent 4dbd5e5 commit dff92b8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Platform/ARM/JunoPkg/ArmJuno.dsc

+14
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
# Trng Supports.
4646
ArmMonitorLib|ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf
4747
ArmTrngLib|ArmPkg/Library/ArmTrngLib/ArmTrngLib.inf
48+
# Rng
49+
RngLib|MdePkg/Library/DxeRngLib/DxeRngLib.inf
4850

4951
NorFlashDeviceLib|Platform/ARM/Library/P30NorFlashDeviceLib/P30NorFlashDeviceLib.inf
5052
NorFlashPlatformLib|Platform/ARM/JunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
@@ -407,6 +409,18 @@
407409
# SCMI Driver
408410
ArmPkg/Drivers/ArmScmiDxe/ArmScmiDxe.inf
409411
412+
#
413+
# Rng
414+
#
415+
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf {
416+
<LibraryClasses>
417+
!if $(ENABLE_UNSAFE_RNGLIB) == TRUE
418+
RngLib|MdeModulePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
419+
!else
420+
RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf
421+
!endif
422+
}
423+
410424
[Components.AARCH64]
411425
#
412426
# EBC

0 commit comments

Comments
 (0)