2 EFI PEI Platform Security services
4 Copyright (c) 2013 Intel Corporation.
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include "PeiFvSecurity.h"
18 EFI_PEI_NOTIFY_DESCRIPTOR mNotifyOnFvInfoSecurityList
= {
19 (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
20 &gEfiPeiFirmwareVolumeInfoPpiGuid
,
21 FirmwareVolmeInfoPpiNotifySecurityCallback
25 Callback function to perform FV security checking on a FV Info PPI.
27 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
28 @param NotifyDescriptor Address of the notification descriptor data structure.
29 @param Ppi Address of the PPI that was installed.
36 FirmwareVolmeInfoPpiNotifySecurityCallback (
37 IN EFI_PEI_SERVICES
**PeiServices
,
38 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
43 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
44 EFI_PEI_FIRMWARE_VOLUME_PPI
*FvPpi
;
46 FvInfoPpi
= (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*)Ppi
;
49 // Locate the corresponding FV_PPI according to founded FV's format guid
51 Status
= PeiServicesLocatePpi (
57 ASSERT_EFI_ERROR (Status
);
60 // Only authenticate parent Firmware Volume (child firmware volumes are covered by the parent)
62 if ((VOID
*)FvInfoPpi
->ParentFvName
== NULL
&& (VOID
*)FvInfoPpi
->ParentFileName
== NULL
) {
63 Status
= PeiSecurityVerifyFv ((EFI_FIRMWARE_VOLUME_HEADER
*) FvInfoPpi
->FvInfo
);
64 ASSERT_EFI_ERROR (Status
);
71 Authenticates the Firmware Volume
73 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
75 @retval EFI_SUCCESS Firmware Volume is legal
80 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
86 // Call Security library to authenticate the Firmware Volume
88 DEBUG ((DEBUG_INFO
, "PeiSecurityVerifyFv - CurrentFvAddress=0x%8x\n", (UINT32
)CurrentFvAddress
));
96 Entry point for the PEI Security PEIM
97 Sets up a notification to perform PEI security checking
99 @param FfsHeader Not used.
100 @param PeiServices General purpose services available to every PEIM.
102 @return EFI_SUCCESS PEI Security notification installed successfully.
103 All others: PEI Security notification failed to install.
107 PeiInitializeFvSecurity (
113 Status
= PeiServicesNotifyPpi (&mNotifyOnFvInfoSecurityList
);