tbb_cert.c 4.5 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
			SOC_AP_FW_HASH_EXT
103
		},
104
		.num_ext = 2
105
	},
106
107
108
	[TRUSTED_OS_FW_KEY_CERT] = {
		.id = TRUSTED_OS_FW_KEY_CERT,
		.opt = "tos-fw-key-cert",
109
		.help_msg = "Trusted OS Firmware Key Certificate (output file)",
110
		.fn = NULL,
111
		.cn = "Trusted OS Firmware Key Certificate",
112
		.key = TRUSTED_WORLD_KEY,
113
		.issuer = TRUSTED_OS_FW_KEY_CERT,
114
		.ext = {
115
			TRUSTED_FW_NVCOUNTER_EXT,
116
			TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
117
		},
118
		.num_ext = 2
119
	},
120
121
122
	[TRUSTED_OS_FW_CONTENT_CERT] = {
		.id = TRUSTED_OS_FW_CONTENT_CERT,
		.opt = "tos-fw-cert",
123
		.help_msg = "Trusted OS Firmware Content Certificate (output file)",
124
		.fn = NULL,
125
126
127
		.cn = "Trusted OS Firmware Content Certificate",
		.key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
		.issuer = TRUSTED_OS_FW_CONTENT_CERT,
128
		.ext = {
129
			TRUSTED_FW_NVCOUNTER_EXT,
130
131
132
			TRUSTED_OS_FW_HASH_EXT,
			TRUSTED_OS_FW_EXTRA1_HASH_EXT,
			TRUSTED_OS_FW_EXTRA2_HASH_EXT
133
		},
134
		.num_ext = 4
135
	},
136
137
138
	[NON_TRUSTED_FW_KEY_CERT] = {
		.id = NON_TRUSTED_FW_KEY_CERT,
		.opt = "nt-fw-key-cert",
139
		.help_msg = "Non-Trusted Firmware Key Certificate (output file)",
140
		.fn = NULL,
141
		.cn = "Non-Trusted Firmware Key Certificate",
142
		.key = NON_TRUSTED_WORLD_KEY,
143
		.issuer = NON_TRUSTED_FW_KEY_CERT,
144
		.ext = {
145
			NON_TRUSTED_FW_NVCOUNTER_EXT,
146
			NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
147
		},
148
		.num_ext = 2
149
	},
150
151
152
	[NON_TRUSTED_FW_CONTENT_CERT] = {
		.id = NON_TRUSTED_FW_CONTENT_CERT,
		.opt = "nt-fw-cert",
153
		.help_msg = "Non-Trusted Firmware Content Certificate (output file)",
154
		.fn = NULL,
155
156
157
		.cn = "Non-Trusted Firmware Content Certificate",
		.key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
		.issuer = NON_TRUSTED_FW_CONTENT_CERT,
158
		.ext = {
159
			NON_TRUSTED_FW_NVCOUNTER_EXT,
160
			NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT
161
		},
162
		.num_ext = 2
163
164
165
166
	},
	[FWU_CERT] = {
		.id = FWU_CERT,
		.opt = "fwu-cert",
167
		.help_msg = "Firmware Update Certificate (output file)",
168
		.fn = NULL,
169
		.cn = "Firmware Update Certificate",
170
171
172
		.key = ROT_KEY,
		.issuer = FWU_CERT,
		.ext = {
173
174
175
			SCP_FWU_CFG_HASH_EXT,
			AP_FWU_CFG_HASH_EXT,
			FWU_HASH_EXT
176
177
		},
		.num_ext = 3
178
179
	}
};
180
181

REGISTER_COT(tbb_certs);