mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcAppleImageVerification: Fix function prototype
A callee should never free caller data for design reasons. Return the caller parameter in the future if it is ever required for any other API.
This commit is contained in:
parent
268ae1b544
commit
2cac6fd25f
@ -85,8 +85,7 @@ GetApplePeImageSha256 (
|
||||
EFI_STATUS
|
||||
VerifyApplePeImageSignature (
|
||||
IN OUT VOID *PeImage,
|
||||
IN OUT UINTN *ImageSize,
|
||||
IN OUT APPLE_PE_COFF_LOADER_IMAGE_CONTEXT *Context OPTIONAL
|
||||
IN OUT UINTN *ImageSize
|
||||
);
|
||||
|
||||
#endif //APPLE_DXE_IMAGE_VERIFICATION_H
|
||||
|
||||
@ -581,31 +581,26 @@ GetApplePeImageSha256 (
|
||||
EFI_STATUS
|
||||
VerifyApplePeImageSignature (
|
||||
IN OUT VOID *PeImage,
|
||||
IN OUT UINTN *ImageSize,
|
||||
IN OUT APPLE_PE_COFF_LOADER_IMAGE_CONTEXT *Context OPTIONAL
|
||||
IN OUT UINTN *ImageSize
|
||||
)
|
||||
{
|
||||
UINTN Index = 0;
|
||||
APPLE_SIGNATURE_CONTEXT *SignatureContext = NULL;
|
||||
OC_RSA_PUBLIC_KEY *Pk = NULL;
|
||||
UINTN Index = 0;
|
||||
APPLE_SIGNATURE_CONTEXT *SignatureContext = NULL;
|
||||
OC_RSA_PUBLIC_KEY *Pk = NULL;
|
||||
APPLE_PE_COFF_LOADER_IMAGE_CONTEXT *Context = NULL;
|
||||
|
||||
//
|
||||
// Build context if not present
|
||||
//
|
||||
Context = AllocateZeroPool (sizeof (APPLE_PE_COFF_LOADER_IMAGE_CONTEXT));
|
||||
if (Context == NULL) {
|
||||
Context = AllocateZeroPool (sizeof (APPLE_PE_COFF_LOADER_IMAGE_CONTEXT));
|
||||
if (Context == NULL) {
|
||||
DEBUG ((DEBUG_WARN, "Pe context allocation failure\n"));
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
//
|
||||
// Build PE context
|
||||
//
|
||||
if (EFI_ERROR (BuildPeContext (PeImage, *ImageSize, Context))) {
|
||||
DEBUG ((DEBUG_WARN, "Malformed ApplePeImage\n"));
|
||||
FreePool (Context);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
DEBUG ((DEBUG_WARN, "Pe context allocation failure\n"));
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
//
|
||||
// Build PE context
|
||||
//
|
||||
if (EFI_ERROR (BuildPeContext (PeImage, *ImageSize, Context))) {
|
||||
DEBUG ((DEBUG_WARN, "Malformed ApplePeImage\n"));
|
||||
FreePool (Context);
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user