diff options
author | Pierre Gondois <Pierre.Gondois@arm.com> | 2022-10-28 17:32:53 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-11-06 16:32:28 +0000 |
commit | 199031b2b0233652ad5d5fdf73f0f44c0f264d55 (patch) | |
tree | 187bb004d85a22fde6ae7410f979e95acece2fcc /SecurityPkg/RandomNumberGenerator | |
parent | 922bf317f1731554b3e77a0a48033a38fdc75a77 (diff) | |
download | edk2-199031b2b0233652ad5d5fdf73f0f44c0f264d55.zip edk2-199031b2b0233652ad5d5fdf73f0f44c0f264d55.tar.gz edk2-199031b2b0233652ad5d5fdf73f0f44c0f264d55.tar.bz2 |
SecurityPkg/RngDxe: Documentation/include/parameter cleanup
This patch:
-Update RngGetBytes() documentation to align the function
definition and declaration.
-Improve input parameter checking. Even though 'This'
it is not used, the parameter should always point to the
current EFI_RNG_PROTOCOL.
-Removes TimerLib inclusion as unused.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Acked-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'SecurityPkg/RandomNumberGenerator')
-rw-r--r-- | SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c | 3 | ||||
-rw-r--r-- | SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c | 2 | ||||
-rw-r--r-- | SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c | 3 |
3 files changed, 3 insertions, 5 deletions
diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c b/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c index 6d989f7..f9c740d 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c @@ -23,7 +23,6 @@ #include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
-#include <Library/TimerLib.h>
#include <Protocol/Rng.h>
#include "RngDxeInternals.h"
@@ -61,7 +60,7 @@ RngGetRNG ( {
EFI_STATUS Status;
- if ((RNGValueLength == 0) || (RNGValue == NULL)) {
+ if ((This == NULL) || (RNGValueLength == 0) || (RNGValue == NULL)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c index b2d2236..8f5d8e7 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c @@ -59,7 +59,7 @@ RngGetRNG ( {
EFI_STATUS Status;
- if ((RNGValueLength == 0) || (RNGValue == NULL)) {
+ if ((This == NULL) || (RNGValueLength == 0) || (RNGValue == NULL)) {
return EFI_INVALID_PARAMETER;
}
diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c index 6608ca8..d7905a7 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c @@ -23,7 +23,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/RngLib.h>
-#include <Library/TimerLib.h>
#include <Protocol/Rng.h>
#include "RngDxeInternals.h"
@@ -72,7 +71,7 @@ RngDriverEntry ( }
/**
- Calls RDRAND to fill a buffer of arbitrary size with random bytes.
+ Runs CPU RNG instruction to fill a buffer of arbitrary size with random bytes.
@param[in] Length Size of the buffer, in bytes, to fill with.
@param[out] RandBuffer Pointer to the buffer to store the random result.
|