]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/RngDxe.c
SecurityPkg/RngDxe: Remove ArchGetSupportedRngAlgorithms()
[mirror_edk2.git] / SecurityPkg / RandomNumberGenerator / RngDxe / AArch64 / RngDxe.c
index 3daf847d46d357ac9ef2e10337da7ee6e7878787..6d989f7ea3765c4830961ed9b6f1bfaeaef64054 100644 (file)
@@ -14,6 +14,7 @@
   Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>\r
   Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+  Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.<BR>\r
 \r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -85,6 +86,7 @@ RngGetRNG (
 /**\r
   Returns information about the random number generation implementation.\r
 \r
+  @param[in]     This                 A pointer to the EFI_RNG_PROTOCOL instance.\r
   @param[in,out] RNGAlgorithmListSize On input, the size in bytes of RNGAlgorithmList.\r
                                       On output with a return code of EFI_SUCCESS, the size\r
                                       in bytes of the data returned in RNGAlgorithmList. On output\r
@@ -97,14 +99,19 @@ RngGetRNG (
                                       is the default algorithm for the driver.\r
 \r
   @retval EFI_SUCCESS                 The RNG algorithm list was returned successfully.\r
+  @retval EFI_UNSUPPORTED             The services is not supported by this driver.\r
+  @retval EFI_DEVICE_ERROR            The list of algorithms could not be retrieved due to a\r
+                                      hardware or firmware error.\r
+  @retval EFI_INVALID_PARAMETER       One or more of the parameters are incorrect.\r
   @retval EFI_BUFFER_TOO_SMALL        The buffer RNGAlgorithmList is too small to hold the result.\r
 \r
 **/\r
-UINTN\r
+EFI_STATUS\r
 EFIAPI\r
-ArchGetSupportedRngAlgorithms (\r
-  IN OUT UINTN              *RNGAlgorithmListSize,\r
-  OUT    EFI_RNG_ALGORITHM  *RNGAlgorithmList\r
+RngGetInfo (\r
+  IN EFI_RNG_PROTOCOL    *This,\r
+  IN OUT UINTN           *RNGAlgorithmListSize,\r
+  OUT EFI_RNG_ALGORITHM  *RNGAlgorithmList\r
   )\r
 {\r
   UINTN              RequiredSize;\r
@@ -112,6 +119,10 @@ ArchGetSupportedRngAlgorithms (
 \r
   RequiredSize = sizeof (EFI_RNG_ALGORITHM);\r
 \r
+  if ((This == NULL) || (RNGAlgorithmListSize == NULL)) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
   if (*RNGAlgorithmListSize < RequiredSize) {\r
     *RNGAlgorithmListSize = RequiredSize;\r
     return EFI_BUFFER_TOO_SMALL;\r