mirror of https://github.com/acidanthera/audk.git
SecurityPkg : Fix Rsa2048Sha256GuidedSectionExtractLib issue
This issue causes section extraction overrun and possible hang due to bad output size calculation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Cohen, Eugene" <eugene@hp.com> Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18625 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
fcb636ea42
commit
3a2e6a740d
|
@ -86,7 +86,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
|
|||
//
|
||||
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;
|
||||
*ScratchBufferSize = 0;
|
||||
*OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
|
||||
*OutputBufferSize = SECTION2_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION2_HEADER);
|
||||
} else {
|
||||
//
|
||||
// Check whether the input guid section is recognized.
|
||||
|
@ -101,7 +101,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
|
|||
//
|
||||
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;
|
||||
*ScratchBufferSize = 0;
|
||||
*OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
|
||||
*OutputBufferSize = SECTION_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION_HEADER);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
|
|
@ -84,7 +84,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
|
|||
//
|
||||
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->Attributes;
|
||||
*ScratchBufferSize = 0;
|
||||
*OutputBufferSize = SECTION2_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION2 *) InputSection)->DataOffset;
|
||||
*OutputBufferSize = SECTION2_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION2_HEADER);
|
||||
} else {
|
||||
//
|
||||
// Check whether the input guid section is recognized.
|
||||
|
@ -99,7 +99,7 @@ Rsa2048Sha256GuidedSectionGetInfo (
|
|||
//
|
||||
*SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes;
|
||||
*ScratchBufferSize = 0;
|
||||
*OutputBufferSize = SECTION_SIZE (InputSection) - ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset;
|
||||
*OutputBufferSize = SECTION_SIZE (InputSection) - sizeof(RSA_2048_SHA_256_SECTION_HEADER);
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue