blob: 7a50ab3550952e04c30ea62b42eccc17d988e82e [file] [log] [blame]
Juan Castillo11abdcd2014-10-21 11:30:42 +01001/*
2 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
Juan Castilloe6d30e92015-06-12 11:27:59 +010031#include "tbbr/tbb_cert.h"
32#include "tbbr/tbb_ext.h"
33#include "tbbr/tbb_key.h"
Juan Castillo11abdcd2014-10-21 11:30:42 +010034
35/*
36 * Certificates used in the chain of trust
37 *
38 * The order of the certificates must follow the enumeration specified in
Juan Castilloe6d30e92015-06-12 11:27:59 +010039 * tbb_cert.h. All certificates are self-signed, so the issuer certificate
40 * field points to itself.
Juan Castillo11abdcd2014-10-21 11:30:42 +010041 */
Juan Castilloe6d30e92015-06-12 11:27:59 +010042static cert_t tbb_certs[] = {
Juan Castillobe801202015-12-03 10:19:21 +000043 [TRUSTED_BOOT_FW_CERT] = {
44 .id = TRUSTED_BOOT_FW_CERT,
45 .opt = "tb-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000046 .help_msg = "Trusted Boot FW Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010047 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000048 .cn = "Trusted Boot FW Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010049 .key = ROT_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000050 .issuer = TRUSTED_BOOT_FW_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010051 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000052 TRUSTED_BOOT_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010053 },
54 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +010055 },
Juan Castilloe6d30e92015-06-12 11:27:59 +010056 [TRUSTED_KEY_CERT] = {
Juan Castillo11abdcd2014-10-21 11:30:42 +010057 .id = TRUSTED_KEY_CERT,
Juan Castillo1218dd52015-07-03 16:23:16 +010058 .opt = "trusted-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000059 .help_msg = "Trusted Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010060 .fn = NULL,
61 .cn = "Trusted Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010062 .key = ROT_KEY,
63 .issuer = TRUSTED_KEY_CERT,
64 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000065 TRUSTED_WORLD_PK_EXT,
66 NON_TRUSTED_WORLD_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010067 },
68 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010069 },
Juan Castillobe801202015-12-03 10:19:21 +000070 [SCP_FW_KEY_CERT] = {
71 .id = SCP_FW_KEY_CERT,
72 .opt = "scp-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000073 .help_msg = "SCP Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010074 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000075 .cn = "SCP Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010076 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000077 .issuer = SCP_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010078 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000079 SCP_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010080 },
81 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +010082 },
Juan Castillobe801202015-12-03 10:19:21 +000083 [SCP_FW_CONTENT_CERT] = {
84 .id = SCP_FW_CONTENT_CERT,
85 .opt = "scp-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000086 .help_msg = "SCP Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010087 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000088 .cn = "SCP Firmware Content Certificate",
89 .key = SCP_FW_CONTENT_CERT_KEY,
90 .issuer = SCP_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010091 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000092 SCP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010093 },
94 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +010095 },
Juan Castillobe801202015-12-03 10:19:21 +000096 [SOC_FW_KEY_CERT] = {
97 .id = SOC_FW_KEY_CERT,
98 .opt = "soc-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000099 .help_msg = "SoC Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100100 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000101 .cn = "SoC Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100102 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000103 .issuer = SOC_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100104 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000105 SOC_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100106 },
107 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100108 },
Juan Castillobe801202015-12-03 10:19:21 +0000109 [SOC_FW_CONTENT_CERT] = {
110 .id = SOC_FW_CONTENT_CERT,
111 .opt = "soc-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000112 .help_msg = "SoC Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100113 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000114 .cn = "SoC Firmware Content Certificate",
115 .key = SOC_FW_CONTENT_CERT_KEY,
116 .issuer = SOC_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100117 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000118 SOC_AP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100119 },
120 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100121 },
Juan Castillobe801202015-12-03 10:19:21 +0000122 [TRUSTED_OS_FW_KEY_CERT] = {
123 .id = TRUSTED_OS_FW_KEY_CERT,
124 .opt = "tos-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000125 .help_msg = "Trusted OS Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100126 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000127 .cn = "Trusted OS Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100128 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000129 .issuer = TRUSTED_OS_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100130 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000131 TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100132 },
133 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100134 },
Juan Castillobe801202015-12-03 10:19:21 +0000135 [TRUSTED_OS_FW_CONTENT_CERT] = {
136 .id = TRUSTED_OS_FW_CONTENT_CERT,
137 .opt = "tos-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000138 .help_msg = "Trusted OS Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100139 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000140 .cn = "Trusted OS Firmware Content Certificate",
141 .key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
142 .issuer = TRUSTED_OS_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100143 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000144 TRUSTED_OS_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100145 },
146 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100147 },
Juan Castillobe801202015-12-03 10:19:21 +0000148 [NON_TRUSTED_FW_KEY_CERT] = {
149 .id = NON_TRUSTED_FW_KEY_CERT,
150 .opt = "nt-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000151 .help_msg = "Non-Trusted Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100152 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000153 .cn = "Non-Trusted Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100154 .key = NON_TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000155 .issuer = NON_TRUSTED_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100156 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000157 NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100158 },
159 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100160 },
Juan Castillobe801202015-12-03 10:19:21 +0000161 [NON_TRUSTED_FW_CONTENT_CERT] = {
162 .id = NON_TRUSTED_FW_CONTENT_CERT,
163 .opt = "nt-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000164 .help_msg = "Non-Trusted Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100165 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000166 .cn = "Non-Trusted Firmware Content Certificate",
167 .key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
168 .issuer = NON_TRUSTED_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100169 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000170 NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100171 },
172 .num_ext = 1
Yatharth Kochar5752b592015-08-21 15:30:55 +0100173 },
174 [FWU_CERT] = {
175 .id = FWU_CERT,
176 .opt = "fwu-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000177 .help_msg = "Firmware Update Certificate (output file)",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100178 .fn = NULL,
Juan Castillo212f7382015-12-15 16:37:57 +0000179 .cn = "Firmware Update Certificate",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100180 .key = ROT_KEY,
181 .issuer = FWU_CERT,
182 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000183 SCP_FWU_CFG_HASH_EXT,
184 AP_FWU_CFG_HASH_EXT,
185 FWU_HASH_EXT
Yatharth Kochar5752b592015-08-21 15:30:55 +0100186 },
187 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100188 }
189};
Juan Castilloe6d30e92015-06-12 11:27:59 +0100190
191REGISTER_COT(tbb_certs);