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

REGISTER_COT(tbb_certs);