Verified PEI to DXE Handoff: Data Structures

Verified PEI to DXE Handoff rev. 7
  • Main Page
  • Data Structures
  • Files
  • Data Structures
  • Data Structure Index
Data Structures
Here are the data structures with brief descriptions:
C _AMI_FFS_COMMON_SECTION_HEADER |
C _AMI_FV_DIGEST_INFO_HOB | AMI FvDxe signature hashed address list HOB
C _AMI_FV_DIGEST_PPI |
C _AMI_FV_DXE_VALIDATE_PPI |
C _AMI_PUBLISH_FV_DXE_PPI |
C PEI_CRYPT_HANDLE |
Generated on Wed Dec 30 2020 10:12:10 for Verified PEI to DXE Handoff by doxygen 1.8.7


Verified PEI to DXE Handoff: _AMI_FFS_COMMON_SECTION_HEADER Struct Reference

  • Files
  • Data Structures
  • Data Structure Index
Data Fields
_AMI_FFS_COMMON_SECTION_HEADER Struct Reference

Data Fields

EFI_FFS_FILE_HEADER | FfsHdr
EFI_FREEFORM_SUBTYPE_GUID_SECTION | GuidedSection
APTIO_FW_CAPSULE_HEADER | pFvSigHeader [0]
The documentation for this struct was generated from the following files:
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidatePpi.c
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: _AMI_FV_DIGEST_INFO_HOB Struct Reference

  • Data Structures
  • Data Structure Index
Data Fields
_AMI_FV_DIGEST_INFO_HOB Struct Reference

AMI FvDxe signature hashed address list HOB. More...

Data Fields

EFI_HOB_GUID_TYPE | Header
AMI_FV_DIGEST_PPI | FvDigestPpi
UINTN | LenListOffs

Detailed Description

AMI FvDxe signature hashed address list HOB.

The documentation for this struct was generated from the following file:
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: _AMI_FV_DIGEST_PPI Struct Reference

  • Data Structures
  • Data Structure Index
Data Fields
_AMI_FV_DIGEST_PPI Struct Reference

Data Fields

UINTN | HashElemCnt
UINTN | HashSize
AMI_TDXE_ALG_ID | HashAlgId
UINTN * | AddrList
UINTN * | LenList
UINTN * | HashList
UINT8 | FvHash [64]
The documentation for this struct was generated from the following file:
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include/Ppi/AmiFvDigest.h


Verified PEI to DXE Handoff: _AMI_FV_DXE_VALIDATE_PPI Struct Reference

  • Data Structures
  • Data Structure Index
Data Fields
_AMI_FV_DXE_VALIDATE_PPI Struct Reference

Data Fields

AMI_PEI_FVDXE_VALIDATE | FvDxeValidate
VOID * | AmiSigPpi
BOOLEAN | bFvDxeProcessed
BOOLEAN | bFvDxeSigStatus
BOOLEAN | bFvDxeMfstStatus
BOOLEAN | bFvDxeFvPeiMemValid
The documentation for this struct was generated from the following file:
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include/Ppi/AmiFvDxeValidate.h


Verified PEI to DXE Handoff: _AMI_PUBLISH_FV_DXE_PPI Struct Reference

  • Data Structures
  • Data Structure Index
Data Fields
_AMI_PUBLISH_FV_DXE_PPI Struct Reference

Data Fields

AMI_ROM_AREA Area
The documentation for this struct was generated from the following file:
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include/Ppi/AmiFvDxeValidate.h


Verified PEI to DXE Handoff: PEI_CRYPT_HANDLE Struct Reference

  • Data Structures
  • Data Structure Index
Data Fields
PEI_CRYPT_HANDLE Struct Reference

Data Fields

EFI_GUID | AlgGuid
UINT32 | BlobSize
UINT8 * | Blob
The documentation for this struct was generated from the following file:
  • E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: Data Structure Index

  • Data Structures
  • Data Structure Index
Data Structure Index
P | _
P
PEI_CRYPT_HANDLE
_
_AMI_FFS_COMMON_SECTION_HEADER
_AMI_FV_DIGEST_INFO_HOB
_AMI_FV_DIGEST_PPI
_AMI_FV_DXE_VALIDATE_PPI
_AMI_PUBLISH_FV_DXE_PPI
P | _


Verified PEI to DXE Handoff: File List

  • File List
  • Globals
File List
Here is a list of all documented files with brief descriptions:
[detail level 123]
▼ FvDxeValidate
FvDxeFailLib.c
FvDxeValidateOnPublish.c
FvDxeValidatePpi.c
FvDxeValidatePpi1.c
▼ Include
▼ Ppi
AmiFvDigest.h
AmiFvDxeValidate.h
Generated on Wed Dec 30 2020 10:12:10 for Verified PEI to DXE Handoff by doxygen 1.8.7


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate Directory Reference

  • FvDxeValidate
FvDxeValidate Directory Reference

Files

file | FvDxeFailLib.c
file | FvDxeValidateOnPublish.c
file | FvDxeValidatePpi.c
file | FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeFailLib.c File Reference

  • File List
  • Globals
  • FvDxeValidate
Functions
FvDxeFailLib.c File Reference
#include <Token.h>
#include <AmiPeiLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/BaseMemoryLib.h>
#include <AmiHobs.h>
#include <Library/HobLib.h>
#include <Library/PostCodeLib.h>
#include <Ppi/AmiFvDxeValidate.h>
#include <Library/DebugLib.h>

Functions

VOID ExecuteActionOnFailureToValidateFv (IN CONST EFI_PEI_SERVICES **PeiServices)

Detailed Description

NULL library instance

Function Documentation

VOID ExecuteActionOnFailureToValidateFv ( IN CONST EFI_PEI_SERVICES ** PeiServices )

Function that will force the system into recovery mode

Parameters
PeiServices Pointer to the Pointer to the Pei Services Table


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidateOnPublish.c File Reference

  • File List
  • Globals
  • FvDxeValidate
Functions
FvDxeValidateOnPublish.c File Reference
#include <AmiCspLib.h>
#include <AmiHobs.h>
#include <Library/HobLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Ppi/AmiFvDxeValidate.h>
#include <Library/DebugLib.h>

Functions

BOOLEAN | IsFvMeasured (UINT32 Attributes)
EFI_STATUS | InstallFvDxePublishPpi (IN CONST EFI_PEI_SERVICES **PeiServices, IN AMI_ROM_AREA *Area)
BOOLEAN | BeforeFvDxePublish (IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT AMI_ROM_AREA *Area, IN UINT32 FvType)

Detailed Description

ROM Layout PEIM hook to PublishFv Verify signed DXE FVs (PEI after memory, DXE2 & BDS FVs) Locate FvDxeSig FFS in FV_DATA FV, if found - verify the signature of signed FV ranges by comparing decrypted hash against a hash value constructed using the ROM map layout and stored inside the FV_DATA FvDxeSig Certificate header Copy all signed FV Dxe ranges to RAM before performing hash calculation. Install a PPI to notify TCG module the good DXE Hash is ready to be extended to PCR

Function Documentation

BOOLEAN BeforeFvDxePublish | ( | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN OUT AMI_ROM_AREA * | Area,
 |  | IN UINT32 | FvType
 | ) |  |

Porting hook to support OEM specific FV validation or additional Fv processing. The Area that is passed in is allowed to be modified by the callee functions.

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table
Area | Pointer to the RomArea being checked
FvType | The attributes of the RomArea that is being checked
Return values
TRUE | Validation of the FV passed, continue processing it.
FALSE | Validation of the FV failed, don't continue processing it.
EFI_STATUS InstallFvDxePublishPpi | ( | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN AMI_ROM_AREA * | Area
 | ) |  |

The function will install a FvDxePublishPpi PPI.

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table
Area | Pointer to the RomArea being checked
Return values
EFI_SUCCESS If FV_MAIN is successfully verified.
BOOLEAN IsFvMeasured ( UINT32 Attributes )

Determine if the Rom Area attributes indicate the FV is measured

Parameters
[in] Attributes
Return values
TRUE if FV is Measured
Generated on Wed Dec 30 2020 10:12:10 for Verified PEI to DXE Handoff by doxygen 1.8.7


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidatePpi.c File Reference

  • File List
  • Globals
  • FvDxeValidate
Data Structures | Macros | Typedefs | Functions | Variables
FvDxeValidatePpi.c File Reference
#include <Token.h>
#include <AmiPeiLib.h>
#include <Ppi/AmiFvDxeValidate.h>
#include <Library/PeiServicesLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <PPI/CryptoPPI.h>
#include "AmiCertificate.h"
#include <Protocol/AmiDigitalSignature.h>
#include <Library/AmiRomLayoutLib.h>
#include <Library/DebugLib.h>
#include <Library/PerformanceLib.h>

Data Structures

struct _AMI_FFS_COMMON_SECTION_HEADER

Macros

#define MAX_FV_STORE_HEADER_SIZE 0x100

Typedefs

typedef struct
_AMI_FFS_COMMON_SECTION_HEADER 		AMI_FFS_COMMON_SECTION_HEADER

