]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/RngDxe: Documentation/include/parameter cleanup
authorPierre Gondois <Pierre.Gondois@arm.com>
Fri, 28 Oct 2022 15:32:53 +0000 (17:32 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 6 Nov 2022 16:32:28 +0000 (16:32 +0000)
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>
SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c
SecurityPkg/RandomNumberGenerator/RngDxe/Rand/RngDxe.c
SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.c

index 6d989f7ea3765c4830961ed9b6f1bfaeaef64054..f9c740d761ff8fb4c07c0ce4af2b1166adafe418 100644 (file)
@@ -23,7 +23,6 @@
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/TimerLib.h>\r
 #include <Protocol/Rng.h>\r
 \r
 #include "RngDxeInternals.h"\r
@@ -61,7 +60,7 @@ RngGetRNG (
 {\r
   EFI_STATUS  Status;\r
 \r
-  if ((RNGValueLength == 0) || (RNGValue == NULL)) {\r
+  if ((This == NULL) || (RNGValueLength == 0) || (RNGValue == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index b2d2236380fd03954b9b4ed48d526d031d7abf76..8f5d8e740f5e41fe93fa447d151878b4882dfb24 100644 (file)
@@ -59,7 +59,7 @@ RngGetRNG (
 {\r
   EFI_STATUS  Status;\r
 \r
-  if ((RNGValueLength == 0) || (RNGValue == NULL)) {\r
+  if ((This == NULL) || (RNGValueLength == 0) || (RNGValue == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index 6608ca8804a5df89c37cfffe78b5b43114c04b2d..d7905a7f4d727761d008c30c462a5a7fe9fd2ff4 100644 (file)
@@ -23,7 +23,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/RngLib.h>\r
-#include <Library/TimerLib.h>\r
 #include <Protocol/Rng.h>\r
 \r
 #include "RngDxeInternals.h"\r
@@ -72,7 +71,7 @@ RngDriverEntry (
 }\r
 \r
 /**\r
-  Calls RDRAND to fill a buffer of arbitrary size with random bytes.\r
+  Runs CPU RNG instruction to fill a buffer of arbitrary size with random bytes.\r
 \r
   @param[in]   Length        Size of the buffer, in bytes,  to fill with.\r
   @param[out]  RandBuffer    Pointer to the buffer to store the random result.\r