From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E5F6A7803D9 for ; Thu, 10 Aug 2023 13:34:32 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=hUwKiWWHz+qyYRSlgz8W78LET9GmtfNgNnt+XI/Gm7c=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1691674471; v=1; b=N8Er8N39Bl6dCM/3xPgVpb8y/KlUKE78Dgh4zMM+QaufOGvgcDsD0B10tTe4jSwtSJZBKRSs oawSHjVh+Bmo9PEI0FiHUS+qI33USiyFnFSh7x9cLqbrLeWmKRY+ci0bVQLI7NqUoSLOYS6V7u+ QjnZaOWLg5WVTsQpK1jYiiII= X-Received: by 127.0.0.2 with SMTP id Xn0gYY7687511xGzTW5OPTyT; Thu, 10 Aug 2023 06:34:31 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.14137.1691663482658086239 for ; Thu, 10 Aug 2023 03:31:23 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10797"; a="402325325" X-IronPort-AV: E=Sophos;i="6.01,162,1684825200"; d="scan'208";a="402325325" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2023 03:31:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10797"; a="797565191" X-IronPort-AV: E=Sophos;i="6.01,162,1684825200"; d="scan'208";a="797565191" X-Received: from pidsbabios007.gar.corp.intel.com ([10.66.244.202]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2023 03:31:19 -0700 From: Susovan Mohapatra To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Isaac Oram , Liming Gao , Eric Dong Subject: [edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg: Fix/Update code design gap. Date: Thu, 10 Aug 2023 16:00:52 +0530 Message-Id: <20230810103052.2647-1-susovan.mohapatra@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,susovan.mohapatra@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Hl9ISkVsgQiu0qPuKAwBFc1Fx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=N8Er8N39; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io https://bugzilla.tianocore.org/show_bug.cgi?id=3D4461 1. The function GetRandomNumber128() returns a boolean TRUE/FALSE. The existing code was getting data in EFI_STATUS.0=3D=3DFALSE=3D=3DEFI_S= UCCESS Updated code to check for the return value before proceeding further. 2. The 'seed' from the GetRandomNumber128() is in bits. Changed the copymem to the way it is done in other place in same code. Cc: Chasel Chiu Cc: Nate DeSimone Cc: Isaac Oram Cc: Liming Gao Cc: Eric Dong Signed-off-by: Susovan Mohapatra --- .../PeiDxeTpmPlatformHierarchyLib.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHie= rarchyLib/PeiDxeTpmPlatformHierarchyLib.c b/Platform/Intel/MinPlatformPkg/T= cg/Library/PeiDxeTpmPlatformHierarchyLib/PeiDxeTpmPlatformHierarchyLib.c index 9812ab99ab..b944c11cec 100644 --- a/Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarchyL= ib/PeiDxeTpmPlatformHierarchyLib.c +++ b/Platform/Intel/MinPlatformPkg/Tcg/Library/PeiDxeTpmPlatformHierarchyL= ib/PeiDxeTpmPlatformHierarchyLib.c @@ -61,11 +61,10 @@ RdRandGenerateEntropy ( // Generate high-quality seed for DRBG Entropy=0D //=0D while (BlockCount > 0) {=0D - Status =3D GetRandomNumber128 (Seed);=0D - if (EFI_ERROR (Status)) {=0D - return Status;=0D + if (!(GetRandomNumber128(Seed))) {=0D + return EFI_DEVICE_ERROR;=0D }=0D - CopyMem (Ptr, Seed, 64);=0D + CopyMem (Ptr, Seed, (Length % 64));=0D =0D BlockCount--;=0D Ptr =3D Ptr + 64;=0D --=20 2.39.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107690): https://edk2.groups.io/g/devel/message/107690 Mute This Topic: https://groups.io/mt/100663198/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-