xref: /freebsd/sys/contrib/edk2/Include/Guid/ImageAuthentication.h (revision 3c5ca68b9b7ce68a5376b8456edf6af57ed18f91)
1*3c5ca68bSWarner Losh /** @file
2*3c5ca68bSWarner Losh   Image signature database are defined for the signed image validation.
3*3c5ca68bSWarner Losh 
4*3c5ca68bSWarner Losh   Copyright (c) 2009 - 2024, Intel Corporation. All rights reserved.<BR>
5*3c5ca68bSWarner Losh   SPDX-License-Identifier: BSD-2-Clause-Patent
6*3c5ca68bSWarner Losh 
7*3c5ca68bSWarner Losh   @par Revision Reference:
8*3c5ca68bSWarner Losh   GUIDs defined in UEFI 2.5 spec.
9*3c5ca68bSWarner Losh **/
10*3c5ca68bSWarner Losh 
11*3c5ca68bSWarner Losh #ifndef __IMAGE_AUTHTICATION_H__
12*3c5ca68bSWarner Losh #define __IMAGE_AUTHTICATION_H__
13*3c5ca68bSWarner Losh 
14*3c5ca68bSWarner Losh #include <Guid/GlobalVariable.h>
15*3c5ca68bSWarner Losh #include <Protocol/Hash.h>
16*3c5ca68bSWarner Losh 
17*3c5ca68bSWarner Losh #define EFI_IMAGE_SECURITY_DATABASE_GUID \
18*3c5ca68bSWarner Losh   { \
19*3c5ca68bSWarner Losh     0xd719b2cb, 0x3d3a, 0x4596, { 0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f } \
20*3c5ca68bSWarner Losh   }
21*3c5ca68bSWarner Losh 
22*3c5ca68bSWarner Losh ///
23*3c5ca68bSWarner Losh /// Varialbe name with guid EFI_IMAGE_SECURITY_DATABASE_GUID
24*3c5ca68bSWarner Losh /// for the authorized signature database.
25*3c5ca68bSWarner Losh ///
26*3c5ca68bSWarner Losh #define EFI_IMAGE_SECURITY_DATABASE  L"db"
27*3c5ca68bSWarner Losh ///
28*3c5ca68bSWarner Losh /// Varialbe name with guid EFI_IMAGE_SECURITY_DATABASE_GUID
29*3c5ca68bSWarner Losh /// for the forbidden signature database.
30*3c5ca68bSWarner Losh ///
31*3c5ca68bSWarner Losh #define EFI_IMAGE_SECURITY_DATABASE1  L"dbx"
32*3c5ca68bSWarner Losh ///
33*3c5ca68bSWarner Losh /// Variable name with guid EFI_IMAGE_SECURITY_DATABASE_GUID
34*3c5ca68bSWarner Losh /// for the timestamp signature database.
35*3c5ca68bSWarner Losh ///
36*3c5ca68bSWarner Losh #define EFI_IMAGE_SECURITY_DATABASE2  L"dbt"
37*3c5ca68bSWarner Losh 
38*3c5ca68bSWarner Losh #define SECURE_BOOT_MODE_ENABLE   1
39*3c5ca68bSWarner Losh #define SECURE_BOOT_MODE_DISABLE  0
40*3c5ca68bSWarner Losh 
41*3c5ca68bSWarner Losh #define SETUP_MODE  1
42*3c5ca68bSWarner Losh #define USER_MODE   0
43*3c5ca68bSWarner Losh 
44*3c5ca68bSWarner Losh #define DEVICE_AUTH_BOOT_MODE_ENABLE   1
45*3c5ca68bSWarner Losh #define DEVICE_AUTH_BOOT_MODE_DISABLE  0
46*3c5ca68bSWarner Losh 
47*3c5ca68bSWarner Losh // ***********************************************************************
48*3c5ca68bSWarner Losh // Signature Database
49*3c5ca68bSWarner Losh // ***********************************************************************
50*3c5ca68bSWarner Losh ///
51*3c5ca68bSWarner Losh /// The format of a signature database.
52*3c5ca68bSWarner Losh ///
53*3c5ca68bSWarner Losh #pragma pack(1)
54*3c5ca68bSWarner Losh 
55*3c5ca68bSWarner Losh typedef struct {
56*3c5ca68bSWarner Losh   ///
57*3c5ca68bSWarner Losh   /// An identifier which identifies the agent which added the signature to the list.
58*3c5ca68bSWarner Losh   ///
59*3c5ca68bSWarner Losh   EFI_GUID    SignatureOwner;
60*3c5ca68bSWarner Losh   ///
61*3c5ca68bSWarner Losh   /// The format of the signature is defined by the SignatureType.
62*3c5ca68bSWarner Losh   ///
63*3c5ca68bSWarner Losh   UINT8       SignatureData[1];
64*3c5ca68bSWarner Losh } EFI_SIGNATURE_DATA;
65*3c5ca68bSWarner Losh 
66*3c5ca68bSWarner Losh typedef struct {
67*3c5ca68bSWarner Losh   ///
68*3c5ca68bSWarner Losh   /// Type of the signature. GUID signature types are defined in below.
69*3c5ca68bSWarner Losh   ///
70*3c5ca68bSWarner Losh   EFI_GUID    SignatureType;
71*3c5ca68bSWarner Losh   ///
72*3c5ca68bSWarner Losh   /// Total size of the signature list, including this header.
73*3c5ca68bSWarner Losh   ///
74*3c5ca68bSWarner Losh   UINT32      SignatureListSize;
75*3c5ca68bSWarner Losh   ///
76*3c5ca68bSWarner Losh   /// Size of the signature header which precedes the array of signatures.
77*3c5ca68bSWarner Losh   ///
78*3c5ca68bSWarner Losh   UINT32      SignatureHeaderSize;
79*3c5ca68bSWarner Losh   ///
80*3c5ca68bSWarner Losh   /// Size of each signature.
81*3c5ca68bSWarner Losh   ///
82*3c5ca68bSWarner Losh   UINT32      SignatureSize;
83*3c5ca68bSWarner Losh   ///
84*3c5ca68bSWarner Losh   /// Header before the array of signatures. The format of this header is specified
85*3c5ca68bSWarner Losh   /// by the SignatureType.
86*3c5ca68bSWarner Losh   /// UINT8           SignatureHeader[SignatureHeaderSize];
87*3c5ca68bSWarner Losh   ///
88*3c5ca68bSWarner Losh   /// An array of signatures. Each signature is SignatureSize bytes in length.
89*3c5ca68bSWarner Losh   /// EFI_SIGNATURE_DATA Signatures[][SignatureSize];
90*3c5ca68bSWarner Losh   ///
91*3c5ca68bSWarner Losh } EFI_SIGNATURE_LIST;
92*3c5ca68bSWarner Losh 
93*3c5ca68bSWarner Losh typedef struct {
94*3c5ca68bSWarner Losh   ///
95*3c5ca68bSWarner Losh   /// The SHA256 hash of an X.509 certificate's To-Be-Signed contents.
96*3c5ca68bSWarner Losh   ///
97*3c5ca68bSWarner Losh   EFI_SHA256_HASH    ToBeSignedHash;
98*3c5ca68bSWarner Losh   ///
99*3c5ca68bSWarner Losh   /// The time that the certificate shall be considered to be revoked.
100*3c5ca68bSWarner Losh   ///
101*3c5ca68bSWarner Losh   EFI_TIME           TimeOfRevocation;
102*3c5ca68bSWarner Losh } EFI_CERT_X509_SHA256;
103*3c5ca68bSWarner Losh 
104*3c5ca68bSWarner Losh typedef struct {
105*3c5ca68bSWarner Losh   ///
106*3c5ca68bSWarner Losh   /// The SHA384 hash of an X.509 certificate's To-Be-Signed contents.
107*3c5ca68bSWarner Losh   ///
108*3c5ca68bSWarner Losh   EFI_SHA384_HASH    ToBeSignedHash;
109*3c5ca68bSWarner Losh   ///
110*3c5ca68bSWarner Losh   /// The time that the certificate shall be considered to be revoked.
111*3c5ca68bSWarner Losh   ///
112*3c5ca68bSWarner Losh   EFI_TIME           TimeOfRevocation;
113*3c5ca68bSWarner Losh } EFI_CERT_X509_SHA384;
114*3c5ca68bSWarner Losh 
115*3c5ca68bSWarner Losh typedef struct {
116*3c5ca68bSWarner Losh   ///
117*3c5ca68bSWarner Losh   /// The SHA512 hash of an X.509 certificate's To-Be-Signed contents.
118*3c5ca68bSWarner Losh   ///
119*3c5ca68bSWarner Losh   EFI_SHA512_HASH    ToBeSignedHash;
120*3c5ca68bSWarner Losh   ///
121*3c5ca68bSWarner Losh   /// The time that the certificate shall be considered to be revoked.
122*3c5ca68bSWarner Losh   ///
123*3c5ca68bSWarner Losh   EFI_TIME           TimeOfRevocation;
124*3c5ca68bSWarner Losh } EFI_CERT_X509_SHA512;
125*3c5ca68bSWarner Losh 
126*3c5ca68bSWarner Losh typedef UINT8 EFI_SM3_HASH[32];
127*3c5ca68bSWarner Losh 
128*3c5ca68bSWarner Losh typedef struct {
129*3c5ca68bSWarner Losh   ///
130*3c5ca68bSWarner Losh   /// The SM3 hash of an X.509 certificate's To-Be-Signed contents.
131*3c5ca68bSWarner Losh   ///
132*3c5ca68bSWarner Losh   EFI_SM3_HASH    ToBeSignedHash;
133*3c5ca68bSWarner Losh   ///
134*3c5ca68bSWarner Losh   /// The time that the certificate shall be considered to be revoked.
135*3c5ca68bSWarner Losh   ///
136*3c5ca68bSWarner Losh   EFI_TIME        TimeOfRevocation;
137*3c5ca68bSWarner Losh } EFI_CERT_X509_SM3;
138*3c5ca68bSWarner Losh 
139*3c5ca68bSWarner Losh #pragma pack()
140*3c5ca68bSWarner Losh 
141*3c5ca68bSWarner Losh ///
142*3c5ca68bSWarner Losh /// This identifies a signature containing a SHA-256 hash. The SignatureHeader size shall
143*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of SignatureOwner component) +
144*3c5ca68bSWarner Losh /// 32 bytes.
145*3c5ca68bSWarner Losh ///
146*3c5ca68bSWarner Losh #define EFI_CERT_SHA256_GUID \
147*3c5ca68bSWarner Losh   { \
148*3c5ca68bSWarner Losh     0xc1c41626, 0x504c, 0x4092, {0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28} \
149*3c5ca68bSWarner Losh   }
150*3c5ca68bSWarner Losh 
151*3c5ca68bSWarner Losh ///
152*3c5ca68bSWarner Losh /// This identifies a signature containing an RSA-2048 key. The key (only the modulus
153*3c5ca68bSWarner Losh /// since the public key exponent is known to be 0x10001) shall be stored in big-endian
154*3c5ca68bSWarner Losh /// order.
155*3c5ca68bSWarner Losh /// The SignatureHeader size shall always be 0. The SignatureSize shall always be 16 (size
156*3c5ca68bSWarner Losh /// of SignatureOwner component) + 256 bytes.
157*3c5ca68bSWarner Losh ///
158*3c5ca68bSWarner Losh #define EFI_CERT_RSA2048_GUID \
159*3c5ca68bSWarner Losh   { \
160*3c5ca68bSWarner Losh     0x3c5766e8, 0x269c, 0x4e34, {0xaa, 0x14, 0xed, 0x77, 0x6e, 0x85, 0xb3, 0xb6} \
161*3c5ca68bSWarner Losh   }
162*3c5ca68bSWarner Losh 
163*3c5ca68bSWarner Losh ///
164*3c5ca68bSWarner Losh /// This identifies a signature containing a RSA-2048 signature of a SHA-256 hash.  The
165*3c5ca68bSWarner Losh /// SignatureHeader size shall always be 0. The SignatureSize shall always be 16 (size of
166*3c5ca68bSWarner Losh /// SignatureOwner component) + 256 bytes.
167*3c5ca68bSWarner Losh ///
168*3c5ca68bSWarner Losh #define EFI_CERT_RSA2048_SHA256_GUID \
169*3c5ca68bSWarner Losh   { \
170*3c5ca68bSWarner Losh     0xe2b36190, 0x879b, 0x4a3d, {0xad, 0x8d, 0xf2, 0xe7, 0xbb, 0xa3, 0x27, 0x84} \
171*3c5ca68bSWarner Losh   }
172*3c5ca68bSWarner Losh 
173*3c5ca68bSWarner Losh ///
174*3c5ca68bSWarner Losh /// This identifies a signature containing a SHA-1 hash.  The SignatureSize shall always
175*3c5ca68bSWarner Losh /// be 16 (size of SignatureOwner component) + 20 bytes.
176*3c5ca68bSWarner Losh ///
177*3c5ca68bSWarner Losh #define EFI_CERT_SHA1_GUID \
178*3c5ca68bSWarner Losh   { \
179*3c5ca68bSWarner Losh     0x826ca512, 0xcf10, 0x4ac9, {0xb1, 0x87, 0xbe, 0x1, 0x49, 0x66, 0x31, 0xbd} \
180*3c5ca68bSWarner Losh   }
181*3c5ca68bSWarner Losh 
182*3c5ca68bSWarner Losh ///
183*3c5ca68bSWarner Losh /// This identifies a signature containing a SM3 hash.  The SignatureSize shall always
184*3c5ca68bSWarner Losh /// be 16 (size of SignatureOwner component) + 32 bytes.
185*3c5ca68bSWarner Losh ///
186*3c5ca68bSWarner Losh #define EFI_CERT_SM3_GUID \
187*3c5ca68bSWarner Losh   { \
188*3c5ca68bSWarner Losh     0x57347f87, 0x7a9b, 0x403a, { 0xb9, 0x3c, 0xdc, 0x4a, 0xfb, 0x7a, 0xe, 0xbc } \
189*3c5ca68bSWarner Losh   }
190*3c5ca68bSWarner Losh 
191*3c5ca68bSWarner Losh ///
192*3c5ca68bSWarner Losh /// TThis identifies a signature containing a RSA-2048 signature of a SHA-1 hash.  The
193*3c5ca68bSWarner Losh /// SignatureHeader size shall always be 0. The SignatureSize shall always be 16 (size of
194*3c5ca68bSWarner Losh /// SignatureOwner component) + 256 bytes.
195*3c5ca68bSWarner Losh ///
196*3c5ca68bSWarner Losh #define EFI_CERT_RSA2048_SHA1_GUID \
197*3c5ca68bSWarner Losh   { \
198*3c5ca68bSWarner Losh     0x67f8444f, 0x8743, 0x48f1, {0xa3, 0x28, 0x1e, 0xaa, 0xb8, 0x73, 0x60, 0x80} \
199*3c5ca68bSWarner Losh   }
200*3c5ca68bSWarner Losh 
201*3c5ca68bSWarner Losh ///
202*3c5ca68bSWarner Losh /// This identifies a signature based on an X.509 certificate. If the signature is an X.509
203*3c5ca68bSWarner Losh /// certificate then verification of the signature of an image should validate the public
204*3c5ca68bSWarner Losh /// key certificate in the image using certificate path verification, up to this X.509
205*3c5ca68bSWarner Losh /// certificate as a trusted root.  The SignatureHeader size shall always be 0. The
206*3c5ca68bSWarner Losh /// SignatureSize may vary but shall always be 16 (size of the SignatureOwner component) +
207*3c5ca68bSWarner Losh /// the size of the certificate itself.
208*3c5ca68bSWarner Losh /// Note: This means that each certificate will normally be in a separate EFI_SIGNATURE_LIST.
209*3c5ca68bSWarner Losh ///
210*3c5ca68bSWarner Losh #define EFI_CERT_X509_GUID \
211*3c5ca68bSWarner Losh   { \
212*3c5ca68bSWarner Losh     0xa5c059a1, 0x94e4, 0x4aa7, {0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72} \
213*3c5ca68bSWarner Losh   }
214*3c5ca68bSWarner Losh 
215*3c5ca68bSWarner Losh ///
216*3c5ca68bSWarner Losh /// This identifies a signature containing the SM3 hash of an X.509 certificate's To-Be-Signed
217*3c5ca68bSWarner Losh /// contents, and a time of revocation. The SignatureHeader size shall always be 0. The
218*3c5ca68bSWarner Losh /// SignatureSize shall always be 16 (size of the SignatureOwner component) + 32 bytes for
219*3c5ca68bSWarner Losh /// an EFI_CERT_X509_SM3 structure. If the TimeOfRevocation is non-zero, the certificate should
220*3c5ca68bSWarner Losh /// be considered to be revoked from that time and onwards, and otherwise the certificate shall
221*3c5ca68bSWarner Losh /// be considered to always be revoked.
222*3c5ca68bSWarner Losh ///
223*3c5ca68bSWarner Losh #define EFI_CERT_X509_SM3_GUID \
224*3c5ca68bSWarner Losh   { \
225*3c5ca68bSWarner Losh     0x60d807e5, 0x10b4, 0x49a9, {0x93, 0x31, 0xe4, 0x4, 0x37, 0x88, 0x8d, 0x37 } \
226*3c5ca68bSWarner Losh   }
227*3c5ca68bSWarner Losh 
228*3c5ca68bSWarner Losh ///
229*3c5ca68bSWarner Losh /// This identifies a signature containing a SHA-224 hash. The SignatureHeader size shall
230*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of SignatureOwner component) +
231*3c5ca68bSWarner Losh /// 28 bytes.
232*3c5ca68bSWarner Losh ///
233*3c5ca68bSWarner Losh #define EFI_CERT_SHA224_GUID \
234*3c5ca68bSWarner Losh   { \
235*3c5ca68bSWarner Losh     0xb6e5233, 0xa65c, 0x44c9, {0x94, 0x7, 0xd9, 0xab, 0x83, 0xbf, 0xc8, 0xbd} \
236*3c5ca68bSWarner Losh   }
237*3c5ca68bSWarner Losh 
238*3c5ca68bSWarner Losh ///
239*3c5ca68bSWarner Losh /// This identifies a signature containing a SHA-384 hash. The SignatureHeader size shall
240*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of SignatureOwner component) +
241*3c5ca68bSWarner Losh /// 48 bytes.
242*3c5ca68bSWarner Losh ///
243*3c5ca68bSWarner Losh #define EFI_CERT_SHA384_GUID \
244*3c5ca68bSWarner Losh   { \
245*3c5ca68bSWarner Losh     0xff3e5307, 0x9fd0, 0x48c9, {0x85, 0xf1, 0x8a, 0xd5, 0x6c, 0x70, 0x1e, 0x1} \
246*3c5ca68bSWarner Losh   }
247*3c5ca68bSWarner Losh 
248*3c5ca68bSWarner Losh ///
249*3c5ca68bSWarner Losh /// This identifies a signature containing a SHA-512 hash. The SignatureHeader size shall
250*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of SignatureOwner component) +
251*3c5ca68bSWarner Losh /// 64 bytes.
252*3c5ca68bSWarner Losh ///
253*3c5ca68bSWarner Losh #define EFI_CERT_SHA512_GUID \
254*3c5ca68bSWarner Losh   { \
255*3c5ca68bSWarner Losh     0x93e0fae, 0xa6c4, 0x4f50, {0x9f, 0x1b, 0xd4, 0x1e, 0x2b, 0x89, 0xc1, 0x9a} \
256*3c5ca68bSWarner Losh   }
257*3c5ca68bSWarner Losh 
258*3c5ca68bSWarner Losh ///
259*3c5ca68bSWarner Losh /// This identifies a signature containing the SHA256 hash of an X.509 certificate's
260*3c5ca68bSWarner Losh /// To-Be-Signed contents, and a time of revocation. The SignatureHeader size shall
261*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of the SignatureOwner component)
262*3c5ca68bSWarner Losh /// + 48 bytes for an EFI_CERT_X509_SHA256 structure. If the TimeOfRevocation is non-zero,
263*3c5ca68bSWarner Losh /// the certificate should be considered to be revoked from that time and onwards, and
264*3c5ca68bSWarner Losh /// otherwise the certificate shall be considered to always be revoked.
265*3c5ca68bSWarner Losh ///
266*3c5ca68bSWarner Losh #define EFI_CERT_X509_SHA256_GUID \
267*3c5ca68bSWarner Losh   { \
268*3c5ca68bSWarner Losh     0x3bd2a492, 0x96c0, 0x4079, {0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed } \
269*3c5ca68bSWarner Losh   }
270*3c5ca68bSWarner Losh 
271*3c5ca68bSWarner Losh ///
272*3c5ca68bSWarner Losh /// This identifies a signature containing the SHA384 hash of an X.509 certificate's
273*3c5ca68bSWarner Losh /// To-Be-Signed contents, and a time of revocation. The SignatureHeader size shall
274*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of the SignatureOwner component)
275*3c5ca68bSWarner Losh /// + 64 bytes for an EFI_CERT_X509_SHA384 structure. If the TimeOfRevocation is non-zero,
276*3c5ca68bSWarner Losh /// the certificate should be considered to be revoked from that time and onwards, and
277*3c5ca68bSWarner Losh /// otherwise the certificate shall be considered to always be revoked.
278*3c5ca68bSWarner Losh ///
279*3c5ca68bSWarner Losh #define EFI_CERT_X509_SHA384_GUID \
280*3c5ca68bSWarner Losh   { \
281*3c5ca68bSWarner Losh     0x7076876e, 0x80c2, 0x4ee6, {0xaa, 0xd2, 0x28, 0xb3, 0x49, 0xa6, 0x86, 0x5b } \
282*3c5ca68bSWarner Losh   }
283*3c5ca68bSWarner Losh 
284*3c5ca68bSWarner Losh ///
285*3c5ca68bSWarner Losh /// This identifies a signature containing the SHA512 hash of an X.509 certificate's
286*3c5ca68bSWarner Losh /// To-Be-Signed contents, and a time of revocation. The SignatureHeader size shall
287*3c5ca68bSWarner Losh /// always be 0. The SignatureSize shall always be 16 (size of the SignatureOwner component)
288*3c5ca68bSWarner Losh /// + 80 bytes for an EFI_CERT_X509_SHA512 structure. If the TimeOfRevocation is non-zero,
289*3c5ca68bSWarner Losh /// the certificate should be considered to be revoked from that time and onwards, and
290*3c5ca68bSWarner Losh /// otherwise the certificate shall be considered to always be revoked.
291*3c5ca68bSWarner Losh ///
292*3c5ca68bSWarner Losh #define EFI_CERT_X509_SHA512_GUID \
293*3c5ca68bSWarner Losh   { \
294*3c5ca68bSWarner Losh     0x446dbf63, 0x2502, 0x4cda, {0xbc, 0xfa, 0x24, 0x65, 0xd2, 0xb0, 0xfe, 0x9d } \
295*3c5ca68bSWarner Losh   }
296*3c5ca68bSWarner Losh 
297*3c5ca68bSWarner Losh ///
298*3c5ca68bSWarner Losh /// This identifies a signature containing a DER-encoded PKCS #7 version 1.5 [RFC2315]
299*3c5ca68bSWarner Losh /// SignedData value.
300*3c5ca68bSWarner Losh ///
301*3c5ca68bSWarner Losh #define EFI_CERT_TYPE_PKCS7_GUID \
302*3c5ca68bSWarner Losh   { \
303*3c5ca68bSWarner Losh     0x4aafd29d, 0x68df, 0x49ee, {0x8a, 0xa9, 0x34, 0x7d, 0x37, 0x56, 0x65, 0xa7} \
304*3c5ca68bSWarner Losh   }
305*3c5ca68bSWarner Losh 
306*3c5ca68bSWarner Losh // ***********************************************************************
307*3c5ca68bSWarner Losh // Image Execution Information Table Definition
308*3c5ca68bSWarner Losh // ***********************************************************************
309*3c5ca68bSWarner Losh typedef UINT32 EFI_IMAGE_EXECUTION_ACTION;
310*3c5ca68bSWarner Losh 
311*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_AUTHENTICATION      0x00000007
312*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_AUTH_UNTESTED       0x00000000
313*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_AUTH_SIG_FAILED     0x00000001
314*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_AUTH_SIG_PASSED     0x00000002
315*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_AUTH_SIG_NOT_FOUND  0x00000003
316*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_AUTH_SIG_FOUND      0x00000004
317*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_POLICY_FAILED       0x00000005
318*3c5ca68bSWarner Losh #define EFI_IMAGE_EXECUTION_INITIALIZED         0x00000008
319*3c5ca68bSWarner Losh 
320*3c5ca68bSWarner Losh //
321*3c5ca68bSWarner Losh // EFI_IMAGE_EXECUTION_INFO is added to EFI System Configuration Table
322*3c5ca68bSWarner Losh // and assigned the GUID EFI_IMAGE_SECURITY_DATABASE_GUID.
323*3c5ca68bSWarner Losh //
324*3c5ca68bSWarner Losh typedef struct {
325*3c5ca68bSWarner Losh   ///
326*3c5ca68bSWarner Losh   /// Describes the action taken by the firmware regarding this image.
327*3c5ca68bSWarner Losh   ///
328*3c5ca68bSWarner Losh   EFI_IMAGE_EXECUTION_ACTION    Action;
329*3c5ca68bSWarner Losh   ///
330*3c5ca68bSWarner Losh   /// Size of all of the entire structure.
331*3c5ca68bSWarner Losh   ///
332*3c5ca68bSWarner Losh   UINT32                        InfoSize;
333*3c5ca68bSWarner Losh   ///
334*3c5ca68bSWarner Losh   /// If this image was a UEFI device driver (for option ROM, for example) this is the
335*3c5ca68bSWarner Losh   /// null-terminated, user-friendly name for the device. If the image was for an application,
336*3c5ca68bSWarner Losh   /// then this is the name of the application. If this cannot be determined, then a simple
337*3c5ca68bSWarner Losh   /// NULL character should be put in this position.
338*3c5ca68bSWarner Losh   /// CHAR16                    Name[];
339*3c5ca68bSWarner Losh   ///
340*3c5ca68bSWarner Losh 
341*3c5ca68bSWarner Losh   ///
342*3c5ca68bSWarner Losh   /// For device drivers, this is the device path of the device for which this device driver
343*3c5ca68bSWarner Losh   /// was intended. In some cases, the driver itself may be stored as part of the system
344*3c5ca68bSWarner Losh   /// firmware, but this field should record the device's path, not the firmware path. For
345*3c5ca68bSWarner Losh   /// applications, this is the device path of the application. If this cannot be determined,
346*3c5ca68bSWarner Losh   /// a simple end-of-path device node should be put in this position.
347*3c5ca68bSWarner Losh   /// EFI_DEVICE_PATH_PROTOCOL  DevicePath;
348*3c5ca68bSWarner Losh   ///
349*3c5ca68bSWarner Losh 
350*3c5ca68bSWarner Losh   ///
351*3c5ca68bSWarner Losh   /// Zero or more image signatures. If the image contained no signatures,
352*3c5ca68bSWarner Losh   /// then this field is empty.
353*3c5ca68bSWarner Losh   /// EFI_SIGNATURE_LIST            Signature;
354*3c5ca68bSWarner Losh   ///
355*3c5ca68bSWarner Losh } EFI_IMAGE_EXECUTION_INFO;
356*3c5ca68bSWarner Losh 
357*3c5ca68bSWarner Losh typedef struct {
358*3c5ca68bSWarner Losh   ///
359*3c5ca68bSWarner Losh   /// Number of EFI_IMAGE_EXECUTION_INFO structures.
360*3c5ca68bSWarner Losh   ///
361*3c5ca68bSWarner Losh   UINTN    NumberOfImages;
362*3c5ca68bSWarner Losh   ///
363*3c5ca68bSWarner Losh   /// Number of image instances of EFI_IMAGE_EXECUTION_INFO structures.
364*3c5ca68bSWarner Losh   ///
365*3c5ca68bSWarner Losh   // EFI_IMAGE_EXECUTION_INFO  InformationInfo[]
366*3c5ca68bSWarner Losh } EFI_IMAGE_EXECUTION_INFO_TABLE;
367*3c5ca68bSWarner Losh 
368*3c5ca68bSWarner Losh extern EFI_GUID  gEfiImageSecurityDatabaseGuid;
369*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertSha256Guid;
370*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertRsa2048Guid;
371*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertRsa2048Sha256Guid;
372*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertSha1Guid;
373*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertRsa2048Sha1Guid;
374*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertX509Guid;
375*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertSha224Guid;
376*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertSha384Guid;
377*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertSha512Guid;
378*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertX509Sha256Guid;
379*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertX509Sha384Guid;
380*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertX509Sha512Guid;
381*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertPkcs7Guid;
382*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertSm3Guid;
383*3c5ca68bSWarner Losh extern EFI_GUID  gEfiCertX509Sm3Guid;
384*3c5ca68bSWarner Losh 
385*3c5ca68bSWarner Losh #endif
386