Functions

VOID | ExecuteActionOnFailureToValidateFv (IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS | HashFwRomMapImage (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN CONST EFI_PEI_SERVICES **PeiServices, IN APTIO_FW_CAPSULE_HEADER *FvSigHeader)
EFI_STATUS | RelocateFv (IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT AMI_ROM_AREA *Area)
EFI_STATUS EFIAPI | InstallFvDxeVerifyPpi (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
EFI_STATUS EFIAPI | LaunchFvDxeVerifyPpi (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
EFI_STATUS EFIAPI | VerifyRelocateFvDxe (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT AMI_ROM_AREA *AmiRomArea)
BOOLEAN | IsFvMeasured (UINT32 Attributes)
BOOLEAN | IsFvPeiAfterMem (UINT32 Attributes)
EFI_STATUS | VerifyFwCertRsa2048Sha256 (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN APTIO_FW_CAPSULE_HEADER *FvSigHeader)
EFI_STATUS | VerifyFwCertPkcs7 (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN APTIO_FW_CAPSULE_HEADER *FvSigHeader)
EFI_STATUS | VerifyFvDxeCert (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN APTIO_FW_CAPSULE_HEADER *FvSigHeader)
UINT32 | GetFvHeaderSize (VOID *Address)
EFI_FFS_FILE_HEADER * | GetFvMfstSigFfs (IN UINT64 FvAddress, IN UINT32 FvSize)
EFI_STATUS | LocateFvMfstSigHeader (UINT64 FvAddress, UINT32 Size, APTIO_FW_CAPSULE_HEADER **FvSigHeader)
EFI_STATUS EFIAPI | ValidateFvDxeEntry (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)

Variables

CONST EFI_PEI_PPI_DESCRIPTOR mAmiInstallCryptoPpi

Detailed Description

Verify signed DXE FVs (PEI after memory, DXE2 & BDS FVs) Locate FvDxeSig FFS in FV_DATA FV, if found - verify the signature of signed FV ranges by comparing decrypted hash against a hash value constructed using the ROM map layout and stored inside the FV_DATA FvDxeSig Certificate header Copy all signed FV Dxe ranges to RAM before performing hash calculation. Install a PPI to notify TCG module the good DXE Hash is ready to be extended to PCR

Function Documentation

VOID ExecuteActionOnFailureToValidateFv ( IN CONST EFI_PEI_SERVICES ** PeiServices )

Function that will force the system into recovery mode

Parameters
PeiServices Pointer to the Pointer to the Pei Services Table
UINT32 GetFvHeaderSize ( VOID * Address )

Return size of FV header, including ExtHeader

Parameters
[in] Address - Address of FV to search in
Return values
Fv Hdr size
EFI_FFS_FILE_HEADER* GetFvMfstSigFfs | ( | IN UINT64 | FvAddress,
 |  | IN UINT32 | FvSize
 | ) |  |

This service will discover firmware files of FREEFORM type by a File GUID and a Section GUID.

Parameters
[in] | FvAddress | - Address of FV to search in
[in] | FvSize | - Size of FV to search in
[out] | Ffs | - returns a pointer to FFs Hdr
Return values
Status
EFI_STATUS HashFwRomMapImage | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN APTIO_FW_CAPSULE_HEADER * | FvSigHeader
 | ) |  |

The Rom image hash is calculated according to Rom Area map

Parameters
[in] | ThisPpi | - pointer to a FvDxeValidatePpi struct
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
[in] | AmiRomArea | - AmiRomeArea of FV to be dispatched
Return values
Status EFI_SUCCESS Your hash is in the output buffer EFI_SECURITY_VIOLATION Something went wrong EFI_UNSUPPORTED Something went wrong EFI_OUT_OF_RESOURCES Something went wrong

The Rom image hash is calculated according to Rom Area map

Parameters
[in] | ThisPpi | - pointer to a FvDxeValidatePpi struct
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
Return values
Status EFI_SUCCESS Your hash is in the output buffer EFI_SECURITY_VIOLATION Something went wrong
EFI_STATUS EFIAPI InstallFvDxeVerifyPpi | ( | IN EFI_PEI_SERVICES ** | PeiServices,
 |  | IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor,
 |  | IN VOID * | NotifyPpi
 | ) |  |

The function will :

  1. Publish a FvDxeValidate PPI after AmiDigitalSignature PPI is available.
  2. Execute FvDxeValidate PPI immediately after step1 for each pending FV to be published after memory
Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table.
NotifyDescriptor | The notification descriptor for this notification event.
NotifyPpi | Pointer to a ppi.
Return values
EFI_SUCCESS If PPI is successfully installed.

This callback function will publish a FvDxeValidate PPI Execute FvDxeValidate PPI on gAmiPublishFvDxeValidatePpiGuid signal event

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table.
NotifyDescriptor | The notification descriptor for this notification event.
NotifyPpi | Pointer to a ppi.
Return values
EFI_SUCCESS If PPI is successfully installed.
BOOLEAN IsFvMeasured ( UINT32 Attributes )

Determine if the Rom Area attributes indicate the FV is measured

Parameters
Attributes
Return values
TRUE if FV is Measured
BOOLEAN IsFvPeiAfterMem ( UINT32 Attributes )

Determine if the Rom Area attributes indicate the FV PEI AFTER MEM

Parameters
Attributes
Return values
TRUE if FV is PEI MEM
EFI_STATUS EFIAPI LaunchFvDxeVerifyPpi | ( | IN EFI_PEI_SERVICES ** | PeiServices,
 |  | IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor,
 |  | IN VOID * | Ppi
 | ) |  |

The function will : Execute FvDxeValidate PPI for pending FV to be published after memory

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table.
NotifyDescriptor | The notification descriptor for this notification event.
NotifyPpi | Pointer to a ppi.
Return values
EFI_SUCCESS If PPI is successfully installed.
EFI_STATUS LocateFvMfstSigHeader | ( | UINT64 | FvAddress,
 |  | UINT32 | Size,
 |  | APTIO_FW_CAPSULE_HEADER ** | FvSigHeader
 | ) |  |

This function finds the FvSig Header inside FV, by traversing each Ffs within FV

Parameters
FvAddress | FV address
Size | Size of the FV
FvSigHeader | FvSig Header pointer
Return values
EFI_SUCCESS Found guided encrypted section.
EFI_STATUS RelocateFv | ( | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN OUT AMI_ROM_AREA * | Area
 | ) |  |

Function to relocate a firmware volume into system memory.

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table
Area | Pointer to the AMI_ROM_AREA that should be moved into memory, and whose Address should be updated with the memory address
Return values
EFI_SUCCESS The firmware volume was relocated correctly
EFI_STATUS EFIAPI ValidateFvDxeEntry | ( | IN EFI_PEI_FILE_HANDLE | FileHandle,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices
 | ) |  |

Entry point to ValidatetFvDxeEntry PEIM.

Parameters
FileHandle | Handle of the file being invoked.
PeiServices | Describes the list of possible PEI Services.
Return values
Status EFI_STATUS code
EFI_STATUS VerifyFvDxeCert | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN APTIO_FW_CAPSULE_HEADER * | FvSigHeader
 | ) |  |

This code verifies the signature for the measured FV DXE regions, and performs following checks on the image: 1.Signing certificate is signed with trusted Root Platform key 2.Integrity check. Image Signature verification -Hash the ROM ranges listed in the embedded ROM map -VerifySig: decode digest and compare with calculated hash

Parameters
[in] | ThisPpi | Pointer to the FvDxeValidate Ppi data structure
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message.
EFI_STATUS VerifyFwCertPkcs7 | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN APTIO_FW_CAPSULE_HEADER * | FvSigHeader
 | ) |  |

This code verifies FW Capsule is genuine, and performs following checks on the image:

  1. Signing certificate is signed with trusted Root Platform key
  2. Integrity check. Image Signature verification
Parameters
[in] | ThisPpi | Pointer to the FvDxeValidate Ppi data structure
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message.
EFI_STATUS VerifyFwCertRsa2048Sha256 | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN APTIO_FW_CAPSULE_HEADER * | FvSigHeader
 | ) |  |

This code verifies the signature for the measured FV DXE regions, and performs following checks on the image:

  1. Signing certificate is signed with trusted Root Platform key
  2. Integrity check. Image Signature verification Validate Root Certificate -Compare PubKey in Root Certificate Hdr with local FW Platform Key -Hash SignCert.PubKey -VerifySig for RootCert.Signature and compare with SignCert.Key hash Validate Sign Certificate -Hash the ROM image inside the FW Capsule -VerifySig for SignCert.Signature and compare with calculated hash
Parameters
[in] | ThisPpi | Pointer to the FvDxeValidate Ppi data structure
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message.
EFI_STATUS EFIAPI VerifyRelocateFvDxe | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN OUT AMI_ROM_AREA * | AmiRomArea
 | ) |  |

Verifies FVs with Measured attribute i.e., DXE, DXE2, BDS, PEI_MEM Relocates FVs to RAM before verification

