tbb_cert.c 5.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of ARM nor the names of its contributors may be used
 * to endorse or promote products derived from this software without specific
 * prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

31
32
33
#include "tbbr/tbb_cert.h"
#include "tbbr/tbb_ext.h"
#include "tbbr/tbb_key.h"
34
35
36
37
38

/*
 * Certificates used in the chain of trust
 *
 * The order of the certificates must follow the enumeration specified in
39
40
 * tbb_cert.h. All certificates are self-signed, so the issuer certificate
 * field points to itself.
41
 */
42
static cert_t tbb_certs[] = {
43
44
45
	[TRUSTED_BOOT_FW_CERT] = {
		.id = TRUSTED_BOOT_FW_CERT,
		.opt = "tb-fw-cert",
46
		.help_msg = "Trusted Boot FW Certificate (output file)",
47
		.fn = NULL,
48
		.cn = "Trusted Boot FW Certificate",
49
		.key = ROT_KEY,
50
		.issuer = TRUSTED_BOOT_FW_CERT,
51
		.ext = {
52
			TRUSTED_BOOT_FW_HASH_EXT
53
54
		},
		.num_ext = 1
55
	},
56
	[TRUSTED_KEY_CERT] = {
57
		.id = TRUSTED_KEY_CERT,
58
		.opt = "trusted-key-cert",
59
		.help_msg = "Trusted Key Certificate (output file)",
60
61
		.fn = NULL,
		.cn = "Trusted Key Certificate",
62
63
64
		.key = ROT_KEY,
		.issuer = TRUSTED_KEY_CERT,
		.ext = {
65
66
			TRUSTED_WORLD_PK_EXT,
			NON_TRUSTED_WORLD_PK_EXT
67
68
		},
		.num_ext = 2
69
	},
70
71
72
	[SCP_FW_KEY_CERT] = {
		.id = SCP_FW_KEY_CERT,
		.opt = "scp-fw-key-cert",
73
		.help_msg = "SCP Firmware Key Certificate (output file)",
74
		.fn = NULL,
75
		.cn = "SCP Firmware Key Certificate",
76
		.key = TRUSTED_WORLD_KEY,
77
		.issuer = SCP_FW_KEY_CERT,
78
		.ext = {
79
			SCP_FW_CONTENT_CERT_PK_EXT
80
81
		},
		.num_ext = 1
82
	},
83
84
85
	[SCP_FW_CONTENT_CERT] = {
		.id = SCP_FW_CONTENT_CERT,
		.opt = "scp-fw-cert",
86
		.help_msg = "SCP Firmware Content Certificate (output file)",
87
		.fn = NULL,
88
89
90
		.cn = "SCP Firmware Content Certificate",
		.key = SCP_FW_CONTENT_CERT_KEY,
		.issuer = SCP_FW_CONTENT_CERT,
91
		.ext = {
92
			SCP_FW_HASH_EXT
93
94
		},
		.num_ext = 1
95
	},
96
97
98
	[SOC_FW_KEY_CERT] = {
		.id = SOC_FW_KEY_CERT,
		.opt = "soc-fw-key-cert",
99
		.help_msg = "SoC Firmware Key Certificate (output file)",
100
		.fn = NULL,
101
		.cn = "SoC Firmware Key Certificate",
102
		.key = TRUSTED_WORLD_KEY,
103
		.issuer = SOC_FW_KEY_CERT,
104
		.ext = {
105
			SOC_FW_CONTENT_CERT_PK_EXT
106
107
		},
		.num_ext = 1
108
	},
109
110
111
	[SOC_FW_CONTENT_CERT] = {
		.id = SOC_FW_CONTENT_CERT,
		.opt = "soc-fw-cert",
112
		.help_msg = "SoC Firmware Content Certificate (output file)",
113
		.fn = NULL,
114
115
116
		.cn = "SoC Firmware Content Certificate",
		.key = SOC_FW_CONTENT_CERT_KEY,
		.issuer = SOC_FW_CONTENT_CERT,
117
		.ext = {
118
			SOC_AP_FW_HASH_EXT
119
120
		},
		.num_ext = 1
121
	},
122
123
124
	[TRUSTED_OS_FW_KEY_CERT] = {
		.id = TRUSTED_OS_FW_KEY_CERT,
		.opt = "tos-fw-key-cert",
125
		.help_msg = "Trusted OS Firmware Key Certificate (output file)",
126
		.fn = NULL,
127
		.cn = "Trusted OS Firmware Key Certificate",
128
		.key = TRUSTED_WORLD_KEY,
129
		.issuer = TRUSTED_OS_FW_KEY_CERT,
130
		.ext = {
131
			TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
132
133
		},
		.num_ext = 1
134
	},
135
136
137
	[TRUSTED_OS_FW_CONTENT_CERT] = {
		.id = TRUSTED_OS_FW_CONTENT_CERT,
		.opt = "tos-fw-cert",
138
		.help_msg = "Trusted OS Firmware Content Certificate (output file)",
139
		.fn = NULL,
140
141
142
		.cn = "Trusted OS Firmware Content Certificate",
		.key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
		.issuer = TRUSTED_OS_FW_CONTENT_CERT,
143
		.ext = {
144
			TRUSTED_OS_FW_HASH_EXT
145
146
		},
		.num_ext = 1
147
	},
148
149
150
	[NON_TRUSTED_FW_KEY_CERT] = {
		.id = NON_TRUSTED_FW_KEY_CERT,
		.opt = "nt-fw-key-cert",
151
		.help_msg = "Non-Trusted Firmware Key Certificate (output file)",
152
		.fn = NULL,
153
		.cn = "Non-Trusted Firmware Key Certificate",
154
		.key = NON_TRUSTED_WORLD_KEY,
155
		.issuer = NON_TRUSTED_FW_KEY_CERT,
156
		.ext = {
157
			NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
158
159
		},
		.num_ext = 1
160
	},
161
162
163
	[NON_TRUSTED_FW_CONTENT_CERT] = {
		.id = NON_TRUSTED_FW_CONTENT_CERT,
		.opt = "nt-fw-cert",
164
		.help_msg = "Non-Trusted Firmware Content Certificate (output file)",
165
		.fn = NULL,
166
167
168
		.cn = "Non-Trusted Firmware Content Certificate",
		.key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
		.issuer = NON_TRUSTED_FW_CONTENT_CERT,
169
		.ext = {
170
			NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT
171
172
		},
		.num_ext = 1
173
174
175
176
	},
	[FWU_CERT] = {
		.id = FWU_CERT,
		.opt = "fwu-cert",
177
		.help_msg = "Firmware Update Certificate (output file)",
178
		.fn = NULL,
179
		.cn = "Firmware Update Certificate",
180
181
182
		.key = ROT_KEY,
		.issuer = FWU_CERT,
		.ext = {
183
184
185
			SCP_FWU_CFG_HASH_EXT,
			AP_FWU_CFG_HASH_EXT,
			FWU_HASH_EXT
186
187
		},
		.num_ext = 3
188
189
	}
};
190
191

REGISTER_COT(tbb_certs);