tbb_cert.c 4.6 KB
Newer Older
1
/*
Soby Mathew's avatar
Soby Mathew committed
2
 * Copyright (c) 2015-2018, 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
31
			TRUSTED_BOOT_FW_HASH_EXT,
			TRUSTED_BOOT_FW_CONFIG_HASH_EXT,
			HW_CONFIG_HASH_EXT
32
		},
Soby Mathew's avatar
Soby Mathew committed
33
		.num_ext = 4
34
	},
35
	[TRUSTED_KEY_CERT] = {
36
		.id = TRUSTED_KEY_CERT,
37
		.opt = "trusted-key-cert",
38
		.help_msg = "Trusted Key Certificate (output file)",
39
40
		.fn = NULL,
		.cn = "Trusted Key Certificate",
41
42
43
		.key = ROT_KEY,
		.issuer = TRUSTED_KEY_CERT,
		.ext = {
44
			TRUSTED_FW_NVCOUNTER_EXT,
45
46
			TRUSTED_WORLD_PK_EXT,
			NON_TRUSTED_WORLD_PK_EXT
47
		},
48
		.num_ext = 3
49
	},
50
51
52
	[SCP_FW_KEY_CERT] = {
		.id = SCP_FW_KEY_CERT,
		.opt = "scp-fw-key-cert",
53
		.help_msg = "SCP Firmware Key Certificate (output file)",
54
		.fn = NULL,
55
		.cn = "SCP Firmware Key Certificate",
56
		.key = TRUSTED_WORLD_KEY,
57
		.issuer = SCP_FW_KEY_CERT,
58
		.ext = {
59
			TRUSTED_FW_NVCOUNTER_EXT,
60
			SCP_FW_CONTENT_CERT_PK_EXT
61
		},
62
		.num_ext = 2
63
	},
64
65
66
	[SCP_FW_CONTENT_CERT] = {
		.id = SCP_FW_CONTENT_CERT,
		.opt = "scp-fw-cert",
67
		.help_msg = "SCP Firmware Content Certificate (output file)",
68
		.fn = NULL,
69
70
71
		.cn = "SCP Firmware Content Certificate",
		.key = SCP_FW_CONTENT_CERT_KEY,
		.issuer = SCP_FW_CONTENT_CERT,
72
		.ext = {
73
			TRUSTED_FW_NVCOUNTER_EXT,
74
			SCP_FW_HASH_EXT
75
		},
76
		.num_ext = 2
77
	},
78
79
80
	[SOC_FW_KEY_CERT] = {
		.id = SOC_FW_KEY_CERT,
		.opt = "soc-fw-key-cert",
81
		.help_msg = "SoC Firmware Key Certificate (output file)",
82
		.fn = NULL,
83
		.cn = "SoC Firmware Key Certificate",
84
		.key = TRUSTED_WORLD_KEY,
85
		.issuer = SOC_FW_KEY_CERT,
86
		.ext = {
87
			TRUSTED_FW_NVCOUNTER_EXT,
88
			SOC_FW_CONTENT_CERT_PK_EXT
89
		},
90
		.num_ext = 2
91
	},
92
93
94
	[SOC_FW_CONTENT_CERT] = {
		.id = SOC_FW_CONTENT_CERT,
		.opt = "soc-fw-cert",
95
		.help_msg = "SoC Firmware Content Certificate (output file)",
96
		.fn = NULL,
97
98
99
		.cn = "SoC Firmware Content Certificate",
		.key = SOC_FW_CONTENT_CERT_KEY,
		.issuer = SOC_FW_CONTENT_CERT,
100
		.ext = {
101
			TRUSTED_FW_NVCOUNTER_EXT,
102
103
			SOC_AP_FW_HASH_EXT,
			SOC_FW_CONFIG_HASH_EXT,
104
		},
105
		.num_ext = 3
106
	},
107
108
109
	[TRUSTED_OS_FW_KEY_CERT] = {
		.id = TRUSTED_OS_FW_KEY_CERT,
		.opt = "tos-fw-key-cert",
110
		.help_msg = "Trusted OS Firmware Key Certificate (output file)",
111
		.fn = NULL,
112
		.cn = "Trusted OS Firmware Key Certificate",
113
		.key = TRUSTED_WORLD_KEY,
114
		.issuer = TRUSTED_OS_FW_KEY_CERT,
115
		.ext = {
116
			TRUSTED_FW_NVCOUNTER_EXT,
117
			TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
118
		},
119
		.num_ext = 2
120
	},
121
122
123
	[TRUSTED_OS_FW_CONTENT_CERT] = {
		.id = TRUSTED_OS_FW_CONTENT_CERT,
		.opt = "tos-fw-cert",
124
		.help_msg = "Trusted OS Firmware Content Certificate (output file)",
125
		.fn = NULL,
126
127
128
		.cn = "Trusted OS Firmware Content Certificate",
		.key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
		.issuer = TRUSTED_OS_FW_CONTENT_CERT,
129
		.ext = {
130
			TRUSTED_FW_NVCOUNTER_EXT,
131
132
			TRUSTED_OS_FW_HASH_EXT,
			TRUSTED_OS_FW_EXTRA1_HASH_EXT,
133
134
			TRUSTED_OS_FW_EXTRA2_HASH_EXT,
			TRUSTED_OS_FW_CONFIG_HASH_EXT,
135
		},
136
		.num_ext = 5
137
	},
138
139
140
	[NON_TRUSTED_FW_KEY_CERT] = {
		.id = NON_TRUSTED_FW_KEY_CERT,
		.opt = "nt-fw-key-cert",
141
		.help_msg = "Non-Trusted Firmware Key Certificate (output file)",
142
		.fn = NULL,
143
		.cn = "Non-Trusted Firmware Key Certificate",
144
		.key = NON_TRUSTED_WORLD_KEY,
145
		.issuer = NON_TRUSTED_FW_KEY_CERT,
146
		.ext = {
147
			NON_TRUSTED_FW_NVCOUNTER_EXT,
148
			NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
149
		},
150
		.num_ext = 2
151
	},
152
153
154
	[NON_TRUSTED_FW_CONTENT_CERT] = {
		.id = NON_TRUSTED_FW_CONTENT_CERT,
		.opt = "nt-fw-cert",
155
		.help_msg = "Non-Trusted Firmware Content Certificate (output file)",
156
		.fn = NULL,
157
158
159
		.cn = "Non-Trusted Firmware Content Certificate",
		.key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
		.issuer = NON_TRUSTED_FW_CONTENT_CERT,
160
		.ext = {
161
			NON_TRUSTED_FW_NVCOUNTER_EXT,
162
163
			NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT,
			NON_TRUSTED_FW_CONFIG_HASH_EXT,
164
		},
165
		.num_ext = 3
166
167
168
169
	},
	[FWU_CERT] = {
		.id = FWU_CERT,
		.opt = "fwu-cert",
170
		.help_msg = "Firmware Update Certificate (output file)",
171
		.fn = NULL,
172
		.cn = "Firmware Update Certificate",
173
174
175
		.key = ROT_KEY,
		.issuer = FWU_CERT,
		.ext = {
176
177
178
			SCP_FWU_CFG_HASH_EXT,
			AP_FWU_CFG_HASH_EXT,
			FWU_HASH_EXT
179
180
		},
		.num_ext = 3
181
182
	}
};
183
184

REGISTER_COT(tbb_certs);