tbb_cert.c 5.17 KB
Newer Older
1
/*
2
 * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
3
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
 */

7
8
9
#include "tbbr/tbb_cert.h"
#include "tbbr/tbb_ext.h"
#include "tbbr/tbb_key.h"
10
11
12
13
14

/*
 * Certificates used in the chain of trust
 *
 * The order of the certificates must follow the enumeration specified in
15
16
 * tbb_cert.h. All certificates are self-signed, so the issuer certificate
 * field points to itself.
17
 */
18
static cert_t tbb_certs[] = {
19
20
21
	[TRUSTED_BOOT_FW_CERT] = {
		.id = TRUSTED_BOOT_FW_CERT,
		.opt = "tb-fw-cert",
22
		.help_msg = "Trusted Boot FW Certificate (output file)",
23
		.fn = NULL,
24
		.cn = "Trusted Boot FW Certificate",
25
		.key = ROT_KEY,
26
		.issuer = TRUSTED_BOOT_FW_CERT,
27
		.ext = {
28
			TRUSTED_FW_NVCOUNTER_EXT,
Soby Mathew's avatar
Soby Mathew committed
29
30
			TRUSTED_BOOT_FW_HASH_EXT,
			TRUSTED_BOOT_FW_CONFIG_HASH_EXT,
31
32
			HW_CONFIG_HASH_EXT,
			FW_CONFIG_HASH_EXT
33
		},
34
		.num_ext = 5
35
	},
36
	[TRUSTED_KEY_CERT] = {
37
		.id = TRUSTED_KEY_CERT,
38
		.opt = "trusted-key-cert",
39
		.help_msg = "Trusted Key Certificate (output file)",
40
41
		.fn = NULL,
		.cn = "Trusted Key Certificate",
42
43
44
		.key = ROT_KEY,
		.issuer = TRUSTED_KEY_CERT,
		.ext = {
45
			TRUSTED_FW_NVCOUNTER_EXT,
46
47
			TRUSTED_WORLD_PK_EXT,
			NON_TRUSTED_WORLD_PK_EXT
48
		},
49
		.num_ext = 3
50
	},
51
52
53
	[SCP_FW_KEY_CERT] = {
		.id = SCP_FW_KEY_CERT,
		.opt = "scp-fw-key-cert",
54
		.help_msg = "SCP Firmware Key Certificate (output file)",
55
		.fn = NULL,
56
		.cn = "SCP Firmware Key Certificate",
57
		.key = TRUSTED_WORLD_KEY,
58
		.issuer = SCP_FW_KEY_CERT,
59
		.ext = {
60
			TRUSTED_FW_NVCOUNTER_EXT,
61
			SCP_FW_CONTENT_CERT_PK_EXT
62
		},
63
		.num_ext = 2
64
	},
65
66
67
	[SCP_FW_CONTENT_CERT] = {
		.id = SCP_FW_CONTENT_CERT,
		.opt = "scp-fw-cert",
68
		.help_msg = "SCP Firmware Content Certificate (output file)",
69
		.fn = NULL,
70
71
72
		.cn = "SCP Firmware Content Certificate",
		.key = SCP_FW_CONTENT_CERT_KEY,
		.issuer = SCP_FW_CONTENT_CERT,
73
		.ext = {
74
			TRUSTED_FW_NVCOUNTER_EXT,
75
			SCP_FW_HASH_EXT
76
		},
77
		.num_ext = 2
78
	},
79
80
81
	[SOC_FW_KEY_CERT] = {
		.id = SOC_FW_KEY_CERT,
		.opt = "soc-fw-key-cert",
82
		.help_msg = "SoC Firmware Key Certificate (output file)",
83
		.fn = NULL,
84
		.cn = "SoC Firmware Key Certificate",
85
		.key = TRUSTED_WORLD_KEY,
86
		.issuer = SOC_FW_KEY_CERT,
87
		.ext = {
88
			TRUSTED_FW_NVCOUNTER_EXT,
89
			SOC_FW_CONTENT_CERT_PK_EXT
90
		},
91
		.num_ext = 2
92
	},
93
94
95
	[SOC_FW_CONTENT_CERT] = {
		.id = SOC_FW_CONTENT_CERT,
		.opt = "soc-fw-cert",
96
		.help_msg = "SoC Firmware Content Certificate (output file)",
97
		.fn = NULL,
98
99
100
		.cn = "SoC Firmware Content Certificate",
		.key = SOC_FW_CONTENT_CERT_KEY,
		.issuer = SOC_FW_CONTENT_CERT,
101
		.ext = {
102
			TRUSTED_FW_NVCOUNTER_EXT,
103
104
			SOC_AP_FW_HASH_EXT,
			SOC_FW_CONFIG_HASH_EXT,
105
		},
106
		.num_ext = 3
107
	},
108
109
110
	[TRUSTED_OS_FW_KEY_CERT] = {
		.id = TRUSTED_OS_FW_KEY_CERT,
		.opt = "tos-fw-key-cert",
111
		.help_msg = "Trusted OS Firmware Key Certificate (output file)",
112
		.fn = NULL,
113
		.cn = "Trusted OS Firmware Key Certificate",
114
		.key = TRUSTED_WORLD_KEY,
115
		.issuer = TRUSTED_OS_FW_KEY_CERT,
116
		.ext = {
117
			TRUSTED_FW_NVCOUNTER_EXT,
118
			TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
119
		},
120
		.num_ext = 2
121
	},
122
123
124
	[TRUSTED_OS_FW_CONTENT_CERT] = {
		.id = TRUSTED_OS_FW_CONTENT_CERT,
		.opt = "tos-fw-cert",
125
		.help_msg = "Trusted OS Firmware Content Certificate (output file)",
126
		.fn = NULL,
127
128
129
		.cn = "Trusted OS Firmware Content Certificate",
		.key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
		.issuer = TRUSTED_OS_FW_CONTENT_CERT,
130
		.ext = {
131
			TRUSTED_FW_NVCOUNTER_EXT,
132
133
			TRUSTED_OS_FW_HASH_EXT,
			TRUSTED_OS_FW_EXTRA1_HASH_EXT,
134
135
			TRUSTED_OS_FW_EXTRA2_HASH_EXT,
			TRUSTED_OS_FW_CONFIG_HASH_EXT,
136
		},
137
		.num_ext = 5
138
	},
139
140
141
	[NON_TRUSTED_FW_KEY_CERT] = {
		.id = NON_TRUSTED_FW_KEY_CERT,
		.opt = "nt-fw-key-cert",
142
		.help_msg = "Non-Trusted Firmware Key Certificate (output file)",
143
		.fn = NULL,
144
		.cn = "Non-Trusted Firmware Key Certificate",
145
		.key = NON_TRUSTED_WORLD_KEY,
146
		.issuer = NON_TRUSTED_FW_KEY_CERT,
147
		.ext = {
148
			NON_TRUSTED_FW_NVCOUNTER_EXT,
149
			NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
150
		},
151
		.num_ext = 2
152
	},
153
154
155
	[NON_TRUSTED_FW_CONTENT_CERT] = {
		.id = NON_TRUSTED_FW_CONTENT_CERT,
		.opt = "nt-fw-cert",
156
		.help_msg = "Non-Trusted Firmware Content Certificate (output file)",
157
		.fn = NULL,
158
159
160
		.cn = "Non-Trusted Firmware Content Certificate",
		.key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
		.issuer = NON_TRUSTED_FW_CONTENT_CERT,
161
		.ext = {
162
			NON_TRUSTED_FW_NVCOUNTER_EXT,
163
164
			NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT,
			NON_TRUSTED_FW_CONFIG_HASH_EXT,
165
		},
166
		.num_ext = 3
167
	},
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
	[SIP_SECURE_PARTITION_CONTENT_CERT] = {
		.id = SIP_SECURE_PARTITION_CONTENT_CERT,
		.opt = "sip-sp-cert",
		.help_msg = "SiP owned Secure Partition Content Certificate (output file)",
		.fn = NULL,
		.cn = "SiP owned Secure Partition Content Certificate",
		.key = TRUSTED_WORLD_KEY,
		.issuer = SIP_SECURE_PARTITION_CONTENT_CERT,
		.ext = {
			TRUSTED_FW_NVCOUNTER_EXT,
			SP_PKG1_HASH_EXT,
			SP_PKG2_HASH_EXT,
			SP_PKG3_HASH_EXT,
			SP_PKG4_HASH_EXT,
			SP_PKG5_HASH_EXT,
			SP_PKG6_HASH_EXT,
			SP_PKG7_HASH_EXT,
			SP_PKG8_HASH_EXT,
		},
		.num_ext = 9
	},
189
190
191
	[FWU_CERT] = {
		.id = FWU_CERT,
		.opt = "fwu-cert",
192
		.help_msg = "Firmware Update Certificate (output file)",
193
		.fn = NULL,
194
		.cn = "Firmware Update Certificate",
195
196
197
		.key = ROT_KEY,
		.issuer = FWU_CERT,
		.ext = {
198
199
200
			SCP_FWU_CFG_HASH_EXT,
			AP_FWU_CFG_HASH_EXT,
			FWU_HASH_EXT
201
202
		},
		.num_ext = 3
203
204
	}
};
205
206

REGISTER_COT(tbb_certs);