TianoCore EDK2 master
|
#include <PiDxe.h>
#include <Guid/Crc32GuidedSectionExtraction.h>
#include <Protocol/SecurityPolicy.h>
#include <Library/ExtractGuidedSectionLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
Go to the source code of this file.
Data Structures | |
struct | CRC32_SECTION_HEADER |
struct | CRC32_SECTION2_HEADER |
Functions | |
EFI_STATUS EFIAPI | Crc32GuidedSectionGetInfo (IN CONST VOID *InputSection, OUT UINT32 *OutputBufferSize, OUT UINT32 *ScratchBufferSize, OUT UINT16 *SectionAttribute) |
EFI_STATUS EFIAPI | Crc32GuidedSectionHandler (IN CONST VOID *InputSection, OUT VOID **OutputBuffer, IN VOID *ScratchBuffer OPTIONAL, OUT UINT32 *AuthenticationStatus) |
EFI_STATUS EFIAPI | DxeCrc32GuidedSectionExtractLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
This library registers CRC32 guided section handler to parse CRC32 encapsulation section and extract raw data. It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file DxeCrc32GuidedSectionExtractLib.c.
EFI_STATUS EFIAPI Crc32GuidedSectionGetInfo | ( | IN CONST VOID * | InputSection, |
OUT UINT32 * | OutputBufferSize, | ||
OUT UINT32 * | ScratchBufferSize, | ||
OUT UINT16 * | SectionAttribute | ||
) |
GetInfo gets raw data size and attribute of the input guided section. It first checks whether the input guid section is supported. If not, EFI_INVALID_PARAMETER will return.
InputSection | Buffer containing the input GUIDed section to be processed. |
OutputBufferSize | The size of OutputBuffer. |
ScratchBufferSize | The size of ScratchBuffer. |
SectionAttribute | The attribute of the input guided section. |
EFI_SUCCESS | The size of destination buffer, the size of scratch buffer and the attribute of the input section are successfully retrieved. |
EFI_INVALID_PARAMETER | The GUID in InputSection does not match this instance guid. |
Definition at line 51 of file DxeCrc32GuidedSectionExtractLib.c.
EFI_STATUS EFIAPI Crc32GuidedSectionHandler | ( | IN CONST VOID * | InputSection, |
OUT VOID ** | OutputBuffer, | ||
IN VOID *ScratchBuffer | OPTIONAL, | ||
OUT UINT32 * | AuthenticationStatus | ||
) |
Extraction handler tries to extract raw data from the input guided section. It also does authentication check for 32bit CRC value in the input guided section. It first checks whether the input guid section is supported. If not, EFI_INVALID_PARAMETER will return.
InputSection | Buffer containing the input GUIDed section to be processed. |
OutputBuffer | Buffer to contain the output raw data allocated by the caller. |
ScratchBuffer | A pointer to a caller-allocated buffer for function internal use. |
AuthenticationStatus | A pointer to a caller-allocated UINT32 that indicates the authentication status of the output buffer. |
EFI_SUCCESS | Section Data and Auth Status is extracted successfully. |
EFI_INVALID_PARAMETER | The GUID in InputSection does not match this instance guid. |
Definition at line 118 of file DxeCrc32GuidedSectionExtractLib.c.
EFI_STATUS EFIAPI DxeCrc32GuidedSectionExtractLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Register the handler to extract CRC32 guided section.
ImageHandle | ImageHandle of the loaded driver. |
SystemTable | Pointer to the EFI System Table. |
EFI_SUCCESS | Register successfully. |
EFI_OUT_OF_RESOURCES | No enough memory to register this handler. |
Definition at line 229 of file DxeCrc32GuidedSectionExtractLib.c.