From nobody Thu Oct 31 23:46:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+107690+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107690+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1691674471; cv=none; d=zohomail.com; s=zohoarc; b=WmWWg1yoFo9oMVdJKmkKWjw/jetjj7yzsGyhVFqZm+9Y/zoebxb150nF62D2vrT823EJk0T4xy+lUShkaJ47W3pzozjU8XgTjB2SWpuALibBC/pCqw5HKk+ESsrwPEXVozufN4klFWYpi2iVOPDeJcVUzelPC/IIoMRJA4+E3LQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691674471; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=+Yr+aDElBFRAENmU7GhdNhQ7GI7v68oox6PA4fMJuZ8=; b=leSo9xCex2AE3BZJ4Nksd39xXM5sTmHMpPj+nmyc9/cw4ZjHwS5lfXM2uVDcofOqmnqxiwYlO3VBNOwAIw02IO/FKi3W2sfWzBSPgiHLs+hnCas0noZOh/0bW2rELKzWZRRVPQEdPhDyPQyhbJfcufvTxWxcVNkYL6mBYY9bQXI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107690+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1691674471870992.8076327170968; Thu, 10 Aug 2023 06:34:31 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=YfQfz56busSbs+DtbjFvL8zeEUMYwJ9n3o9YRcwO8XQ=; 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=OZmSE9ABWB1SfjgI0y+5U1Bct04pa1l0E8mMl/j5PWMoRxJs0YESOvu6h1iOUx54bGKVPvQA dCcF/JV6MH2HsAkNWvM9XQxEYDwCxSXLwdMc7NzT521jTL8U7wu/KEHlyCCwWXskcUTauQzWMJT xmtVXDufTEUL3egWN+qwhirY= X-Received: by 127.0.0.2 with SMTP id v8quYY1788612x6nbRTjhfHP; 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: seTcF0ZmYzyoUyvkTRxWwAbzx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1691674473006100003 Content-Type: text/plain; charset="utf-8" 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 // while (BlockCount > 0) { - Status =3D GetRandomNumber128 (Seed); - if (EFI_ERROR (Status)) { - return Status; + if (!(GetRandomNumber128(Seed))) { + return EFI_DEVICE_ERROR; } - CopyMem (Ptr, Seed, 64); + CopyMem (Ptr, Seed, (Length % 64)); =20 BlockCount--; Ptr =3D Ptr + 64; --=20 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-