1 /** @file
2 Definition of Pei Core Structures and Services
3 
4 Copyright (c) 2013 Intel Corporation.
5 
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
10 
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.
13 
14 **/
15 
16 #ifndef _PEI_FV_SECURITY_H_
17 #define _PEI_FV_SECURITY_H_
18 
19 #include <Ppi/FirmwareVolume.h>
20 #include <Ppi/FirmwareVolumeInfo.h>
21 #include <Library/DebugLib.h>
22 #include <Library/PeiServicesLib.h>
23 #include <Library/MemoryAllocationLib.h>
24 
25 /**
26   Callback function to perform FV security checking on a FV Info PPI.
27 
28   @param PeiServices       An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
29   @param NotifyDescriptor  Address of the notification descriptor data structure.
30   @param Ppi               Address of the PPI that was installed.
31 
32   @retval EFI_SUCCESS
33 
34 **/
35 EFI_STATUS
36 EFIAPI
37 FirmwareVolmeInfoPpiNotifySecurityCallback (
38   IN EFI_PEI_SERVICES              **PeiServices,
39   IN EFI_PEI_NOTIFY_DESCRIPTOR     *NotifyDescriptor,
40   IN VOID                          *Ppi
41   );
42 
43 /**
44   Authenticates the Firmware Volume
45 
46   @param CurrentFvAddress   Pointer to the current Firmware Volume under consideration
47 
48   @retval EFI_SUCCESS       Firmware Volume is legal
49 
50 **/
51 EFI_STATUS
52 PeiSecurityVerifyFv (
53   IN EFI_FIRMWARE_VOLUME_HEADER  *CurrentFvAddress
54   );
55 
56 /**
57 
58   Entry point for the PEI Security PEIM
59   Sets up a notification to perform PEI security checking
60 
61   @param  FfsHeader    Not used.
62   @param  PeiServices  General purpose services available to every PEIM.
63 
64   @return EFI_SUCCESS  PEI Security notification installed successfully.
65           All others: PEI Security notification failed to install.
66 
67 **/
68 EFI_STATUS
69 PeiInitializeFvSecurity (
70   VOID
71   );
72 
73 #endif
74