MdePkg/DxeRngLib: Add gEfiRngAlgorithmArmRndr to the secure algorithms

DxeRngLib iterates over a list of secure algorithms before trying
to use the default algorithm provided by the Rng protocol. Add
gEfiRngAlgorithmArmRndr to this list. The algorithm represented by
this GUID is a secure DRBG of an unknown type, implemented by the
aarch64 RNDR instruction.
On AARCH64 platform, use the RNDR instruction as the first option
if it is available.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
This commit is contained in:
Pierre Gondois 2024-08-30 13:42:52 +02:00 committed by mergify[bot]
parent 5ed8f64647
commit 273f43cec9
2 changed files with 10 additions and 0 deletions

View File

@ -33,6 +33,13 @@ typedef struct {
// the RNG protocol and are generally considered secure.
//
GLOBAL_REMOVE_IF_UNREFERENCED SECURE_RNG_ALGO_ARRAY mSecureHashAlgorithms[] = {
#ifdef MDE_CPU_AARCH64
{
&gEfiRngAlgorithmArmRndr, // unspecified SP800-90A DRBG (through RNDR instr.)
"ARM-RNDR",
FALSE,
},
#endif
{
&gEfiRngAlgorithmSp80090Ctr256Guid, // SP800-90A DRBG CTR using AES-256
"DRBG-CTR",

View File

@ -40,5 +40,8 @@
gEfiRngAlgorithmSp80090Hmac256Guid
gEfiRngAlgorithmRaw
[Guids.AARCH64]
gEfiRngAlgorithmArmRndr
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdEnforceSecureRngAlgorithms ## CONSUMES