]>
Commit | Line | Data |
---|---|---|
beda2356 | 1 | /** @file\r |
2 | Header file for NV data structure definition.\r | |
3 | \r | |
668ceb0e | 4 | Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r |
20333c6d QL |
5 | This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
beda2356 | 8 | http://opensource.org/licenses/bsd-license.php\r |
9 | \r | |
20333c6d | 10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
beda2356 | 11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef __SECUREBOOT_CONFIG_NV_DATA_H__\r | |
16 | #define __SECUREBOOT_CONFIG_NV_DATA_H__\r | |
17 | \r | |
18 | #include <Guid/HiiPlatformSetupFormset.h>\r | |
19 | #include <Guid/SecureBootConfigHii.h>\r | |
20 | \r | |
ecc722ad | 21 | //\r |
22 | // Used by VFR for form or button identification\r | |
23 | //\r | |
beda2356 | 24 | #define SECUREBOOT_CONFIGURATION_VARSTORE_ID 0x0001\r |
ecc722ad | 25 | #define SECUREBOOT_CONFIGURATION_FORM_ID 0x01\r |
26 | #define FORMID_SECURE_BOOT_OPTION_FORM 0x02\r | |
27 | #define FORMID_SECURE_BOOT_PK_OPTION_FORM 0x03\r | |
28 | #define FORMID_SECURE_BOOT_KEK_OPTION_FORM 0x04\r | |
29 | #define FORMID_SECURE_BOOT_DB_OPTION_FORM 0x05\r | |
30 | #define FORMID_SECURE_BOOT_DBX_OPTION_FORM 0x06\r | |
31 | #define FORMID_ENROLL_PK_FORM 0x07\r | |
32 | #define SECUREBOOT_ADD_PK_FILE_FORM_ID 0x08\r | |
33 | #define FORMID_ENROLL_KEK_FORM 0x09\r | |
34 | #define FORMID_DELETE_KEK_FORM 0x0a\r | |
35 | #define SECUREBOOT_ENROLL_SIGNATURE_TO_DB 0x0b\r | |
36 | #define SECUREBOOT_DELETE_SIGNATURE_FROM_DB 0x0c\r | |
37 | #define SECUREBOOT_ENROLL_SIGNATURE_TO_DBX 0x0d\r | |
38 | #define SECUREBOOT_DELETE_SIGNATURE_FROM_DBX 0x0e\r | |
39 | #define FORM_FILE_EXPLORER_ID 0x0f\r | |
40 | #define FORM_FILE_EXPLORER_ID_PK 0x10\r | |
41 | #define FORM_FILE_EXPLORER_ID_KEK 0x11\r | |
42 | #define FORM_FILE_EXPLORER_ID_DB 0x12\r | |
43 | #define FORM_FILE_EXPLORER_ID_DBX 0x13\r | |
20333c6d QL |
44 | #define FORMID_SECURE_BOOT_DBT_OPTION_FORM 0x14\r |
45 | #define SECUREBOOT_ENROLL_SIGNATURE_TO_DBT 0x15\r | |
46 | #define SECUREBOOT_DELETE_SIGNATURE_FROM_DBT 0x16\r | |
47 | #define FORM_FILE_EXPLORER_ID_DBT 0x17\r | |
ecc722ad | 48 | \r |
49 | #define SECURE_BOOT_MODE_CUSTOM 0x01\r | |
50 | #define SECURE_BOOT_MODE_STANDARD 0x00\r | |
51 | \r | |
52 | #define KEY_SECURE_BOOT_ENABLE 0x1000\r | |
53 | #define KEY_SECURE_BOOT_MODE 0x1001\r | |
54 | #define KEY_VALUE_SAVE_AND_EXIT_DB 0x1002\r | |
55 | #define KEY_VALUE_NO_SAVE_AND_EXIT_DB 0x1003\r | |
56 | #define KEY_VALUE_SAVE_AND_EXIT_PK 0x1004\r | |
57 | #define KEY_VALUE_NO_SAVE_AND_EXIT_PK 0x1005\r | |
58 | #define KEY_VALUE_SAVE_AND_EXIT_KEK 0x1008\r | |
59 | #define KEY_VALUE_NO_SAVE_AND_EXIT_KEK 0x1009\r | |
60 | #define KEY_VALUE_SAVE_AND_EXIT_DBX 0x100a\r | |
61 | #define KEY_VALUE_NO_SAVE_AND_EXIT_DBX 0x100b\r | |
a2f2c258 | 62 | #define KEY_HIDE_SECURE_BOOT 0x100c\r |
20333c6d QL |
63 | #define KEY_VALUE_SAVE_AND_EXIT_DBT 0x100d\r |
64 | #define KEY_VALUE_NO_SAVE_AND_EXIT_DBT 0x100e\r | |
668ceb0e | 65 | #define KEY_TRANS_SECURE_BOOT_MODE 0x100f\r |
ecc722ad | 66 | \r |
67 | #define KEY_SECURE_BOOT_OPTION 0x1100\r | |
68 | #define KEY_SECURE_BOOT_PK_OPTION 0x1101\r | |
69 | #define KEY_SECURE_BOOT_KEK_OPTION 0x1102\r | |
70 | #define KEY_SECURE_BOOT_DB_OPTION 0x1103\r | |
71 | #define KEY_SECURE_BOOT_DBX_OPTION 0x1104\r | |
72 | #define KEY_SECURE_BOOT_DELETE_PK 0x1105\r | |
73 | #define KEY_ENROLL_PK 0x1106\r | |
74 | #define KEY_ENROLL_KEK 0x1107\r | |
75 | #define KEY_DELETE_KEK 0x1108\r | |
76 | #define KEY_SECURE_BOOT_KEK_GUID 0x110a\r | |
77 | #define KEY_SECURE_BOOT_SIGNATURE_GUID_DB 0x110b\r | |
78 | #define KEY_SECURE_BOOT_SIGNATURE_GUID_DBX 0x110c\r | |
20333c6d QL |
79 | #define KEY_SECURE_BOOT_DBT_OPTION 0x110d\r |
80 | #define KEY_SECURE_BOOT_SIGNATURE_GUID_DBT 0x110e\r | |
ecc722ad | 81 | \r |
82 | #define LABEL_KEK_DELETE 0x1200\r | |
83 | #define LABEL_DB_DELETE 0x1201\r | |
84 | #define LABEL_DBX_DELETE 0x1202\r | |
20333c6d | 85 | #define LABEL_DBT_DELETE 0x1203\r |
ecc722ad | 86 | #define LABEL_END 0xffff\r |
87 | \r | |
96832eef | 88 | \r |
ecc722ad | 89 | #define SECURE_BOOT_MAX_ATTEMPTS_NUM 255\r |
90 | \r | |
91 | #define CONFIG_OPTION_OFFSET 0x2000\r | |
92 | \r | |
93 | #define OPTION_CONFIG_QUESTION_ID 0x2000\r | |
94 | #define OPTION_CONFIG_RANGE 0x1000\r | |
95 | \r | |
96 | //\r | |
97 | // Question ID 0x2000 ~ 0x2FFF is for KEK\r | |
98 | //\r | |
99 | #define OPTION_DEL_KEK_QUESTION_ID 0x2000\r | |
100 | //\r | |
101 | // Question ID 0x3000 ~ 0x3FFF is for DB\r | |
102 | //\r | |
103 | #define OPTION_DEL_DB_QUESTION_ID 0x3000\r | |
104 | //\r | |
105 | // Question ID 0x4000 ~ 0x4FFF is for DBX\r | |
106 | //\r | |
20333c6d QL |
107 | #define OPTION_DEL_DBX_QUESTION_ID 0x4000\r |
108 | \r | |
109 | //\r | |
110 | // Question ID 0x5000 ~ 0x5FFF is for DBT\r | |
111 | //\r | |
112 | #define OPTION_DEL_DBT_QUESTION_ID 0x5000\r | |
ecc722ad | 113 | \r |
c93bcb7e | 114 | #define FILE_OPTION_GOTO_OFFSET 0xC000\r |
ecc722ad | 115 | #define FILE_OPTION_OFFSET 0x8000\r |
c93bcb7e | 116 | #define FILE_OPTION_MASK 0x3FFF\r |
ecc722ad | 117 | \r |
118 | #define SECURE_BOOT_GUID_SIZE 36\r | |
119 | #define SECURE_BOOT_GUID_STORAGE_SIZE 37\r | |
120 | \r | |
96832eef CZ |
121 | #define SECURE_BOOT_MODE_USER_MODE 0\r |
122 | #define SECURE_BOOT_MODE_SETUP_MODE 1\r | |
123 | #define SECURE_BOOT_MODE_AUDIT_MODE 2\r | |
124 | #define SECURE_BOOT_MODE_DEPLOYED_MODE 3\r | |
125 | \r | |
beda2356 | 126 | //\r |
127 | // Nv Data structure referenced by IFR\r | |
128 | //\r | |
129 | typedef struct {\r | |
20333c6d QL |
130 | BOOLEAN AttemptSecureBoot; // Attempt to enable/disable Secure Boot\r |
131 | BOOLEAN HideSecureBoot; // Hiden Attempt Secure Boot\r | |
ecc722ad | 132 | CHAR16 SignatureGuid[SECURE_BOOT_GUID_STORAGE_SIZE];\r |
20333c6d QL |
133 | BOOLEAN PhysicalPresent; // If a Physical Present User\r |
134 | UINT8 SecureBootMode; // Secure Boot Mode: Standard Or Custom\r | |
96832eef CZ |
135 | UINT8 CurSecureBootMode; // Current SecureBoot Mode SetupMode/UserMode/AuditMode/DeployedMode\r |
136 | UINT8 TransSecureBootMode; // Trans Next SecureBoot Mode\r | |
20333c6d QL |
137 | BOOLEAN DeletePk;\r |
138 | BOOLEAN HasPk; // If Pk is existed it is true\r | |
139 | BOOLEAN AlwaysRevocation; // If the certificate is always revoked. Revocation time is hidden\r | |
140 | UINT8 CertificateFormat; // The type of the certificate\r | |
141 | EFI_HII_DATE RevocationDate; // The revocation date of the certificate\r | |
142 | EFI_HII_TIME RevocationTime; // The revocation time of the certificate\r | |
beda2356 | 143 | } SECUREBOOT_CONFIGURATION;\r |
144 | \r | |
2e728930 | 145 | #endif\r |