TianoCore EDK2 master
Loading...
Searching...
No Matches
PeiRsa2048Sha256GuidedSectionExtractLib.c File Reference

Go to the source code of this file.

Data Structures

struct  RSA_2048_SHA_256_SECTION_HEADER
 
struct  RSA_2048_SHA_256_SECTION2_HEADER
 

Functions

EFI_STATUS EFIAPI Rsa2048Sha256GuidedSectionGetInfo (IN CONST VOID *InputSection, OUT UINT32 *OutputBufferSize, OUT UINT32 *ScratchBufferSize, OUT UINT16 *SectionAttribute)
 
EFI_STATUS EFIAPI Rsa2048Sha256GuidedSectionHandler (IN CONST VOID *InputSection, OUT VOID **OutputBuffer, IN VOID *ScratchBuffer OPTIONAL, OUT UINT32 *AuthenticationStatus)
 
EFI_STATUS EFIAPI PeiRsa2048Sha256GuidedSectionExtractLibConstructor (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)
 

Variables

CONST UINT8 mRsaE [] = { 0x01, 0x00, 0x01 }
 

Detailed Description

This library registers RSA 2048 SHA 256 guided section handler to parse RSA 2048 SHA 256 encapsulation section and extract raw data. It uses the BaseCryptLib based on OpenSSL to authenticate the signature.

Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PeiRsa2048Sha256GuidedSectionExtractLib.c.

Function Documentation

◆ PeiRsa2048Sha256GuidedSectionExtractLibConstructor()

EFI_STATUS EFIAPI PeiRsa2048Sha256GuidedSectionExtractLibConstructor ( IN EFI_PEI_FILE_HANDLE  FileHandle,
IN CONST EFI_PEI_SERVICES **  PeiServices 
)

Register the handler to extract RSA 2048 SHA 256 guided section.

Parameters
FileHandleThe handle of FFS header the loaded driver.
PeiServicesThe pointer to the PEI services.
Return values
EFI_SUCCESSRegister successfully.
EFI_OUT_OF_RESOURCESNot enough memory to register this handler.

Definition at line 389 of file PeiRsa2048Sha256GuidedSectionExtractLib.c.

◆ Rsa2048Sha256GuidedSectionGetInfo()

EFI_STATUS EFIAPI Rsa2048Sha256GuidedSectionGetInfo ( 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.

Parameters
InputSectionBuffer containing the input GUIDed section to be processed.
OutputBufferSizeThe size of OutputBuffer.
ScratchBufferSizeThe size of ScratchBuffer.
SectionAttributeThe attribute of the input guided section.
Return values
EFI_SUCCESSThe size of destination buffer, the size of scratch buffer and the attribute of the input section are successfully retrieved.
EFI_INVALID_PARAMETERThe GUID in InputSection does not match this instance guid.

Definition at line 60 of file PeiRsa2048Sha256GuidedSectionExtractLib.c.

◆ Rsa2048Sha256GuidedSectionHandler()

EFI_STATUS EFIAPI Rsa2048Sha256GuidedSectionHandler ( 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 RSA 2048 SHA 256 signature in the input guided section. It first checks whether the input guid section is supported. If not, EFI_INVALID_PARAMETER will return.

Parameters
InputSectionBuffer containing the input GUIDed section to be processed.
OutputBufferBuffer to contain the output raw data allocated by the caller.
ScratchBufferA pointer to a caller-allocated buffer for function internal use.
AuthenticationStatusA pointer to a caller-allocated UINT32 that indicates the authentication status of the output buffer.
Return values
EFI_SUCCESSSection Data and Auth Status is extracted successfully.
EFI_INVALID_PARAMETERThe GUID in InputSection does not match this instance guid.

Definition at line 127 of file PeiRsa2048Sha256GuidedSectionExtractLib.c.

Variable Documentation

◆ mRsaE

CONST UINT8 mRsaE[] = { 0x01, 0x00, 0x01 }

Public Exponent of RSA Key.

Definition at line 40 of file PeiRsa2048Sha256GuidedSectionExtractLib.c.