SecurityPkg/RngDxe: Add debug warning for NULL PcdCpuRngSupportedAlgorithm

PcdCpuRngSupportedAlgorithm should allow to identify the the algorithm
used by the RNDR CPU instruction to generate a random number.
Add a debug warning if the Pcd is not set.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Pierre Gondois 2022-10-28 17:32:56 +02:00 committed by mergify[bot]
parent 863fe9e191
commit 6cdddccf00
1 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,16 @@ GetAvailableAlgorithms (
sizeof (EFI_RNG_ALGORITHM)
);
mAvailableAlgoArrayCount++;
DEBUG_CODE_BEGIN ();
if (IsZeroGuid (PcdGetPtr (PcdCpuRngSupportedAlgorithm))) {
DEBUG ((
DEBUG_WARN,
"PcdCpuRngSupportedAlgorithm should be a non-zero GUID\n"
));
}
DEBUG_CODE_END ();
}
// Raw algorithm (Trng)