Konstantin:
  I agree this change. CRC32 guid section doesn't set
EFI_GUIDED_SECTION_PROCESSING_REQUIRED. 
  It places CRC32 checksum in its guided header. When its data is verified,
its checksum and data will be required together. 

  Reviewed-by: Liming Gao <gaolim...@byosoft.com.cn>

Thanks
Liming
> -----邮件原件-----
> 发件人: Konstantin Aladyshev <aladyshe...@gmail.com>
> 发送时间: 2022年8月30日 18:15
> 收件人: devel@edk2.groups.io
> 抄送: bob.c.f...@intel.com; gaolim...@byosoft.com.cn;
> yuwei.c...@intel.com; Konstantin Aladyshev <aladyshe...@gmail.com>
> 主题: [PATCH 2/6] BaseTools/VolInfo: Correct buffer for GenCrc32 tool
> 
> 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.
> 
> Signed-off-by: Konstantin Aladyshev <aladyshe...@gmail.com>
> ---
>  BaseTools/Source/C/VolInfo/VolInfo.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> 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:
>            );
> 
>          free (ExtractionTool);
> 
> 
> 
> +        if (!CompareGuid (
> 
> +               EfiGuid,
> 
> +               &gEfiCrc32GuidedSectionExtractionProtocolGuid
> 
> +               )
> 
> +           ) {
> 
> +          DataOffset -= 4;
> 
> +        }
> 
>          Status =
> 
>            PutFileImage (
> 
>              ToolInputFile,
> 
> --
> 2.25.1





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#94383): https://edk2.groups.io/g/devel/message/94383
Mute This Topic: https://groups.io/mt/93942687/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to