diff options
Diffstat (limited to 'SecurityPkg')
-rw-r--r-- | SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c b/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c index 78a18c5..7a42e3c 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c @@ -77,7 +77,6 @@ RngGetRNG ( )
{
EFI_STATUS Status;
- UINTN Index;
GUID RngGuid;
if ((This == NULL) || (RNGValueLength == 0) || (RNGValue == NULL)) {
@@ -88,21 +87,13 @@ RngGetRNG ( //
// Use the default RNG algorithm if RNGAlgorithm is NULL.
//
- for (Index = 0; Index < mAvailableAlgoArrayCount; Index++) {
- if (!IsZeroGuid (&mAvailableAlgoArray[Index])) {
- RNGAlgorithm = &mAvailableAlgoArray[Index];
- goto FoundAlgo;
- }
- }
-
- if (Index == mAvailableAlgoArrayCount) {
- // No algorithm available.
- ASSERT (Index != mAvailableAlgoArrayCount);
- return EFI_DEVICE_ERROR;
+ if (mAvailableAlgoArrayCount != 0) {
+ RNGAlgorithm = &mAvailableAlgoArray[0];
+ } else {
+ return EFI_UNSUPPORTED;
}
}
-FoundAlgo:
Status = GetRngGuid (&RngGuid);
if (!EFI_ERROR (Status) &&
CompareGuid (RNGAlgorithm, &RngGuid))
|