]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/Security2.h
MdePkg: Apply uncrustify changes
[mirror_edk2.git] / MdePkg / Include / Ppi / Security2.h
1 /** @file
2 This file declares Pei Security2 PPI.
3
4 This PPI is installed by some platform PEIM that abstracts the security
5 policy to the PEI Foundation, namely the case of a PEIM's authentication
6 state being returned during the PEI section extraction process.
7
8 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
9 SPDX-License-Identifier: BSD-2-Clause-Patent
10
11 @par Revision Reference:
12 This PPI is introduced in PI Version 1.0.
13
14 **/
15
16 #ifndef __SECURITY2_PPI_H__
17 #define __SECURITY2_PPI_H__
18
19 #define EFI_PEI_SECURITY2_PPI_GUID \
20 { 0xdcd0be23, 0x9586, 0x40f4, { 0xb6, 0x43, 0x6, 0x52, 0x2c, 0xed, 0x4e, 0xde } }
21
22 typedef struct _EFI_PEI_SECURITY2_PPI EFI_PEI_SECURITY2_PPI;
23
24 /**
25 Allows the platform builder to implement a security policy
26 in response to varying file authentication states.
27
28 This service is published by some platform PEIM. The purpose of
29 this service is to expose a given platform's policy-based
30 response to the PEI Foundation. For example, if there is a PEIM
31 in a GUIDed encapsulation section and the extraction of the PEI
32 file section yields an authentication failure, there is no a
33 priori policy in the PEI Foundation. Specifically, this
34 situation leads to the question whether PEIMs that are either
35 not in GUIDed sections or are in sections whose authentication
36 fails should still be executed.
37
38 @param PeiServices An indirect pointer to the PEI Services
39 Table published by the PEI Foundation.
40 @param This Interface pointer that implements the
41 particular EFI_PEI_SECURITY2_PPI instance.
42 @param AuthenticationStatus Authentication status of the file.
43 xx00 Image was not signed.
44 xxx1 Platform security policy override.
45 Assumes same meaning as 0010 (the image was signed, the
46 signature was tested, and the signature passed authentication test).
47 0010 Image was signed, the signature was tested,
48 and the signature passed authentication test.
49 0110 Image was signed and the signature was not tested.
50 1010 Image was signed, the signature was tested,
51 and the signature failed the authentication test.
52 @param FvHandle Handle of the volume in which the file
53 resides. This allows different policies
54 depending on different firmware volumes.
55 @param FileHandle Handle of the file under review.
56 @param DeferExecution Pointer to a variable that alerts the
57 PEI Foundation to defer execution of a
58 PEIM.
59
60 @retval EFI_SUCCESS The service performed its action successfully.
61 @retval EFI_SECURITY_VIOLATION The object cannot be trusted.
62
63 **/
64 typedef
65 EFI_STATUS
66 (EFIAPI *EFI_PEI_SECURITY_AUTHENTICATION_STATE)(
67 IN CONST EFI_PEI_SERVICES **PeiServices,
68 IN CONST EFI_PEI_SECURITY2_PPI *This,
69 IN UINT32 AuthenticationStatus,
70 IN EFI_PEI_FV_HANDLE FvHandle,
71 IN EFI_PEI_FILE_HANDLE FileHandle,
72 IN OUT BOOLEAN *DeferExecution
73 );
74
75 ///
76 /// This PPI is a means by which the platform builder can indicate
77 /// a response to a PEIM's authentication state. This can be in
78 /// the form of a requirement for the PEI Foundation to skip a
79 /// module using the DeferExecution Boolean output in the
80 /// AuthenticationState() member function. Alternately, the
81 /// Security PPI can invoke something like a cryptographic PPI
82 /// that hashes the PEIM contents to log attestations, for which
83 /// the FileHandle parameter in AuthenticationState() will be
84 /// useful. If this PPI does not exist, PEIMs will be considered
85 /// trusted.
86 ///
87 struct _EFI_PEI_SECURITY2_PPI {
88 EFI_PEI_SECURITY_AUTHENTICATION_STATE AuthenticationState;
89 };
90
91 extern EFI_GUID gEfiPeiSecurity2PpiGuid;
92
93 #endif