TianoCore EDK2 master
Loading...
Searching...
No Matches
ImageAuthentication.h
Go to the documentation of this file.
1
11#ifndef __IMAGE_AUTHTICATION_H__
12#define __IMAGE_AUTHTICATION_H__
13
14#include <Guid/GlobalVariable.h>
15#include <Protocol/Hash.h>
16
17#define EFI_IMAGE_SECURITY_DATABASE_GUID \
18 { \
19 0xd719b2cb, 0x3d3a, 0x4596, { 0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f } \
20 }
21
26#define EFI_IMAGE_SECURITY_DATABASE L"db"
31#define EFI_IMAGE_SECURITY_DATABASE1 L"dbx"
36#define EFI_IMAGE_SECURITY_DATABASE2 L"dbt"
37
38#define SECURE_BOOT_MODE_ENABLE 1
39#define SECURE_BOOT_MODE_DISABLE 0
40
41#define SETUP_MODE 1
42#define USER_MODE 0
43
44#define DEVICE_AUTH_BOOT_MODE_ENABLE 1
45#define DEVICE_AUTH_BOOT_MODE_DISABLE 0
46
47// ***********************************************************************
48// Signature Database
49// ***********************************************************************
53#pragma pack(1)
54
55typedef struct {
63 UINT8 SignatureData[1];
65
66typedef struct {
92
93typedef struct {
97 EFI_SHA256_HASH ToBeSignedHash;
103
104typedef struct {
108 EFI_SHA384_HASH ToBeSignedHash;
114
115typedef struct {
119 EFI_SHA512_HASH ToBeSignedHash;
125
126#pragma pack()
127
133#define EFI_CERT_SHA256_GUID \
134 { \
135 0xc1c41626, 0x504c, 0x4092, {0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28} \
136 }
137
145#define EFI_CERT_RSA2048_GUID \
146 { \
147 0x3c5766e8, 0x269c, 0x4e34, {0xaa, 0x14, 0xed, 0x77, 0x6e, 0x85, 0xb3, 0xb6} \
148 }
149
155#define EFI_CERT_RSA2048_SHA256_GUID \
156 { \
157 0xe2b36190, 0x879b, 0x4a3d, {0xad, 0x8d, 0xf2, 0xe7, 0xbb, 0xa3, 0x27, 0x84} \
158 }
159
164#define EFI_CERT_SHA1_GUID \
165 { \
166 0x826ca512, 0xcf10, 0x4ac9, {0xb1, 0x87, 0xbe, 0x1, 0x49, 0x66, 0x31, 0xbd} \
167 }
168
174#define EFI_CERT_RSA2048_SHA1_GUID \
175 { \
176 0x67f8444f, 0x8743, 0x48f1, {0xa3, 0x28, 0x1e, 0xaa, 0xb8, 0x73, 0x60, 0x80} \
177 }
178
188#define EFI_CERT_X509_GUID \
189 { \
190 0xa5c059a1, 0x94e4, 0x4aa7, {0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72} \
191 }
192
198#define EFI_CERT_SHA224_GUID \
199 { \
200 0xb6e5233, 0xa65c, 0x44c9, {0x94, 0x7, 0xd9, 0xab, 0x83, 0xbf, 0xc8, 0xbd} \
201 }
202
208#define EFI_CERT_SHA384_GUID \
209 { \
210 0xff3e5307, 0x9fd0, 0x48c9, {0x85, 0xf1, 0x8a, 0xd5, 0x6c, 0x70, 0x1e, 0x1} \
211 }
212
218#define EFI_CERT_SHA512_GUID \
219 { \
220 0x93e0fae, 0xa6c4, 0x4f50, {0x9f, 0x1b, 0xd4, 0x1e, 0x2b, 0x89, 0xc1, 0x9a} \
221 }
222
231#define EFI_CERT_X509_SHA256_GUID \
232 { \
233 0x3bd2a492, 0x96c0, 0x4079, {0xb4, 0x20, 0xfc, 0xf9, 0x8e, 0xf1, 0x03, 0xed } \
234 }
235
244#define EFI_CERT_X509_SHA384_GUID \
245 { \
246 0x7076876e, 0x80c2, 0x4ee6, {0xaa, 0xd2, 0x28, 0xb3, 0x49, 0xa6, 0x86, 0x5b } \
247 }
248
257#define EFI_CERT_X509_SHA512_GUID \
258 { \
259 0x446dbf63, 0x2502, 0x4cda, {0xbc, 0xfa, 0x24, 0x65, 0xd2, 0xb0, 0xfe, 0x9d } \
260 }
261
266#define EFI_CERT_TYPE_PKCS7_GUID \
267 { \
268 0x4aafd29d, 0x68df, 0x49ee, {0x8a, 0xa9, 0x34, 0x7d, 0x37, 0x56, 0x65, 0xa7} \
269 }
270
271// ***********************************************************************
272// Image Execution Information Table Definition
273// ***********************************************************************
274typedef UINT32 EFI_IMAGE_EXECUTION_ACTION;
275
276#define EFI_IMAGE_EXECUTION_AUTHENTICATION 0x00000007
277#define EFI_IMAGE_EXECUTION_AUTH_UNTESTED 0x00000000
278#define EFI_IMAGE_EXECUTION_AUTH_SIG_FAILED 0x00000001
279#define EFI_IMAGE_EXECUTION_AUTH_SIG_PASSED 0x00000002
280#define EFI_IMAGE_EXECUTION_AUTH_SIG_NOT_FOUND 0x00000003
281#define EFI_IMAGE_EXECUTION_AUTH_SIG_FOUND 0x00000004
282#define EFI_IMAGE_EXECUTION_POLICY_FAILED 0x00000005
283#define EFI_IMAGE_EXECUTION_INITIALIZED 0x00000008
284
285//
286// EFI_IMAGE_EXECUTION_INFO is added to EFI System Configuration Table
287// and assigned the GUID EFI_IMAGE_SECURITY_DATABASE_GUID.
288//
289typedef struct {
293 EFI_IMAGE_EXECUTION_ACTION Action;
297 UINT32 InfoSize;
305
314
321
322typedef struct {
330 // EFI_IMAGE_EXECUTION_INFO InformationInfo[]
332
333extern EFI_GUID gEfiImageSecurityDatabaseGuid;
334extern EFI_GUID gEfiCertSha256Guid;
335extern EFI_GUID gEfiCertRsa2048Guid;
336extern EFI_GUID gEfiCertRsa2048Sha256Guid;
337extern EFI_GUID gEfiCertSha1Guid;
338extern EFI_GUID gEfiCertRsa2048Sha1Guid;
339extern EFI_GUID gEfiCertX509Guid;
340extern EFI_GUID gEfiCertSha224Guid;
341extern EFI_GUID gEfiCertSha384Guid;
342extern EFI_GUID gEfiCertSha512Guid;
343extern EFI_GUID gEfiCertX509Sha256Guid;
344extern EFI_GUID gEfiCertX509Sha384Guid;
345extern EFI_GUID gEfiCertX509Sha512Guid;
346extern EFI_GUID gEfiCertPkcs7Guid;
347
348#endif
UINT64 UINTN
EFI_SHA256_HASH ToBeSignedHash
EFI_SHA384_HASH ToBeSignedHash
EFI_SHA512_HASH ToBeSignedHash
EFI_IMAGE_EXECUTION_ACTION Action
Definition: Base.h:213