From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mx.groups.io with SMTP id smtpd.web11.1528.1598981633446541126 for ; Tue, 01 Sep 2020 10:33:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fYJ1Fzb8; spf=pass (domain: gmail.com, ip: 209.85.216.52, mailfrom: matthewfcarlson@gmail.com) Received: by mail-pj1-f52.google.com with SMTP id nv17so973013pjb.3 for ; Tue, 01 Sep 2020 10:33:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/J1owDvTZ+BhSHvtII1reNSvzeCHBYRAHMLcFa6UOXk=; b=fYJ1Fzb8zgca9Mwsvc27xwb/uhFV2JijEUyccagndmXK322h04B9t2UkVq6YaWsywY rseT8IVYq79ZPETkU83iGkvxCC2LicLfegZ9lK4ObrNCOxVbjmk10k9Wc3DAx4XCuUjg xfq5g2KWzY0dfAiOWxUyVKpxyqF9oKaxRSmwFrLAZlkhstHiX/azInk8Vv4XNGObS3h1 4dazVSJoOSdwQ+SBRKqngZgMAsv/TNuhbtrcM7lEqMCvWYbMTJb7OyjG3ySUuP4Gw+mV Orch1fBsu7i6UBIgTuqNJ640sKsBIgNFlcG85I6uCFrBZR7o4DEqILjr6AB9Gbi/qHbV KhCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/J1owDvTZ+BhSHvtII1reNSvzeCHBYRAHMLcFa6UOXk=; b=OSNmaeeFDtuPNtrgreN+ldj0Zar83ZaQ9uNWEcuMRKWc+4F5jQHccjtDNO6rvzGvsc qCbk7c5r32cotsVZ6ePNhmPWGLSL834RoeU4yllmKLQLP6AlKJ6m+aJ6JmBlTq80mIY/ RApsRDXSP8vjSB7Fs+X112XOPZyRJoCcald+N/nraL0u6x3VPaxgjZOXUhc0lhFloEF/ XP/c6cuOvLxFjADKXkOz7k89TzNRUNoxsPeWYmWKxuruWkdvet9dhjApTNeaVi5Q6HE0 1XeOkPY+vkGyf8WHguB9CIoe4NfBW+tMKQ2TVyzsDFH1DlAZizkVJuMqmnVBwtzrdHLC 1Dhg== X-Gm-Message-State: AOAM533Eb8Q0apQQHvCHCyXDb90wUGpEDWgRYr5bk0dWy7JI9Cp38pCw qUlWdEy1mh4ty++6iZvV6OBUHbWqmO1OUZ4J X-Google-Smtp-Source: ABdhPJz7eQSMPhSSHKk847NYdbaaX7X/e2aQxFEkF8+n9TaWKDRelW6qOzP1mj7vnvzcVTwZP/uQMA== X-Received: by 2002:a17:902:7602:: with SMTP id k2mr2237967pll.97.1598981632605; Tue, 01 Sep 2020 10:33:52 -0700 (PDT) Return-Path: Received: from tvis-name-05.localdomain ([50.34.58.90]) by smtp.gmail.com with ESMTPSA id 205sm2729842pfz.14.2020.09.01.10.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 10:33:52 -0700 (PDT) From: "Matthew Carlson" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jian J Wang , Xiaoyu Lu , Jiewen Yao , Matthew Carlson Subject: [PATCH v10 5/5] CryptoPkg: OpensslLib: Use RngLib to generate entropy in rand_pool Date: Tue, 1 Sep 2020 10:33:46 -0700 Message-Id: <20200901173346.676-6-matthewfcarlson@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20200901173346.676-1-matthewfcarlson@gmail.com> References: <20200901173346.676-1-matthewfcarlson@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Matthew Carlson Ref: https://github.com/tianocore/edk2/pull/845 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1871 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 Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Acked-by: Ard Biesheuvel Reviewed-by: Jiewen Yao Signed-off-by: Matthew Carlson --- CryptoPkg/Library/OpensslLib/rand_pool.c | 269 +++++------------= --- CryptoPkg/Library/OpensslLib/rand_pool_noise.c | 29 --- CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c | 43 ---- CryptoPkg/CryptoPkg.ci.yaml | 4 +- CryptoPkg/CryptoPkg.dsc | 1 + CryptoPkg/Library/OpensslLib/OpensslLib.inf | 15 +- CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf | 15 +- CryptoPkg/Library/OpensslLib/rand_pool_noise.h | 29 --- 8 files changed, 68 insertions(+), 337 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/rand_pool.c b/CryptoPkg/Library/O= pensslLib/rand_pool.c index 9e0179b03490..6218ae0c1cd7 100644 --- a/CryptoPkg/Library/OpensslLib/rand_pool.c +++ b/CryptoPkg/Library/OpensslLib/rand_pool.c @@ -2,8 +2,8 @@ OpenSSL_1_1_1b doesn't implement rand_pool_* functions for UEFI.=0D The file implement these functions.=0D =0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D + Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D =0D @@ -11,53 +11,18 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D =0D #include =0D -#include =0D -=0D -#include "rand_pool_noise.h"=0D -=0D -/**=0D - Get some randomness from low-order bits of GetPerformanceCounter results= .=0D - And combine them to the 64-bit value=0D -=0D - @param[out] Rand Buffer pointer to store the 64-bit random value.=0D -=0D - @retval TRUE Random number generated successfully.=0D - @retval FALSE Failed to generate.=0D -**/=0D -STATIC=0D -BOOLEAN=0D -EFIAPI=0D -GetRandNoise64FromPerformanceCounter(=0D - OUT UINT64 *Rand=0D - )=0D -{=0D - UINT32 Index;=0D - UINT32 *RandPtr;=0D -=0D - if (NULL =3D=3D Rand) {=0D - return FALSE;=0D - }=0D -=0D - RandPtr =3D (UINT32 *) Rand;=0D -=0D - for (Index =3D 0; Index < 2; Index ++) {=0D - *RandPtr =3D (UINT32) (GetPerformanceCounter () & 0xFF);=0D - MicroSecondDelay (10);=0D - RandPtr++;=0D - }=0D -=0D - return TRUE;=0D -}=0D +#include =0D =0D /**=0D Calls RandomNumber64 to fill=0D a buffer of arbitrary size with random bytes.=0D + This is a shim layer to RngLib.=0D =0D @param[in] Length Size of the buffer, in bytes, to fill with.= =0D @param[out] RandBuffer Pointer to the buffer to store the random res= ult.=0D =0D - @retval EFI_SUCCESS Random bytes generation succeeded.=0D - @retval EFI_NOT_READY Failed to request random bytes.=0D + @retval TRUE Random bytes generation succeeded.=0D + @retval FALSE Failed to request random bytes.=0D =0D **/=0D STATIC=0D @@ -65,7 +30,7 @@ BOOLEAN EFIAPI=0D RandGetBytes (=0D IN UINTN Length,=0D - OUT UINT8 *RandBuffer=0D + OUT UINT8 *RandBuffer=0D )=0D {=0D BOOLEAN Ret;=0D @@ -73,17 +38,17 @@ RandGetBytes ( =0D Ret =3D FALSE;=0D =0D + if (RandBuffer =3D=3D NULL) {=0D + DEBUG((DEBUG_ERROR, "[OPENSSL_RAND_POOL] NULL RandBuffer. No random nu= mbers are generated and your system is not secure\n"));=0D + ASSERT (RandBuffer !=3D NULL); // Since we can't generate random numbe= rs, we should assert. Otherwise we will just blow up later.=0D + return Ret;=0D + }=0D +=0D +=0D while (Length > 0) {=0D - //=0D - // Get random noise from platform.=0D - // If it failed, fallback to PerformanceCounter=0D - // If you really care about security, you must override=0D - // GetRandomNoise64FromPlatform.=0D - //=0D - Ret =3D GetRandomNoise64 (&TempRand);=0D - if (Ret =3D=3D FALSE) {=0D - Ret =3D GetRandNoise64FromPerformanceCounter (&TempRand);=0D - }=0D + // Use RngLib to get random number=0D + Ret =3D GetRandomNumber64 (&TempRand);=0D +=0D if (!Ret) {=0D return Ret;=0D }=0D @@ -91,7 +56,8 @@ RandGetBytes ( *((UINT64*) RandBuffer) =3D TempRand;=0D RandBuffer +=3D sizeof (UINT64);=0D Length -=3D sizeof (TempRand);=0D - } else {=0D + }=0D + else {=0D CopyMem (RandBuffer, &TempRand, Length);=0D Length =3D 0;=0D }=0D @@ -100,125 +66,6 @@ RandGetBytes ( return Ret;=0D }=0D =0D -/**=0D - Creates a 128bit random value that is fully forward and backward predict= ion resistant,=0D - suitable for seeding a NIST SP800-90 Compliant.=0D - This function takes multiple random numbers from PerformanceCounter to e= nsure reseeding=0D - and performs AES-CBC-MAC over the data to compute the seed value.=0D -=0D - @param[out] SeedBuffer Pointer to a 128bit buffer to store the rando= m seed.=0D -=0D - @retval TRUE Random seed generation succeeded.=0D - @retval FALSE Failed to request random bytes.=0D -=0D -**/=0D -STATIC=0D -BOOLEAN=0D -EFIAPI=0D -RandGetSeed128 (=0D - OUT UINT8 *SeedBuffer=0D - )=0D -{=0D - BOOLEAN Ret;=0D - UINT8 RandByte[16];=0D - UINT8 Key[16];=0D - UINT8 Ffv[16];=0D - UINT8 Xored[16];=0D - UINT32 Index;=0D - UINT32 Index2;=0D - AES_KEY AESKey;=0D -=0D - //=0D - // Chose an arbitrary key and zero the feed_forward_value (FFV)=0D - //=0D - for (Index =3D 0; Index < 16; Index++) {=0D - Key[Index] =3D (UINT8) Index;=0D - Ffv[Index] =3D 0;=0D - }=0D -=0D - AES_set_encrypt_key (Key, 16 * 8, &AESKey);=0D -=0D - //=0D - // Perform CBC_MAC over 32 * 128 bit values, with 10us gaps between 128 = bit value=0D - // The 10us gaps will ensure multiple reseeds within the system time wit= h a large=0D - // design margin.=0D - //=0D - for (Index =3D 0; Index < 32; Index++) {=0D - MicroSecondDelay (10);=0D - Ret =3D RandGetBytes (16, RandByte);=0D - if (!Ret) {=0D - return Ret;=0D - }=0D -=0D - //=0D - // Perform XOR operations on two 128-bit value.=0D - //=0D - for (Index2 =3D 0; Index2 < 16; Index2++) {=0D - Xored[Index2] =3D RandByte[Index2] ^ Ffv[Index2];=0D - }=0D -=0D - AES_encrypt (Xored, Ffv, &AESKey);=0D - }=0D -=0D - for (Index =3D 0; Index < 16; Index++) {=0D - SeedBuffer[Index] =3D Ffv[Index];=0D - }=0D -=0D - return Ret;=0D -}=0D -=0D -/**=0D - Generate high-quality entropy source.=0D -=0D - @param[in] Length Size of the buffer, in bytes, to fill with.=0D - @param[out] Entropy Pointer to the buffer to store the entropy da= ta.=0D -=0D - @retval EFI_SUCCESS Entropy generation succeeded.=0D - @retval EFI_NOT_READY Failed to request random data.=0D -=0D -**/=0D -STATIC=0D -BOOLEAN=0D -EFIAPI=0D -RandGenerateEntropy (=0D - IN UINTN Length,=0D - OUT UINT8 *Entropy=0D - )=0D -{=0D - BOOLEAN Ret;=0D - UINTN BlockCount;=0D - UINT8 Seed[16];=0D - UINT8 *Ptr;=0D -=0D - BlockCount =3D Length / 16;=0D - Ptr =3D (UINT8 *) Entropy;=0D -=0D - //=0D - // Generate high-quality seed for DRBG Entropy=0D - //=0D - while (BlockCount > 0) {=0D - Ret =3D RandGetSeed128 (Seed);=0D - if (!Ret) {=0D - return Ret;=0D - }=0D - CopyMem (Ptr, Seed, 16);=0D -=0D - BlockCount--;=0D - Ptr =3D Ptr + 16;=0D - }=0D -=0D - //=0D - // Populate the remained data as request.=0D - //=0D - Ret =3D RandGetSeed128 (Seed);=0D - if (!Ret) {=0D - return Ret;=0D - }=0D - CopyMem (Ptr, Seed, (Length % 16));=0D -=0D - return Ret;=0D -}=0D -=0D /*=0D * Add random bytes to the pool to acquire requested amount of entropy=0D *=0D @@ -227,27 +74,31 @@ RandGenerateEntropy ( *=0D * This is OpenSSL required interface.=0D */=0D -size_t rand_pool_acquire_entropy(RAND_POOL *pool)=0D +size_t=0D +rand_pool_acquire_entropy (=0D + RAND_POOL *pool=0D + )=0D {=0D - BOOLEAN Ret;=0D - size_t bytes_needed;=0D - unsigned char * buffer;=0D + BOOLEAN Ret;=0D + size_t Bytes_needed;=0D + unsigned char *Buffer;=0D =0D - bytes_needed =3D rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);=0D - if (bytes_needed > 0) {=0D - buffer =3D rand_pool_add_begin(pool, bytes_needed);=0D + Bytes_needed =3D rand_pool_bytes_needed (pool, 1 /*entropy_factor*/);=0D + if (Bytes_needed > 0) {=0D + Buffer =3D rand_pool_add_begin (pool, Bytes_needed);=0D =0D - if (buffer !=3D NULL) {=0D - Ret =3D RandGenerateEntropy(bytes_needed, buffer);=0D + if (Buffer !=3D NULL) {=0D + Ret =3D RandGetBytes (Bytes_needed, Buffer);=0D if (FALSE =3D=3D Ret) {=0D - rand_pool_add_end(pool, 0, 0);=0D - } else {=0D - rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed);=0D + rand_pool_add_end (pool, 0, 0);=0D + }=0D + else {=0D + rand_pool_add_end (pool, Bytes_needed, 8 * Bytes_needed);=0D }=0D }=0D }=0D =0D - return rand_pool_entropy_available(pool);=0D + return rand_pool_entropy_available (pool);=0D }=0D =0D /*=0D @@ -255,17 +106,15 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool) *=0D * This is OpenSSL required interface.=0D */=0D -int rand_pool_add_nonce_data(RAND_POOL *pool)=0D +int=0D +rand_pool_add_nonce_data (=0D + RAND_POOL *pool=0D + )=0D {=0D - struct {=0D - UINT64 Rand;=0D - UINT64 TimerValue;=0D - } data =3D { 0 };=0D + UINT8 data[16];=0D + RandGetBytes (sizeof(data), data);=0D =0D - RandGetBytes(8, (UINT8 *)&(data.Rand));=0D - data.TimerValue =3D GetPerformanceCounter();=0D -=0D - return rand_pool_add(pool, (unsigned char*)&data, sizeof(data), 0);=0D + return rand_pool_add (pool, (unsigned char*)&data, sizeof(data), 0);=0D }=0D =0D /*=0D @@ -273,17 +122,15 @@ int rand_pool_add_nonce_data(RAND_POOL *pool) *=0D * This is OpenSSL required interface.=0D */=0D -int rand_pool_add_additional_data(RAND_POOL *pool)=0D +int=0D +rand_pool_add_additional_data (=0D + RAND_POOL *pool=0D + )=0D {=0D - struct {=0D - UINT64 Rand;=0D - UINT64 TimerValue;=0D - } data =3D { 0 };=0D -=0D - RandGetBytes(8, (UINT8 *)&(data.Rand));=0D - data.TimerValue =3D GetPerformanceCounter();=0D + UINT8 data[16];=0D + RandGetBytes (sizeof(data), data);=0D =0D - return rand_pool_add(pool, (unsigned char*)&data, sizeof(data), 0);=0D + return rand_pool_add (pool, (unsigned char*)&data, sizeof(data), 0);=0D }=0D =0D /*=0D @@ -291,7 +138,10 @@ int rand_pool_add_additional_data(RAND_POOL *pool) *=0D * This is OpenSSL required interface.=0D */=0D -int rand_pool_init(void)=0D +int=0D +rand_pool_init (=0D + VOID=0D + )=0D {=0D return 1;=0D }=0D @@ -301,7 +151,10 @@ int rand_pool_init(void) *=0D * This is OpenSSL required interface.=0D */=0D -void rand_pool_cleanup(void)=0D +VOID=0D +rand_pool_cleanup(=0D + VOID=0D + )=0D {=0D }=0D =0D @@ -310,7 +163,9 @@ void rand_pool_cleanup(void) *=0D * This is OpenSSL required interface.=0D */=0D -void rand_pool_keep_random_devices_open(int keep)=0D +VOID=0D +rand_pool_keep_random_devices_open (=0D + int keep=0D + )=0D {=0D }=0D -=0D diff --git a/CryptoPkg/Library/OpensslLib/rand_pool_noise.c b/CryptoPkg/Lib= rary/OpensslLib/rand_pool_noise.c deleted file mode 100644 index 212834e27acc..000000000000 --- a/CryptoPkg/Library/OpensslLib/rand_pool_noise.c +++ /dev/null @@ -1,29 +0,0 @@ -/** @file=0D - Provide rand noise source.=0D -=0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -=0D -/**=0D - Get 64-bit noise source=0D -=0D - @param[out] Rand Buffer pointer to store 64-bit noise source=0D -=0D - @retval FALSE Failed to generate=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -GetRandomNoise64 (=0D - OUT UINT64 *Rand=0D - )=0D -{=0D - //=0D - // Return FALSE will fallback to use PerformanceCounter to=0D - // generate noise.=0D - //=0D - return FALSE;=0D -}=0D 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 4158106231fd..000000000000 --- a/CryptoPkg/Library/OpensslLib/rand_pool_noise_tsc.c +++ /dev/null @@ -1,43 +0,0 @@ -/** @file=0D - Provide rand noise source.=0D -=0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Get 64-bit noise source=0D -=0D - @param[out] Rand Buffer pointer to store 64-bit noise source=0D -=0D - @retval TRUE Get randomness successfully.=0D - @retval FALSE Failed to generate=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -GetRandomNoise64 (=0D - OUT UINT64 *Rand=0D - )=0D -{=0D - UINT32 Index;=0D - UINT32 *RandPtr;=0D -=0D - if (NULL =3D=3D Rand) {=0D - return FALSE;=0D - }=0D -=0D - RandPtr =3D (UINT32 *)Rand;=0D -=0D - for (Index =3D 0; Index < 2; Index ++) {=0D - *RandPtr =3D (UINT32) ((AsmReadTsc ()) & 0xFF);=0D - RandPtr++;=0D - MicroSecondDelay (10);=0D - }=0D -=0D - return TRUE;=0D -}=0D diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml index e2d190a90c51..2ade777aadc5 100644 --- a/CryptoPkg/CryptoPkg.ci.yaml +++ b/CryptoPkg/CryptoPkg.ci.yaml @@ -18,7 +18,9 @@ ],=0D ## Both file path and directory path are accepted.=0D "IgnoreFiles": [=0D - "Library/OpensslLib/openssl"=0D + "Library/OpensslLib/openssl",=0D + # this has OpenSSL interfaces that aren't UEFI spec compliant= =0D + "Library/OpensslLib/rand_pool.c"=0D ]=0D },=0D "CompilerPlugin": {=0D diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc index 1af78468a19c..0490eeb7e22f 100644 --- a/CryptoPkg/CryptoPkg.dsc +++ b/CryptoPkg/CryptoPkg.dsc @@ -60,6 +60,7 @@ BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf=0D TlsLib|CryptoPkg/Library/TlsLibNull/TlsLibNull.inf=0D HashApiLib|CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf=0D + RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf=0D =0D [LibraryClasses.ARM, LibraryClasses.AARCH64]=0D #=0D diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Librar= y/OpensslLib/OpensslLib.inf index cc27b8c57cb3..b00bb74ce67e 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -571,22 +571,9 @@ $(OPENSSL_PATH)/ssl/statem/statem_local.h=0D # Autogenerated files list ends here=0D buildinf.h=0D - rand_pool_noise.h=0D ossl_store.c=0D rand_pool.c=0D =0D -[Sources.Ia32]=0D - rand_pool_noise_tsc.c=0D -=0D -[Sources.X64]=0D - rand_pool_noise_tsc.c=0D -=0D -[Sources.ARM]=0D - rand_pool_noise.c=0D -=0D -[Sources.AARCH64]=0D - rand_pool_noise.c=0D -=0D [Packages]=0D MdePkg/MdePkg.dec=0D CryptoPkg/CryptoPkg.dec=0D @@ -594,7 +581,7 @@ [LibraryClasses]=0D BaseLib=0D DebugLib=0D - TimerLib=0D + RngLib=0D PrintLib=0D =0D [LibraryClasses.ARM]=0D diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/= Library/OpensslLib/OpensslLibCrypto.inf index 616ccd9f62d1..3557711bd85a 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf @@ -520,22 +520,9 @@ $(OPENSSL_PATH)/crypto/x509v3/v3_admis.h=0D # Autogenerated files list ends here=0D buildinf.h=0D - rand_pool_noise.h=0D ossl_store.c=0D rand_pool.c=0D =0D -[Sources.Ia32]=0D - rand_pool_noise_tsc.c=0D -=0D -[Sources.X64]=0D - rand_pool_noise_tsc.c=0D -=0D -[Sources.ARM]=0D - rand_pool_noise.c=0D -=0D -[Sources.AARCH64]=0D - rand_pool_noise.c=0D -=0D [Packages]=0D MdePkg/MdePkg.dec=0D CryptoPkg/CryptoPkg.dec=0D @@ -543,7 +530,7 @@ [LibraryClasses]=0D BaseLib=0D DebugLib=0D - TimerLib=0D + RngLib=0D PrintLib=0D =0D [LibraryClasses.ARM]=0D diff --git a/CryptoPkg/Library/OpensslLib/rand_pool_noise.h b/CryptoPkg/Lib= rary/OpensslLib/rand_pool_noise.h deleted file mode 100644 index 75acc686a9f1..000000000000 --- a/CryptoPkg/Library/OpensslLib/rand_pool_noise.h +++ /dev/null @@ -1,29 +0,0 @@ -/** @file=0D - Provide rand noise source.=0D -=0D -Copyright (c) 2019, Intel Corporation. All rights reserved.
=0D -SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef __RAND_POOL_NOISE_H__=0D -#define __RAND_POOL_NOISE_H__=0D -=0D -#include =0D -=0D -/**=0D - Get 64-bit noise source.=0D -=0D - @param[out] Rand Buffer pointer to store 64-bit noise source=0D -=0D - @retval TRUE Get randomness successfully.=0D - @retval FALSE Failed to generate=0D -**/=0D -BOOLEAN=0D -EFIAPI=0D -GetRandomNoise64 (=0D - OUT UINT64 *Rand=0D - );=0D -=0D -=0D -#endif // __RAND_POOL_NOISE_H__=0D --=20 2.28.0.windows.1