audk/SecurityPkg/RandomNumberGenerator/RngDxe/Rand
Pierre Gondois 4b3e9d80be SecurityPkg/RngDxe: Check before advertising Cpu Rng algo
RngGetBytes() relies on the RngLib. The RngLib might use the RNDR
instruction if the FEAT_RNG feature is present. RngGetInfo and
RngGetRNG both must check that RngGetBytes() is working before
advertising/using it.

To do so, allocate an array storing the available algorithms.
The Rng algorithm at the lowest index will be the default Rng
algorithm. The array is shared between RngGetInfo and RngGetRNG.

This array is allocated when the driver is loaded, and freed
when unloaded.

This patch also prevents from having PcdCpuRngSupportedAlgorithm
let to a zero GUID, but let the possibility to have no valid Rng
algorithm in such case.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
2022-11-06 16:32:28 +00:00
..
AesCore.c SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
AesCore.h SecurityPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RdRand.c SecurityPkg/RngDxe: Rename RdRandGenerateEntropy to generic name 2022-11-06 16:32:28 +00:00
RngDxe.c SecurityPkg/RngDxe: Check before advertising Cpu Rng algo 2022-11-06 16:32:28 +00:00