mirror of https://github.com/acidanthera/audk.git
SecurityPkg/RngDxe: add rng test
Check whenever RngLib actually returns random numbers, only return a non-zero number of Algorithms if that is the case. This has the effect that RndDxe loads and installs EFI_RNG_PROTOCOL only in case it can actually deliver random numbers. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
6ca9334dc8
commit
01bf6c6c9b
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/RngLib.h>
|
||||||
|
|
||||||
#include "RngDxeInternals.h"
|
#include "RngDxeInternals.h"
|
||||||
|
|
||||||
|
@ -43,7 +44,12 @@ GetAvailableAlgorithms (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
UINT64 RngTest;
|
||||||
|
|
||||||
|
if (GetRandomNumber64 (&RngTest)) {
|
||||||
mAvailableAlgoArrayCount = RNG_ALGORITHM_COUNT;
|
mAvailableAlgoArrayCount = RNG_ALGORITHM_COUNT;
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue