diff options
author | Matthew Carlson <macarl@microsoft.com> | 2020-07-23 14:59:23 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-09-18 02:19:21 +0000 |
commit | b5701a4c7a0fb185e0c5b9db9525939c78664bfd (patch) | |
tree | 17a85cc5e165a691dad4b10ffa901ed6d07cc9ca /CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c | |
parent | 416813753726bbf7c962c423246633cd703ae7c5 (diff) | |
download | edk2-b5701a4c7a0fb185e0c5b9db9525939c78664bfd.tar.gz edk2-b5701a4c7a0fb185e0c5b9db9525939c78664bfd.tar.bz2 edk2-b5701a4c7a0fb185e0c5b9db9525939c78664bfd.zip |
CryptoPkg: OpensslLib: Use RngLib to generate entropy in rand_pool
Ref: https://github.com/tianocore/edk2/pull/845
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1871
Changes OpenSSL to no longer depend on TimerLib and instead use RngLib.
This allows platforms to decide for themsevles what sort of entropy source
they provide to OpenSSL and TlsLib.
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com>
Diffstat (limited to 'CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c')
-rw-r--r-- | CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c b/CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c deleted file mode 100644 index 4158106231..0000000000 --- a/CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c +++ /dev/null @@ -1,43 +0,0 @@ -/** @file
- Provide rand noise source.
-
-Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
-SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/TimerLib.h>
-
-/**
- Get 64-bit noise source
-
- @param[out] Rand Buffer pointer to store 64-bit noise source
-
- @retval TRUE Get randomness successfully.
- @retval FALSE Failed to generate
-**/
-BOOLEAN
-EFIAPI
-GetRandomNoise64 (
- OUT UINT64 *Rand
- )
-{
- UINT32 Index;
- UINT32 *RandPtr;
-
- if (NULL == Rand) {
- return FALSE;
- }
-
- RandPtr = (UINT32 *)Rand;
-
- for (Index = 0; Index < 2; Index ++) {
- *RandPtr = (UINT32) ((AsmReadTsc ()) & 0xFF);
- RandPtr++;
- MicroSecondDelay (10);
- }
-
- return TRUE;
-}
|