Parameters
[in] | ThisPpi | Pointer to the Ppi data structure.
[in] | PeiServices | Pointer to the Pointer to the Pei Services Table.
[in] | AmiRomArea | Pointer to the AMI_ROM_AREA with an address of FV to be validated
[out] | AmiRomArea->Address | to be updated with an address in memory the FV is relocated to
Return values
EFI_STATUS Volume should be published

Variable Documentation

CONST EFI_PEI_PPI_DESCRIPTOR mAmiInstallCryptoPpi
Initial value:
= {
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
&gAmiInstallCryptoPpiGuid, NULL
}


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/FvDxeValidate/FvDxeValidatePpi1.c File Reference

  • File List
  • Globals
  • FvDxeValidate
Data Structures | Macros | Typedefs | Functions | Variables
FvDxeValidatePpi1.c File Reference
#include <Token.h>
#include <AmiPeiLib.h>
#include <Ppi/AmiFvDxeValidate.h>
#include <Library/PeiServicesLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <CryptLib.h>
#include "AmiCertificate.h"
#include <Library/AmiRomLayoutLib.h>
#include <Library/DebugLib.h>
#include <Library/PerformanceLib.h>

Data Structures

struct | _AMI_FV_DIGEST_INFO_HOB
AMI FvDxe signature hashed address list HOB. More...
struct | _AMI_FFS_COMMON_SECTION_HEADER
struct | PEI_CRYPT_HANDLE

Macros

#define | AMI_FV_DIGEST_HOB_GUID {0xcf96ae83, 0x7ce7, 0x4e3f, { 0x90, 0x3f, 0xb0, 0xf4, 0x31, 0xcb, 0x57, 0x46} }
The GUID of the HOB containing Hash address list.
#define | MAX_FV_STORE_HEADER_SIZE 0x100

Typedefs

typedef struct
_AMI_FV_DIGEST_INFO_HOB 		AMI_FV_DIGEST_INFO_HOB
AMI FvDxe signature hashed address list HOB.
typedef struct
_AMI_FFS_COMMON_SECTION_HEADER 		AMI_FFS_COMMON_SECTION_HEADER

Functions

VOID | ExecuteActionOnFailureToValidateFv (IN CONST EFI_PEI_SERVICES **PeiServices)
EFI_STATUS | HashFwRomMapImage (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN CONST EFI_PEI_SERVICES **PeiServices, IN APTIO_FW_CAPSULE_HEADER *FvSigHeader)
EFI_STATUS EFIAPI | VerifyFvDxe (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN CONST EFI_PEI_SERVICES **PeiServices, IN OUT AMI_ROM_AREA *AmiRomArea)
EFI_STATUS | LaunchFvDxeVerifyPpi (IN EFI_PEI_SERVICES **PeiServices, IN AMI_FV_DXE_VALIDATE_PPI *FvDxeValidatePpi, IN AMI_ROM_AREA *Area)
EFI_STATUS EFIAPI | InstallFvDxeVerifyPpi (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *NullPpi)
EFI_STATUS | InstallFvDigestPpi (IN CONST EFI_PEI_SERVICES **PeiServices, IN AMI_FV_DIGEST_PPI *pFvDigestPpi)
EFI_STATUS EFIAPI | InstallFvDigestAfterMem (IN EFI_PEI_SERVICES **PeiServices, IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, IN VOID *Ppi)
BOOLEAN | IsFvMeasured (UINT32 Attributes)
BOOLEAN | IsFvPeiAfterMem (UINT32 Attributes)
EFI_STATUS | CryptoGetFwKeyHob (IN OUT FW_KEY_HOB **pFwKeyHob)
EFI_STATUS | GetKey (IN CONST EFI_GUID *KeyAlgorithm, IN OUT PEI_CRYPT_HANDLE *PublicKey)
EFI_STATUS | VerifySig (IN PEI_CRYPT_HANDLE *PublicKey, IN PEI_CRYPT_HANDLE *Hash, IN VOID *Signature, IN UINTN SignatureSize, IN UINT32 Flags)
EFI_STATUS | VerifyKey (IN CONST EFI_GUID *KeyAlgorithm, IN PEI_CRYPT_HANDLE *PublicKey)
EFI_STATUS | VerifyFwCertRsa2048Sha256 (IN AMI_FV_DXE_VALIDATE_PPI *ThisPpi, IN APTIO_FW_CAPSULE_HEADER *FvSigHeader)
UINT32 | GetFvHeaderSize (VOID *Address)
EFI_FFS_FILE_HEADER * | GetFvMfstSigFfs (IN UINT64 FvAddress, IN UINT32 FvSize)
EFI_STATUS | LocateFvMfstSigHeader (UINT64 FvAddress, UINT32 Size, APTIO_FW_CAPSULE_HEADER **FvSigHeader)
EFI_STATUS EFIAPI | ValidateFvDxeEntry (IN EFI_PEI_FILE_HANDLE FileHandle, IN CONST EFI_PEI_SERVICES **PeiServices)

Variables

const UINT8 | KeyE [] = {E_CONST}
const UINTN | LenE = sizeof(KeyE)
const INT32 | PssSaltlen = PSS_SIG_SALTLEN

Detailed Description

Verify signed DXE FVs (PEI after memory, DXE2 & BDS FVs) Locate FvDxeSig FFS in FV_DATA FV, if found - verify the signature of signed FV ranges by comparing decrypted hash against a hash value constructed using the ROM map layout and stored inside the FV_DATA FvDxeSig Certificate header Copy all signed FV Dxe ranges to RAM before performing hash calculation. Install a PPI to notify TCG module the good DXE Hash is ready to be extended to PCR

Function Documentation

EFI_STATUS CryptoGetFwKeyHob ( IN OUT FW_KEY_HOB ** pFwKeyHob )

The function locates a FwKey Hob pointing to a Platform Signing Key (PK) inside FV_BB ffs

Parameters
[out] pFwKeyHob Pointer to pFwKeyHob
Return values
Status EFI_SUCCESS The Key Hob was found EFI_NOT_FOUND The Key Hob not found
VOID ExecuteActionOnFailureToValidateFv ( IN CONST EFI_PEI_SERVICES ** PeiServices )

Function that will force the system into recovery mode

Parameters
PeiServices Pointer to the Pointer to the Pei Services Table
UINT32 GetFvHeaderSize ( VOID * Address )

Return size of FV header, including ExtHeader

Parameters
[in] Address - Address of FV to search in
Return values
Fv Hdr size
EFI_FFS_FILE_HEADER* GetFvMfstSigFfs | ( | IN UINT64 | FvAddress,
 |  | IN UINT32 | FvSize
 | ) |  |

This service will discover firmware files of FREEFORM type by a File GUID and a Section GUID.

Parameters
[in] | FvAddress | - Address of FV to search in
[in] | FvSize | - Size of FV to search in
[out] | Ffs | - returns a pointer to FFs Hdr
Return values
Status
EFI_STATUS GetKey | ( | IN CONST EFI_GUID * | KeyAlgorithm,
 |  | IN OUT PEI_CRYPT_HANDLE * | PublicKey
 | ) |  |

Function returns Ptr to a Platform Signing Key (PK) Ffs inside Recovery FV (FV_BB or similar)

Parameters
[in] | KeyAlgorithm | Points to the EFI_GUID which identifies the PKpub algorithm to use.
[out] | PublicKey | Handle to a key used to return a ptr to a Key. This handle must be identifying a public key.
Return values
Status EFI_SUCCESS The Key is successfully returned. EFI_NOT_FOUND The Key not found EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS HashFwRomMapImage | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN APTIO_FW_CAPSULE_HEADER * | FvSigHeader
 | ) |  |

The Rom image hash is calculated according to Rom Area map

Parameters
[in] | ThisPpi | - pointer to a FvDxeValidatePpi struct
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
Return values
Status EFI_SUCCESS Your hash is in the output buffer EFI_SECURITY_VIOLATION Something went wrong
EFI_STATUS EFIAPI InstallFvDigestAfterMem | ( | IN EFI_PEI_SERVICES ** | PeiServices,
 |  | IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor,
 |  | IN VOID * | Ppi
 | ) |  |

The function will be called on MemoryInstalled callback: Update FvDigestPpi with fixed up addresses from AddrList Hob

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table.
NotifyDescriptor | The notification descriptor for this notification event.
NotifyPpi | Pointer to a ppi.
Return values
EFI_SUCCESS If PPI is successfully installed.
EFI_STATUS InstallFvDigestPpi | ( | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN AMI_FV_DIGEST_PPI * | pFvDigestPpi
 | ) |  |

The function will publish a FvDigestPpi PPI after successful FV Dxe verification.

Parameters
pFvDigestPpi Pointer to the AMI_FV_DIGEST_PPI data structure
Return values
EFI_SUCCESS If FV_MAIN is successfully verified.
EFI_STATUS EFIAPI InstallFvDxeVerifyPpi | ( | IN EFI_PEI_SERVICES ** | PeiServices,
 |  | IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor,
 |  | IN VOID * | NotifyPpi
 | ) |  |

