2 EFI PEI Platform Security services
4 Copyright (c) 2013 Intel Corporation.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include "PeiFvSecurity.h"
12 EFI_PEI_NOTIFY_DESCRIPTOR mNotifyOnFvInfoSecurityList
= {
13 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
14 &gEfiPeiFirmwareVolumeInfoPpiGuid
,
15 FirmwareVolmeInfoPpiNotifySecurityCallback
19 Callback function to perform FV security checking on a FV Info PPI.
21 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
22 @param NotifyDescriptor Address of the notification descriptor data structure.
23 @param Ppi Address of the PPI that was installed.
30 FirmwareVolmeInfoPpiNotifySecurityCallback (
31 IN EFI_PEI_SERVICES
**PeiServices
,
32 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
37 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
38 EFI_PEI_FIRMWARE_VOLUME_PPI
*FvPpi
;
40 FvInfoPpi
= (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*)Ppi
;
43 // Locate the corresponding FV_PPI according to founded FV's format guid
45 Status
= PeiServicesLocatePpi (
51 ASSERT_EFI_ERROR (Status
);
54 // Only authenticate parent Firmware Volume (child firmware volumes are covered by the parent)
56 if ((VOID
*)FvInfoPpi
->ParentFvName
== NULL
&& (VOID
*)FvInfoPpi
->ParentFileName
== NULL
) {
57 Status
= PeiSecurityVerifyFv ((EFI_FIRMWARE_VOLUME_HEADER
*) FvInfoPpi
->FvInfo
);
58 ASSERT_EFI_ERROR (Status
);
65 Authenticates the Firmware Volume
67 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
69 @retval EFI_SUCCESS Firmware Volume is legal
74 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
80 // Call Security library to authenticate the Firmware Volume
82 DEBUG ((DEBUG_INFO
, "PeiSecurityVerifyFv - CurrentFvAddress=0x%8x\n", (UINT32
)CurrentFvAddress
));
90 Entry point for the PEI Security PEIM
91 Sets up a notification to perform PEI security checking
93 @param FfsHeader Not used.
94 @param PeiServices General purpose services available to every PEIM.
96 @return EFI_SUCCESS PEI Security notification installed successfully.
97 All others: PEI Security notification failed to install.
101 PeiInitializeFvSecurity (
107 Status
= PeiServicesNotifyPpi (&mNotifyOnFvInfoSecurityList
);