summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorPierre Gondois <pierre.gondois@arm.com>2023-08-11 16:33:08 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-09-08 09:48:55 +0000
commit5443c2dc310d2c8eb15fb8eefd5057342e78cd0d (patch)
treed3ebde5ec7e19c6ab8e82712ff67db8a9530ac08 /MdePkg/Include
parent414c0f20896f3dec412135fa4260f8aad8bef246 (diff)
downloadedk2-5443c2dc310d2c8eb15fb8eefd5057342e78cd0d.tar.gz
edk2-5443c2dc310d2c8eb15fb8eefd5057342e78cd0d.tar.bz2
edk2-5443c2dc310d2c8eb15fb8eefd5057342e78cd0d.zip
MdePkg/Rng: Add GetRngGuid() to RngLib
The EFI_RNG_PROTOCOL can use the RngLib. The RngLib has multiple implementations, some of them are unsafe (e.g. BaseRngLibTimerLib). To allow the RngDxe to detect when such implementation is used, add a GetRngGuid() function to the RngLib. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Kun Qin <kun.qin@microsoft.com>
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Library/RngLib.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/MdePkg/Include/Library/RngLib.h b/MdePkg/Include/Library/RngLib.h
index 429ed19e28..945482cd5e 100644
--- a/MdePkg/Include/Library/RngLib.h
+++ b/MdePkg/Include/Library/RngLib.h
@@ -1,6 +1,7 @@
/** @file
Provides random number generator services.
+Copyright (c) 2023, Arm Limited. All rights reserved.<BR>
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -77,4 +78,20 @@ GetRandomNumber128 (
OUT UINT64 *Rand
);
+/**
+ Get a GUID identifying the RNG algorithm implementation.
+
+ @param [out] RngGuid If success, contains the GUID identifying
+ the RNG algorithm implementation.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_UNSUPPORTED Not supported.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+**/
+EFI_STATUS
+EFIAPI
+GetRngGuid (
+ GUID *RngGuid
+ );
+
#endif // __RNG_LIB_H__