This callback function will publish a FvDxeValidate PPI Execute FvDxeValidate PPI on gAmiPublishFvDxeValidatePpiGuid signal event

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table.
NotifyDescriptor | The notification descriptor for this notification event.
NotifyPpi | Pointer to a ppi.
Return values
EFI_SUCCESS If PPI is successfully installed.
BOOLEAN IsFvMeasured ( UINT32 Attributes )

Determine if the Rom Area attributes indicate the FV is measured

Parameters
Attributes
Return values
TRUE if FV is Measured
BOOLEAN IsFvPeiAfterMem ( UINT32 Attributes )

Determine if the Rom Area attributes indicate the FV PEI AFTER MEM

Parameters
Attributes
Return values
TRUE if FV is PEI MEM
EFI_STATUS LaunchFvDxeVerifyPpi | ( | IN EFI_PEI_SERVICES ** | PeiServices,
 |  | IN AMI_FV_DXE_VALIDATE_PPI * | FvDxeValidatePpi,
 |  | IN AMI_ROM_AREA * | Area
 | ) |  |

This function will launch FvDxeVerify

Parameters
PeiServices | Pointer to the Pointer to the Pei Services Table.
NotifyDescriptor | The notification descriptor for this notification event.
NotifyPpi | Pointer to a ppi.
Return values
EFI_SUCCESS If PPI is successfully installed.
EFI_STATUS LocateFvMfstSigHeader | ( | UINT64 | FvAddress,
 |  | UINT32 | Size,
 |  | APTIO_FW_CAPSULE_HEADER ** | FvSigHeader
 | ) |  |

This function finds the FvSig Header inside FV, by traversing each Ffs within FV

Parameters
FvAddress | FV address
Size | Size of the FV
FvSigHeader | FvSig Header pointer
Return values
EFI_SUCCESS Found guided encrypted section.
EFI_STATUS EFIAPI ValidateFvDxeEntry | ( | IN EFI_PEI_FILE_HANDLE | FileHandle,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices
 | ) |  |

Entry point to ValidatetFvDxeEntry PEIM.

Parameters
FileHandle | Handle of the file being invoked.
PeiServices | Describes the list of possible PEI Services.
Return values
Status EFI_STATUS code
EFI_STATUS EFIAPI VerifyFvDxe | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN CONST EFI_PEI_SERVICES ** | PeiServices,
 |  | IN OUT AMI_ROM_AREA * | AmiRomArea
 | ) |  |

Verifies FVs with Measured attribute i.e., DXE, DXE2, BDS, PEI_MEM Relocates FVs to RAM before verification

Parameters
[in] | ThisPpi | Pointer to the Ppi data structure.
[in] | PeiServices | Pointer to the Pointer to the Pei Services Table.
[in] | AmiRomArea | Pointer to the AMI_ROM_AREA with an address of FV to be validated
[out] | AmiRomArea->Address | to be updated with an address in memory the FV is relocated to
Return values
EFI_STATUS Volume should be published
EFI_STATUS VerifyFwCertRsa2048Sha256 | ( | IN AMI_FV_DXE_VALIDATE_PPI * | ThisPpi,
 |  | IN APTIO_FW_CAPSULE_HEADER * | FvSigHeader
 | ) |  |

This code verifies the signature for the measured FV DXE regions, and performs following checks on the image:

  1. Signing certificate is signed with trusted Root Platform key
  2. Integrity check. Image Signature verification Validate Root Certificate -Compare PubKey in Root Certificate Hdr with local FW Platform Key -Hash SignCert.PubKey -VerifySig for RootCert.Signature and compare with SignCert.Key hash Validate Sign Certificate -Hash the ROM image inside the FW Capsule -VerifySig for SignCert.Signature and compare with calculated hash
Parameters
[in] | ThisPpi | - pointer to a FvDxeValidatePpi struct
[in] | FvSigHeader | - pointer to a FW Capsule Hdr
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message.
EFI_STATUS VerifyKey | ( | IN CONST EFI_GUID * | KeyAlgorithm,
 |  | IN PEI_CRYPT_HANDLE * | PublicKey
 | ) |  |

Function compares the input PublicKey against Platform Signing Key (PK) image in the flash.

Parameters
[in] | KeyAlgorithm | Points to the EFI_GUID which identifies the PKpub algorithm to use.
[in] | PublicKey | Handle to a key used for verifying signatures. This handle must be identifying a public key.
Return values
Status EFI_SUCCESS The Key is successfully verified. EFI_SECURITY_VIOLATION The Key does not match current FW key. EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.
EFI_STATUS VerifySig | ( | IN PEI_CRYPT_HANDLE * | PublicKey,
 |  | IN PEI_CRYPT_HANDLE * | Hash,
 |  | IN VOID * | Signature,
 |  | IN UINTN | SignatureSize,
 |  | IN UINT32 | Flags
 | ) |  |

Function verifies that the specified signature matches the specified hash. Verifies the RSA-SSA signature with EMSA-PKCS1-v1_5 encoding scheme defined in RSA PKCS#1. This function decrypts the signature with the provided key and then compares the decrypted value to the specified hash value

Parameters
[in] | PublicKey | Handle to a key used for verifying signatures. This handle must be identifying a public key.
[in] | Hash | Handle of the hash object to verify.
[in] | Signature | Pointer to the signature data to be verified.
[in] | SignatureSize | The size, in bytes, of the signature data.
[in] | Flags | Specifies additional flags to further customize the signing/verifying behavior.
Return values
Status EFI_SUCCESS The signature is successfully verified. EFI_SECURITY_VIOLATION The signature does not match the given message. EFI_ACCESS_DENIED The key could not be used in signature operation. EFI_INVALID_PARAMETER The size of input message or signature does not meet the criteria of the underlying signature algorithm.


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include Directory Reference

  • Include
Include Directory Reference

Directories

directory Ppi


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include/Ppi Directory Reference

  • Include
  • Ppi
Ppi Directory Reference

Files

file | AmiFvDigest.h
file | AmiFvDxeValidate.h


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include/Ppi/AmiFvDigest.h File Reference

  • File List
  • Globals
  • Include
  • Ppi
Data Structures | Macros | Typedefs | Enumerations
AmiFvDigest.h File Reference

Data Structures

struct _AMI_FV_DIGEST_PPI

Macros

#define AMI_FV_DIGEST_PPI_GUID

Typedefs

typedef UINT32 | AMI_TDXE_ALG_ID
typedef struct _AMI_FV_DIGEST_PPI | AMI_FV_DIGEST_PPI

Enumerations

enum AMI_TDXE_HASH_ALG {
AMI_TDXE_SHA1, AMI_TDXE_SHA256, AMI_TDXE_SHA384, AMI_TDXE_SHA512,
AMI_TDXE_MAX
}

Detailed Description

AMI_FV_DIGEST_PPI definition

Macro Definition Documentation

#define AMI_FV_DIGEST_PPI_GUID
Value:
{ \
0x565dbcbc, 0x814d, 0x4d68, {0xaa, 0x43, 0x9f, 0x83, 0x8e, 0xbf, 0x5d, 0xd3 } \
}


Verified PEI to DXE Handoff: E:/AptioV/xxxLake/cfl-MsiCfl_9.0/cfl-MsiCfl_9.0/AmiTrustedFvPkg/Include/Ppi/AmiFvDxeValidate.h File Reference

  • File List
  • Globals
  • Include
  • Ppi
Data Structures | Macros | Typedefs | Functions
AmiFvDxeValidate.h File Reference
#include <Library/AmiRomLayoutLib.h>
#include <Ppi/AmiFvDigest.h>

Data Structures

struct | _AMI_PUBLISH_FV_DXE_PPI
struct | _AMI_FV_DXE_VALIDATE_PPI

Macros

#define AMI_FV_DXE_VALIDATE_PPI_GUID

Typedefs

typedef struct
_AMI_PUBLISH_FV_DXE_PPI 		AMI_PUBLISH_FV_DXE_PPI
typedef struct
_AMI_FV_DXE_VALIDATE_PPI 		AMI_FV_DXE_VALIDATE_PPI
typedef IN CONST
EFI_PEI_SERVICES ** 		PeiServices
typedef IN CONST
EFI_PEI_SERVICES IN OUT
AMI_ROM_AREA *Area 		OPTIONAL

Functions

