]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/RngDxe: Replace Pcd with Sp80090Ctr256Guid
authorPierre Gondois <pierre.gondois@arm.com>
Fri, 28 Oct 2022 15:32:51 +0000 (17:32 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 6 Nov 2022 16:32:28 +0000 (16:32 +0000)
gEfiRngAlgorithmSp80090Ctr256Guid was used as the default algorithm
in RngGetRNG(). The commit below set the default algorithm to
PcdCpuRngSupportedAlgorithm, which is a zero GUID by default.

As the Pcd value is not defined for any platform in the edk2-platfoms
repository, assume it was an error and go back to the first version,
using gEfiRngAlgorithmSp80090Ctr256Guid.

Fixes: 4e5ecdbac8bd ("SecurityPkg: Add support for RngDxe on AARCH64")
Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c

index 8d44f0636c3dae17c5886fa79f303824915535ee..df7db12b771cd6ff2ffa59d7e14373a34bac4253 100644 (file)
@@ -126,8 +126,7 @@ ArchGetSupportedRngAlgorithms (
   OUT    EFI_RNG_ALGORITHM  *RNGAlgorithmList\r
   )\r
 {\r
-  UINTN              RequiredSize;\r
-  EFI_RNG_ALGORITHM  *CpuRngSupportedAlgorithm;\r
+  UINTN  RequiredSize;\r
 \r
   RequiredSize = 2 * sizeof (EFI_RNG_ALGORITHM);\r
 \r
@@ -136,9 +135,7 @@ ArchGetSupportedRngAlgorithms (
     return EFI_BUFFER_TOO_SMALL;\r
   }\r
 \r
-  CpuRngSupportedAlgorithm = PcdGetPtr (PcdCpuRngSupportedAlgorithm);\r
-\r
-  CopyMem (&RNGAlgorithmList[0], CpuRngSupportedAlgorithm, sizeof (EFI_RNG_ALGORITHM));\r
+  CopyMem (&RNGAlgorithmList[0], &gEfiRngAlgorithmSp80090Ctr256Guid, sizeof (EFI_RNG_ALGORITHM));\r
 \r
   // x86 platforms also support EFI_RNG_ALGORITHM_RAW via RDSEED\r
   CopyMem (&RNGAlgorithmList[1], &gEfiRngAlgorithmRaw, sizeof (EFI_RNG_ALGORITHM));\r