From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web10.6642.1664247056271504064 for ; Mon, 26 Sep 2022 19:50:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=MTAWpSan; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id C674BCD1F722 for ; Tue, 27 Sep 2022 10:50:52 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1664247052; bh=Pz3M/dgZ2a2PnUW4g2xlgCfMOAbBZCZUPdnkHUjsRSE=; h=From:To:Cc:References:In-Reply-To:Subject:Date; b=MTAWpSandXlQ3xLUvlXY5mMskBZR2Rqo98zFJxdXiJx/JRqUwUP8dff4W3iRyKPjQ OBf26AUsgBplYUCU9M63VwvLKF3cL0Xx+us7BQNEsZLmq62FTE4BvU6BvkR6dRx/H2 JPbUW45KfCpOncL6dRC8PBIpdhA4IV0ibgwVwfnQ= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id C2780CD1F736 for ; Tue, 27 Sep 2022 10:50:52 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 98D58CD1F708 for ; Tue, 27 Sep 2022 10:50:52 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id 356C0CD1F76D for ; Tue, 27 Sep 2022 10:50:49 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Tue, 27 Sep 2022 10:50:48 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Konstantin Aladyshev'" , Cc: , References: <20220830101445.18110-1-aladyshev22@gmail.com> <20220830101445.18110-2-aladyshev22@gmail.com> In-Reply-To: <20220830101445.18110-2-aladyshev22@gmail.com> Subject: =?UTF-8?B?5Zue5aSNOiBbUEFUQ0ggMi82XSBCYXNlVG9vbHMvVm9sSW5mbzogQ29ycmVjdCBidWZmZXIgZm9yIEdlbkNyYzMyIHRvb2w=?= Date: Tue, 27 Sep 2022 10:50:48 +0800 Message-ID: <018201d8d21b$f2d895e0$d889c1a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHf+CdSH0LadR4kzkTaUnpF39v2rAEor9ADrdsA3CA= Sender: "gaoliming" Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Konstantin: I agree this change. CRC32 guid section doesn't set EFI_GUIDED_SECTION_PROCESSING_REQUIRED.=20 It places CRC32 checksum in its guided header. When its data is = verified, its checksum and data will be required together.=20 Reviewed-by: Liming Gao Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: Konstantin Aladyshev > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA8=D4=C230=C8=D5 18:15 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: bob.c.feng@intel.com; gaoliming@byosoft.com.cn; > yuwei.chen@intel.com; Konstantin Aladyshev > =D6=F7=CC=E2: [PATCH 2/6] BaseTools/VolInfo: Correct buffer for = GenCrc32 tool >=20 > If the guided section was encoded with GenCrc32 tool the resulting > 'EFI_GUID_DEFINED_SECTION.DataOffset' field points to the start of > the meaningfull data that follows the CRC32 value. > But if we want to decode the section with GenCrc32 tool we need to > provide a buffer that includes the CRC32 value itself. >=20 > Signed-off-by: Konstantin Aladyshev > --- > BaseTools/Source/C/VolInfo/VolInfo.c | 7 +++++++ > 1 file changed, 7 insertions(+) >=20 > diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c > b/BaseTools/Source/C/VolInfo/VolInfo.c > index b5760d185e..4628e756d7 100644 > --- a/BaseTools/Source/C/VolInfo/VolInfo.c > +++ b/BaseTools/Source/C/VolInfo/VolInfo.c > @@ -2009,6 +2009,13 @@ Returns: > ); >=20 > free (ExtractionTool); >=20 >=20 >=20 > + if (!CompareGuid ( >=20 > + EfiGuid, >=20 > + &gEfiCrc32GuidedSectionExtractionProtocolGuid >=20 > + ) >=20 > + ) { >=20 > + DataOffset -=3D 4; >=20 > + } >=20 > Status =3D >=20 > PutFileImage ( >=20 > ToolInputFile, >=20 > -- > 2.25.1