typedef EFI_STATUS (EFIAPI *AMI_PEI_FVDXE_VALIDATE)(IN AMI_FV_DXE_VALIDATE_PPI *This

Detailed Description

Defines PPI that is used to verify integrity of all FW regions containing DXE code.

Macro Definition Documentation

#define AMI_FV_DXE_VALIDATE_PPI_GUID
Value:
{ \
0x3771aec7, 0xeac0, 0x4caa, {0xaf, 0x73, 0x4b, 0xf4, 0xc7, 0x6a, 0xd2, 0x29 } \
}


Verified PEI to DXE Handoff: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Macros
  • a
  • b
  • c
  • e
  • g
  • h
  • i
  • l
  • r
  • v
Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation:

- a -

  • AMI_FV_DIGEST_HOB_GUID : FvDxeValidatePpi1.c
  • AMI_FV_DIGEST_INFO_HOB : FvDxeValidatePpi1.c

- b -

  • BeforeFvDxePublish() : FvDxeValidateOnPublish.c

- c -

  • CryptoGetFwKeyHob() : FvDxeValidatePpi1.c

- e -

  • ExecuteActionOnFailureToValidateFv() : FvDxeFailLib.c , FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- g -

  • GetFvHeaderSize() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • GetFvMfstSigFfs() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • GetKey() : FvDxeValidatePpi1.c

- h -

  • HashFwRomMapImage() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- i -

  • InstallFvDigestAfterMem() : FvDxeValidatePpi1.c
  • InstallFvDigestPpi() : FvDxeValidatePpi1.c
  • InstallFvDxePublishPpi() : FvDxeValidateOnPublish.c
  • InstallFvDxeVerifyPpi() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • IsFvMeasured() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c , FvDxeValidateOnPublish.c
  • IsFvPeiAfterMem() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- l -

  • LaunchFvDxeVerifyPpi() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • LocateFvMfstSigHeader() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- r -

  • RelocateFv() : FvDxeValidatePpi.c

- v -

  • ValidateFvDxeEntry() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • VerifyFvDxe() : FvDxeValidatePpi1.c
  • VerifyFvDxeCert() : FvDxeValidatePpi.c
  • VerifyFwCertPkcs7() : FvDxeValidatePpi.c
  • VerifyFwCertRsa2048Sha256() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • VerifyKey() : FvDxeValidatePpi1.c
  • VerifyRelocateFvDxe() : FvDxeValidatePpi.c
  • VerifySig() : FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Macros
  • b
  • c
  • e
  • g
  • h
  • i
  • l
  • r
  • v

- b -

  • BeforeFvDxePublish() : FvDxeValidateOnPublish.c

- c -

  • CryptoGetFwKeyHob() : FvDxeValidatePpi1.c

- e -

  • ExecuteActionOnFailureToValidateFv() : FvDxeFailLib.c , FvDxeValidatePpi1.c , FvDxeValidatePpi.c

- g -

  • GetFvHeaderSize() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • GetFvMfstSigFfs() : FvDxeValidatePpi1.c , FvDxeValidatePpi.c
  • GetKey() : FvDxeValidatePpi1.c

- h -

  • HashFwRomMapImage() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- i -

  • InstallFvDigestAfterMem() : FvDxeValidatePpi1.c
  • InstallFvDigestPpi() : FvDxeValidatePpi1.c
  • InstallFvDxePublishPpi() : FvDxeValidateOnPublish.c
  • InstallFvDxeVerifyPpi() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • IsFvMeasured() : FvDxeValidateOnPublish.c , FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • IsFvPeiAfterMem() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- l -

  • LaunchFvDxeVerifyPpi() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • LocateFvMfstSigHeader() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c

- r -

  • RelocateFv() : FvDxeValidatePpi.c

- v -

  • ValidateFvDxeEntry() : FvDxeValidatePpi.c , FvDxeValidatePpi1.c
  • VerifyFvDxe() : FvDxeValidatePpi1.c
  • VerifyFvDxeCert() : FvDxeValidatePpi.c
  • VerifyFwCertPkcs7() : FvDxeValidatePpi.c
  • VerifyFwCertRsa2048Sha256() : FvDxeValidatePpi1.c , FvDxeValidatePpi.c
  • VerifyKey() : FvDxeValidatePpi1.c
  • VerifyRelocateFvDxe() : FvDxeValidatePpi.c
  • VerifySig() : FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Macros
  • AMI_FV_DIGEST_INFO_HOB : FvDxeValidatePpi1.c


Verified PEI to DXE Handoff: Globals

  • File List
  • Globals
  • All
  • Functions
  • Typedefs
  • Macros
  • AMI_FV_DIGEST_HOB_GUID : FvDxeValidatePpi1.c


Copyright

American Megatrends International LLC.
5555 Oakbrook Parkway
Suite 200
Norcross, GA 30093 (USA)

Copyright (c) 1985-2019 American Megatrends International LLC. All Rights Reserved.

This publication contains proprietary information, which is protected by copyright. No part of this publication may be reproduced, transcribed, stored in a retrieval system, translated into any language or computer language, or transmitted in any form whatsoever without the prior written consent of the publisher, American Megatrends, Inc.

American Megatrends International LLC retains the right to update, change, modify this publication at any time, without notice.

For Additional Information

Call American Megatrends BIOS Sales Department at 1-800-828-9264 for additional information.

Limitations of Liability

In no event shall American Megatrends be held liable for any loss, expenses, or damages of any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the design or use of this product or the support materials provided with the product.

Limited Warranty

No warranties are made, either expressed or implied, with regard to the contents of this work, its merchantability, or fitness for a particular use. American Megatrends assumes no responsibility for errors and omissions or for the uses made of the material contained herein or reader decisions based on such use.

Trademark and Copyright Acknowledgments

All product names used in this publication are for identification purposes only and are trademarks of their respective Companies.


General Information

APTIO Trusted FV porting guide

Porting Information : AMI_Aptio_5.x_TrustedFv_Porting_Guide_NDA.doc


Verified PEI to DXE Handoff: Main Page

Verified PEI to DXE Handoff Documentation

Release Notes
Additional Information

Copyright

Generated on Wed Dec 30 2020 10:12:10 for Verified PEI to DXE Handoff by doxygen 1.8.7


Release Notes - NDA Required

Information:

Component Name: Aptio Verified DXE Boot (Trusted FV)

Component Type: PEI driver

AMI BIOS Core: Aptio V

Location on SourceSafe: SS: AptioV;$/AptioV/Sources/Interface/AmiTrustedFvPkg

Project: 0JQBO

Label: AmiTrustedFvPkg_07

Date: 12-30-2020

Component Description:

This component provides PEI services for 2nd stage EFI code verification (PEI-DXE handoff) in Aptio projects.

1st stage verification is performed by a Service Processor as a HW root of trust, e.g. by Intel’s BootGuard ACM or AMD PSP.

Module consists of the following parts:
- FvDxeValidate: Verified FV DXE Code (PEI)
- FvDxeSig :FV DXE Certificate ffs file placeholder
- FvDxeKey :Root FW Key template (redundant module part if Secure Flash component provides the FwKeys)

Module requires generic Aptio module(s): AmiCrypto Package (label 43 and newer);

(BQA Testing) Optional module containing Ami Test keys: SecureFlash.Ami Test FwKey store

Important information about the component:

eModule does not include FW Sign keys.

AmiTrustedFvPkg eModule is sharing the sign key (Platform FW Key) and the signature configuration with Aptio Secure Flash.

Instructions to obtain/generate/manage the FW Platform keys are provided in Secure Flash porting guide document.

Build time generation of a signed FV DXE certificate (a.k.a FvDxeSig ffs) is controlled by FVDXE_SIGNED SDL token (by default it is enabled).

Following items will be included in the final Aptio FW image:

1. FWkey ffs with the Root Platform Key (FWpub) to verify signed FVs

A dummy ffs with FwKey placeholder is created if FWpub key was not available at a build time.

Note: Default FwKey can be replaced with the public portion of the Sign Key using CryptoCon signing process

Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

Warning: BIOS will fail to boot unless a valid Platform verification key is included in FWKey FFS

2. FvDxeSig ffs with modified Rom layout map and the space to embed the final FV DXE signature.

There are 2 types of signing certificates supported (selectable through SDL token FVDXE_CERT_FORMAT):

0 (default): PKCS#1 v1.5 format with RSA EMSA-PKCS or EMSA_PSS padding schemes using fixed hash SHA256 and RSA 2048 bit key;

1 : PKCS#7 DER certificate with the signed digest types ranging from SHA256 to SHA512 and RSA 2048 to 8192bit key sizes (larger RSA key sizes have not been verified).

The signature is calculated for all Firmware Volumes in the Rom layout map with attribute “Measured” (commonly used in FVs containing DXE & BDS UEFI code).

FvDxe signing will be invoked after Aptio ROM image is generated at the end of Apto build process.

Warning: Built process will be aborted if FvDxe sign key (FWpriv) is not available at a time of build

Important note: When both Secure Flash and AmiTrustedFvPkg modules are enabled inside the BIOS source, the signing sequence must be followed.

After signing (re-signing in post build process) the FV DXE section in the BIOS image, the whole BIOS needs to be re-signed with the same signing key for Secure Flash.

It is very important that BIOS project owners implement proper security protocols that follow common industry standards for protecting the BIOS image signing process and preventing un-authorized parties from tempering with the Platform FW key.

Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using hardware security module (HSM) or AMI Remote Signing Server.

AMI Build Tools:

Tools Label: BuildTools_34

Visual eBios: RSS.7.17.0302

Required Fixes are in Red

New features added in this label:

AmiTrustedFvPkd.sdl(.mak): AMI_TRUSTED_FV_MODULE_REVISION=7.

Improve handling of Private Key password override. Support empty password option;

Add tokens FUSS_TOOL_P1SIG_OPTION and FUSS_TOOL_P7SIG_OPTION to identify signing tools (0-Cryptocon, 1-MS signtool.exe and 2-openSSL) for generating PKCS#1v1.5 and PKCS#7 signatures respectfully;

General Bug Fixes:

EIP#577980: FvDxeValidatePpi(1).c: See comments#3 in “Known Issues and limitations”

Support Fv relocation performed by RomLayoutPei(for FVs with AMI_ROM_AREA_FV_PEI_SHADOW attribute set);

Remove access to FV_BB address range in debug mode;

EIP addressed in this label:

EIP#577980: AmiTrustedFvPkg: Add mitigation for SA50074, BootGuard TOCTOU vulnerability

Known issues and limitations in this label:

1. Use “AmiCryptoPkg” label AmiCryptoPkg_43 or newer

2. In the projects with ROM layouts where PEI code split between FV_BB and FV_BB_AFTER_MEMORY, the following PEI services (ffs) must be included in FV_BB (IBB):

FWKey; FwKeyHobPei (always)

FvDxeValidatePpi (always)

CryptoPpi (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

DxeIpl (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

PEI Recovery services (only if FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0 if the FV_BB_AFTER_MEMORY cannot be dispatched due corruption)

3. Mitigation for BootGuard TOCTOU vulnerability

In the projects with Intel BootGuard or AMD PSB, the following settings must be configured in order to mitigate TimeOfCheck-TimeOfUse (TOCTOU) condition:

3.1 SDL Tokens FVDXE_VERIFY_BEFORE_MRC = 0, FVDXE_SHADOW_FV = 1

3.2 The following ROM Attributes must be enforced for the relevant firmware volumes:

3.3.1 The FV_BB and the firmware volumes that are validated by a hardware root of trust iBootGuard or AmdPSP must NOT include AMI_ROM_AREA_FV_DXE

3.3.2 The firmware volumes that need to be verified after memory is installed at PEI to DXE handoff

(the FVs with ROM attributers AMI_ROM_AREA_FV_PEI_MEM or AMI_ROM_AREA_FV_DXE, example of such FVs: FV_MAIN(WRAPPER), FV_BB_AFTER_MEMORY):

  -must include AMI_ROM_AREA_MEASURED

  -must NOT include AMI_ROM_AREA_FV_PEI

  -optionally may include ROM_AREA_FV_PEI_SHADOW

Validation Testing:

Test results are available for internal review at this link…

3rd Party Code Present in Component:

Release History:

Release Notes 6

Release Notes 5

Release Notes 4

Release Notes 3

Release Notes 2

© American Megatrends Inc.


Release Notes - NDA Required

Information:

Component Name: Aptio Verified DXE Boot (Trusted FV)

Component Type: PEI driver

AMI BIOS Core: Aptio V

Location on SourceSafe: SS: AptioV;$/AptioV/Sources/Interface/AmiTrustedFvPkg

Project: 0JQBO

Label: AmiTrustedFvPkg_02

Date: 05-17-2019

Component Description:

This component provides PEI services for 2nd stage EFI code verification (PEI-DXE handoff) in Aptio projects.

1st stage verification is performed by a Service Processor as a HW root of trust, e.g. by Intel’s BootGuard ACM or AMD PSP.

Module consists of the following parts:
- FvDxeValidate: Verified FV DXE Code (PEI)
- FvDxeSig :FV DXE Certificate ffs file placeholder
- FvDxeKey :Root FW Key template (redundant module part if Secure Flash component provides the FwKeys)

Module requires generic Aptio module(s):
-AmiCrypto Package (label 37 and later);

(BQA Testing) Optional module containing Ami Test keys:
-SecureFlash.Ami Test FwKey store

Important information about the component:

eModule does not include FW Sign keys. Since current AmiTrustedFvPkg eModule is sharing the signing keys with Aptio Secure Flash,

instructions to obtain/generate/manage the FW Platform keys are provided in Secure Flash porting guide document.

Build time generation of a signed FV DXE certificate (a.k.a FvDxeSig ffs) is controlled by FVDXE_SIGNED SDL token.

Following items will be included in the final Aptio FW image:

1. FWkey ffs with the Root Platform Key (FWpub) to verify signed FVs

A dummy ffs with FwKey placeholder is created if FWpub key was not available at a build time.

Note: Default FwKey can be replaced with the public portion of the Sign Key using CryptoCon signing process

Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

2. FvDxeSig ffs with modified Rom layout map and the space to embed the final FV DXE signature.

There are 2 types of signing certificates supported (selectable through SDL token FVDXE_CERT_FORMAT):

0 (default): PKCS#1 v1.5 format with RSA EMSA-PKCS or EMSA_PSS padding schemes using fixed hash SHA256 and RSA 2048 bit key;

1 : PKCS#7 DER certificate with the signed digest types ranging from SHA256 to SHA512 and RSA 2048 to 8192bit key sizes (larger RSA key sizes have not been verified).

The signature is calculated for all Firmware Volumes in the Rom layout map with attribute “Measured” (commonly used in FVs containing DXE & BDS UEFI code).

FvDxe signing will be invoked after Aptio ROM image is generated at the end of Apto build process if RSA private key (FWpriv) is available, otherwise FvDxe signing will fail with

appropriate error message.

Warning: BIOS will fail to boot unless a valid Root Platform verification key is included in FWKey FFS

It is very important that BIOS project owners implement proper security protocols that follow common industry standards for protecting the BIOS image signing process and preventing un-authorized parties from tempering with the Platform FW key.

Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using secure signing process using HSM or AMI Remote Signing Server.

AMI Build Tools:

Tools Label: BuildTools_34

Visual eBios: RSS.7.17.0302

Required Fixes are in Red

New features added in this label:

New module

General Bug Fixes:

EIP addressed in this label:

EIP#426721: HW-based Root of Trust verified boot: Implement asymmetric (RSA) signature verification for PEI to DXE phase handoff

Files changed for EIP fixes:

Known issues and limitations in this label:

Use “AmiCryptoPkg” label AmiCryptoPkg_37 or newer

For the projects including extended PEI FV with attributes AMI_ROM_AREA_FV_PEI_MEM, the following PEI services (ffs) must be stored inside FV_BB (1st root of trust FV):

1. DxeIpl

2. CryptoPpi

3. FWKey; FwKeyHobPei

4. FvDxeValidatePpi

5 .PEI services providing Recovery support (optional if Recovery is selected as an action on failure to verify FV)

Validation Testing:

3rd Party Code Present in Component:

Release History:

© American Megatrends Inc.


Release Notes - NDA Required

Information:

Component Name: Aptio Verified DXE Boot (Trusted FV)

Component Type: PEI driver

AMI BIOS Core: Aptio V

Location on SourceSafe: SS: AptioV;$/AptioV/Sources/Interface/AmiTrustedFvPkg

Project: 0JQBO

Label: AmiTrustedFvPkg_03

Date: 08-30-2019

Component Description:

This component provides PEI services for 2nd stage EFI code verification (PEI-DXE handoff) in Aptio projects.

1st stage verification is performed by a Service Processor as a HW root of trust, e.g. by Intel’s BootGuard ACM or AMD PSP.

Module consists of the following parts:
- FvDxeValidate: Verified FV DXE Code (PEI)
- FvDxeSig :FV DXE Certificate ffs file placeholder
- FvDxeKey :Root FW Key template (redundant module part if Secure Flash component provides the FwKeys)

Module requires generic Aptio module(s):
-AmiCrypto Package (label 37 and later);

(BQA Testing) Optional module containing Ami Test keys:
-SecureFlash.Ami Test FwKey store

Important information about the component:

eModule does not include FW Sign keys.

AmiTrustedFvPkg eModule is sharing sign key (Platform FW Key) and the signature configuration with Aptio Secure Flash.

Instructions to obtain/generate/manage the FW Platform keys are provided in Secure Flash porting guide document.

Build time generation of a signed FV DXE certificate (a.k.a FvDxeSig ffs) is controlled by FVDXE_SIGNED SDL token (by default it is enabled).

Following items will be included in the final Aptio FW image:

1. FWkey ffs with the Root Platform Key (FWpub) to verify signed FVs

A dummy ffs with FwKey placeholder is created if FWpub key was not available at a build time.

Note: Default FwKey can be replaced with the public portion of the Sign Key using CryptoCon signing process

Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

Warning: BIOS will fail to boot unless a valid Platform verification key is included in FWKey FFS

2. FvDxeSig ffs with modified Rom layout map and the space to embed the final FV DXE signature.

There are 2 types of signing certificates supported (selectable through SDL token FVDXE_CERT_FORMAT):

0 (default): PKCS#1 v1.5 format with RSA EMSA-PKCS or EMSA_PSS padding schemes using fixed hash SHA256 and RSA 2048 bit key;

1 : PKCS#7 DER certificate with the signed digest types ranging from SHA256 to SHA512 and RSA 2048 to 8192bit key sizes (larger RSA key sizes have not been verified).

The signature is calculated for all Firmware Volumes in the Rom layout map with attribute “Measured” (commonly used in FVs containing DXE & BDS UEFI code).

FvDxe signing will be invoked after Aptio ROM image is generated at the end of Apto build process.

Warning: Built process will be aborted if FvDxe sign key (FWpriv) is not available at a time of build

It is very important that BIOS project owners implement proper security protocols that follow common industry standards for protecting the BIOS image signing process and preventing un-authorized parties from tempering with the Platform FW key.

Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using hardware security module (HSM) or AMI Remote Signing Server.

AMI Build Tools:

Tools Label: BuildTools_34

Visual eBios: RSS.7.17.0302

Required Fixes are in Red

New features added in this label:

Update AMI Copyright headers

General Bug Fixes:

EIP#426721: FvDxeValidatePpi.c: Harden validation of RomLayout ranges inside FvDxeSig hdr:

-Measured FvDxe Rom ranges must map to the local RomLayout

-At least 2 measured ranges must be defined

EIP#487090: FvDxeValidatePpi.c, FvDxeValidatePpi1.c: Validated following items form the compliancy list:

-GCC/Linux compliance. We’re using Ubuntu 18.04 with the default GCC distribution as a baseline.

-Fix Microsoft lever 4 warnings

-Fix GCC warnings

EIP addressed in this label:

EIP#426721: HW-based Root of Trust verified boot: Implement asymmetric (RSA) signature verification for PEI to DXE phase handoff

EIP#487090: Improvement for overall quality of the Aptio V source code

Files changed for EIP fixes:

Known issues and limitations in this label:

Use “AmiCryptoPkg” label AmiCryptoPkg_37 or newer

For the rom layouts with PEI code split between FV_BB and FV_BB_AFTER_MEMORY (e.g. projects with Intel Boot Guard), the following PEI services (ffs) must be stored inside FV_BB (IBB):

1. FWKey; FwKeyHobPei (always)

2. FvDxeValidatePpi (always)

3. CryptoPpi (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

4. DxeIpl (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

5. PEI Recovery services (only if FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

Validation Testing:

Validation for label AmiTrustedFvPkg_03 was completed by AMI BQA. Test results are available for internal review at this link…

3rd Party Code Present in Component:

Release History:

Release Notes 2

© American Megatrends Inc.


Release Notes - NDA Required

Information:

Component Name: Aptio Verified DXE Boot (Trusted FV)

Component Type: PEI driver

AMI BIOS Core: Aptio V

Location on SourceSafe: SS: AptioV;$/AptioV/Sources/Interface/AmiTrustedFvPkg

Project: 0JQBO

Label: AmiTrustedFvPkg_05

Date: 12-31-2019

Component Description:

This component provides PEI services for 2nd stage EFI code verification (PEI-DXE handoff) in Aptio projects.

1st stage verification is performed by a Service Processor as a HW root of trust, e.g. by Intel’s BootGuard ACM or AMD PSP.

Module consists of the following parts:
- FvDxeValidate: Verified FV DXE Code (PEI)
- FvDxeSig :FV DXE Certificate ffs file placeholder
- FvDxeKey :Root FW Key template (redundant module part if Secure Flash component provides the FwKeys)

Module requires generic Aptio module(s):
-AmiCrypto Package (label 37 and later);

(BQA Testing) Optional module containing Ami Test keys:
-SecureFlash.Ami Test FwKey store

Important information about the component:

eModule does not include FW Sign keys.

AmiTrustedFvPkg eModule is sharing sign key (Platform FW Key) and the signature configuration with Aptio Secure Flash.

Instructions to obtain/generate/manage the FW Platform keys are provided in Secure Flash porting guide document.

Build time generation of a signed FV DXE certificate (a.k.a FvDxeSig ffs) is controlled by FVDXE_SIGNED SDL token (by default it is enabled).

Following items will be included in the final Aptio FW image:

1. FWkey ffs with the Root Platform Key (FWpub) to verify signed FVs

A dummy ffs with FwKey placeholder is created if FWpub key was not available at a build time.

Note: Default FwKey can be replaced with the public portion of the Sign Key using CryptoCon signing process

Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

Warning: BIOS will fail to boot unless a valid Platform verification key is included in FWKey FFS

2. FvDxeSig ffs with modified Rom layout map and the space to embed the final FV DXE signature.

There are 2 types of signing certificates supported (selectable through SDL token FVDXE_CERT_FORMAT):

0 (default): PKCS#1 v1.5 format with RSA EMSA-PKCS or EMSA_PSS padding schemes using fixed hash SHA256 and RSA 2048 bit key;

1 : PKCS#7 DER certificate with the signed digest types ranging from SHA256 to SHA512 and RSA 2048 to 8192bit key sizes (larger RSA key sizes have not been verified).

The signature is calculated for all Firmware Volumes in the Rom layout map with attribute “Measured” (commonly used in FVs containing DXE & BDS UEFI code).

FvDxe signing will be invoked after Aptio ROM image is generated at the end of Apto build process.

Warning: Built process will be aborted if FvDxe sign key (FWpriv) is not available at a time of build

It is very important that BIOS project owners implement proper security protocols that follow common industry standards for protecting the BIOS image signing process and preventing un-authorized parties from tempering with the Platform FW key.

Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using hardware security module (HSM) or AMI Remote Signing Server.

AMI Build Tools:

Tools Label: BuildTools_34

Visual eBios: RSS.7.17.0302

Required Fixes are in Red

New features added in this label:

General Bug Fixes:

EIP#

EIP addressed in this label:

EIP#

Files changed for EIP fixes:

Known issues and limitations in this label:

Use “AmiCryptoPkg” label AmiCryptoPkg_37 or newer

For the rom layouts with PEI code split between FV_BB and FV_BB_AFTER_MEMORY (e.g. projects with Intel Boot Guard), the following PEI services (ffs) must be stored inside FV_BB (IBB):

1. FWKey; FwKeyHobPei (always)

2. FvDxeValidatePpi (always)

3. CryptoPpi (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

4. DxeIpl (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

5. PEI Recovery services (only if FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

Validation Testing:

Validation for label AmiTrustedFvPkg_03 was completed by AMI BQA. Test results are available for internal review at this link…

3rd Party Code Present in Component:

Release History:

Release Notes 4

Release Notes 3

Release Notes 2

© American Megatrends Inc.


Release Notes - NDA Required

Information:

Component Name: Aptio Verified DXE Boot (Trusted FV)

Component Type: PEI driver

AMI BIOS Core: Aptio V

Location on SourceSafe: SS: AptioV;$/AptioV/Sources/Interface/AmiTrustedFvPkg

Project: 0JQBO

Label: AmiTrustedFvPkg_05

Date: 08-11-2020

Component Description:

This component provides PEI services for 2nd stage EFI code verification (PEI-DXE handoff) in Aptio projects.

1st stage verification is performed by a Service Processor as a HW root of trust, e.g. by Intel’s BootGuard ACM or AMD PSP.

Module consists of the following parts:
- FvDxeValidate: Verified FV DXE Code (PEI)
- FvDxeSig :FV DXE Certificate ffs file placeholder
- FvDxeKey :Root FW Key template (redundant module part if Secure Flash component provides the FwKeys)

Module requires generic Aptio module(s): AmiCrypto Package (label 42 and later);

(BQA Testing) Optional module containing Ami Test keys: SecureFlash.Ami Test FwKey store

Important information about the component:

eModule does not include FW Sign keys.

AmiTrustedFvPkg eModule is sharing the sign key (Platform FW Key) and the signature configuration with Aptio Secure Flash.

Instructions to obtain/generate/manage the FW Platform keys are provided in Secure Flash porting guide document.

Build time generation of a signed FV DXE certificate (a.k.a FvDxeSig ffs) is controlled by FVDXE_SIGNED SDL token (by default it is enabled).

Following items will be included in the final Aptio FW image:

1. FWkey ffs with the Root Platform Key (FWpub) to verify signed FVs

A dummy ffs with FwKey placeholder is created if FWpub key was not available at a build time.

Note: Default FwKey can be replaced with the public portion of the Sign Key using CryptoCon signing process

Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

Warning: BIOS will fail to boot unless a valid Platform verification key is included in FWKey FFS

2. FvDxeSig ffs with modified Rom layout map and the space to embed the final FV DXE signature.

There are 2 types of signing certificates supported (selectable through SDL token FVDXE_CERT_FORMAT):

0 (default): PKCS#1 v1.5 format with RSA EMSA-PKCS or EMSA_PSS padding schemes using fixed hash SHA256 and RSA 2048 bit key;

1 : PKCS#7 DER certificate with the signed digest types ranging from SHA256 to SHA512 and RSA 2048 to 8192bit key sizes (larger RSA key sizes have not been verified).

The signature is calculated for all Firmware Volumes in the Rom layout map with attribute “Measured” (commonly used in FVs containing DXE & BDS UEFI code).

FvDxe signing will be invoked after Aptio ROM image is generated at the end of Apto build process.

Warning: Built process will be aborted if FvDxe sign key (FWpriv) is not available at a time of build

Important note: When both Secure Flash and AmiTrustedFvPkg modules are enabled inside the BIOS source, the signing sequence must be followed.

After signing (re-signing in post build process) the FV DXE section in the BIOS image, the whole BIOS needs to be re-signed with the same signing key for Secure Flash.

It is very important that BIOS project owners implement proper security protocols that follow common industry standards for protecting the BIOS image signing process and preventing un-authorized parties from tempering with the Platform FW key.

Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using hardware security module (HSM) or AMI Remote Signing Server.

AMI Build Tools:

Tools Label: BuildTools_34

Visual eBios: RSS.7.17.0302

Required Fixes are in Red

New features added in this label:

Update AMI Copyright headers

EIP#530555: FvBbSig.cif,.sdl,.mak,.inf,.cbin: Add new module part with the build script to include FvBbSig Hdr ffs file and a sign script.

EIP#530632: Proper functioning of FvBbSign scripts requires new version of Fwbuild.exe tool provided with EIP#530632 (TOOLS_37)

EIP#520731: AmiTrustedFvPkd.sdl,.mak: Add FUSS (firmware update sign script) scripts and build switches to congregate all Aptio Fw signing instructions in a single sequence of sign scripts.

EIP#530552: FvDxeValidatePpi.c; FvDxeValidatePpi1.c;FvDxeSig.cbin: Generate FvDxeSig Hdr with new Hash Mfst table that is replacing FvCap Hdr RomLayout section.

Update FvDxeValidatePpi logic to process new Hash Mfst table. Support individual FV range validation as opposed to all FVs at once.

New logic will allow FV_BB fault tolerant recovery and regular recovery on the platforms with Recovery PEI services located outside the FV_BB in one of Vital FVs (e.g.

FV_BB_AFTER_MEMORY) that have been successfully validated.

FvDxeValidatePpi.c; FvDxeValidatePpi1.c; FvDxeValidateOnPublish.c: IsFvMeasured() routines implement uniform policy that detects “to-be measured” firmware volumes.

The measured ranges are determined by a combination of Rom attributes: AMI_ROM_AREA_TCG_MEASURED or one of DXE/DXE2/BDS/PEI_AFTER_MEM

General Bug Fixes:

EIP#487090: FvDxeValidatePpi1.c: Fix GCC warnings

EIP addressed in this label:

EIP#487090: GCC/Linux compliance

EIP#530555: AmiTrustedFvPkg: add support for NightFury FV_BB validation

EIP#530632: Need to include the new command line switch to output only the hashed region of FV_BB

EIP#530552: New design for Signed Fw Manifest data structure

EIP#520731: Design common requirements for AmiRom Firmware Unified Signing Scripts (amiromFUSS)

Files changed for EIP fixes:

Known issues and limitations in this label:

Use “AmiCryptoPkg” label AmiCryptoPkg_42 or newer

For the rom layouts with PEI code split between FV_BB and FV_BB_AFTER_MEMORY (e.g. projects with Intel Boot Guard), the following PEI services (ffs) must be located inside FV_BB (IBB):

1. FWKey; FwKeyHobPei (always)

2. FvDxeValidatePpi (always)

3. CryptoPpi (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

4. DxeIpl (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

5. PEI Recovery services (only if FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0 if the FV_BB_AFTER_MEMORY cannot be dispatched due corruption)

Validation Testing:

Validation for label AmiTrustedFvPkg_05 was completed by AMI BQA. Test results are available for internal review at this link…

3rd Party Code Present in Component:

Release History:

Release Notes 4

Release Notes 3

Release Notes 2

© American Megatrends Inc.


Release Notes - NDA Required

Information:

Component Name: Aptio Verified DXE Boot (Trusted FV)

Component Type: PEI driver

AMI BIOS Core: Aptio V

Location on SourceSafe: SS: AptioV;$/AptioV/Sources/Interface/AmiTrustedFvPkg

Project: 0JQBO

Label: AmiTrustedFvPkg_06

Date: 10-07-2020

Component Description:

This component provides PEI services for 2nd stage EFI code verification (PEI-DXE handoff) in Aptio projects.

1st stage verification is performed by a Service Processor as a HW root of trust, e.g. by Intel’s BootGuard ACM or AMD PSP.

Module consists of the following parts:
- FvDxeValidate: Verified FV DXE Code (PEI)
- FvDxeSig :FV DXE Certificate ffs file placeholder
- FvDxeKey :Root FW Key template (redundant module part if Secure Flash component provides the FwKeys)

Module requires generic Aptio module(s): AmiCrypto Package (label 42 and later);

(BQA Testing) Optional module containing Ami Test keys: SecureFlash.Ami Test FwKey store

Important information about the component:

eModule does not include FW Sign keys.

AmiTrustedFvPkg eModule is sharing the sign key (Platform FW Key) and the signature configuration with Aptio Secure Flash.

Instructions to obtain/generate/manage the FW Platform keys are provided in Secure Flash porting guide document.

Build time generation of a signed FV DXE certificate (a.k.a FvDxeSig ffs) is controlled by FVDXE_SIGNED SDL token (by default it is enabled).

Following items will be included in the final Aptio FW image:

1. FWkey ffs with the Root Platform Key (FWpub) to verify signed FVs

A dummy ffs with FwKey placeholder is created if FWpub key was not available at a build time.

Note: Default FwKey can be replaced with the public portion of the Sign Key using CryptoCon signing process

Use ‘-n -k’ instructions to replace the key in FWkey ffs file location.

Warning: BIOS will fail to boot unless a valid Platform verification key is included in FWKey FFS

2. FvDxeSig ffs with modified Rom layout map and the space to embed the final FV DXE signature.

There are 2 types of signing certificates supported (selectable through SDL token FVDXE_CERT_FORMAT):

0 (default): PKCS#1 v1.5 format with RSA EMSA-PKCS or EMSA_PSS padding schemes using fixed hash SHA256 and RSA 2048 bit key;

1 : PKCS#7 DER certificate with the signed digest types ranging from SHA256 to SHA512 and RSA 2048 to 8192bit key sizes (larger RSA key sizes have not been verified).

The signature is calculated for all Firmware Volumes in the Rom layout map with attribute “Measured” (commonly used in FVs containing DXE & BDS UEFI code).

FvDxe signing will be invoked after Aptio ROM image is generated at the end of Apto build process.

Warning: Built process will be aborted if FvDxe sign key (FWpriv) is not available at a time of build

Important note: When both Secure Flash and AmiTrustedFvPkg modules are enabled inside the BIOS source, the signing sequence must be followed.

After signing (re-signing in post build process) the FV DXE section in the BIOS image, the whole BIOS needs to be re-signed with the same signing key for Secure Flash.

It is very important that BIOS project owners implement proper security protocols that follow common industry standards for protecting the BIOS image signing process and preventing un-authorized parties from tempering with the Platform FW key.

Contact your AMI representative to get more information about secure mechanisms of signing of Aptio FW Images using hardware security module (HSM) or AMI Remote Signing Server.

AMI Build Tools:

Tools Label: BuildTools_34

Visual eBios: RSS.7.17.0302

Required Fixes are in Red

New features added in this label:

AmiTrustedFvPkd.sdl,.mak;FvDxeSig.sdl,*.mak;FvBbsig.sdl,*.mak: Resolve dual key sign issues in signing scripts.

FvDxeValidate.sdl, FvDxeValidateOnPublish.c: Streamline control over printed debug messages. By default only standard platform messages are displayed

AmiTrustedFvPkd.sdl,.mak: Implement self-generated sign script for Linux bash

General Bug Fixes:

EIP#487090: FvDxeValidatePpi.c: Fix GCC error and a warning for Linux build.

FvDxeValidatePpi.c 217:82: error: lvalue required as unary ‘&’ operand; 985:12: warning: unused variable ‘Ppi’ [-Wunused-variable]

EIP addressed in this label:

EIP#487090: GCC/Linux compliance

Files changed for EIP fixes:

Known issues and limitations in this label:

Use “AmiCryptoPkg” label AmiCryptoPkg_42 or newer

For the rom layouts with PEI code split between FV_BB and FV_BB_AFTER_MEMORY (e.g. projects with Intel Boot Guard), the following PEI services (ffs) must be located inside FV_BB (IBB):

1. FWKey; FwKeyHobPei (always)

2. FvDxeValidatePpi (always)

3. CryptoPpi (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

4. DxeIpl (only if FVDXE_VERIFY_BEFORE_MRC = 0 or FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0)

5. PEI Recovery services (only if FVDXE_VERIFY_FAILED_RECOVERY_POLICY = 0 if the FV_BB_AFTER_MEMORY cannot be dispatched due corruption)

Validation Testing:

Test results are available for internal review at this link…

3rd Party Code Present in Component:

Release History:

Release Notes 5

Release Notes 4

Release Notes 3

Release Notes 2

© American Megatrends Inc.