blob: f4fe63dc35cf45ad045eea5795a108efadb4f96a [file] [log] [blame]
Juan Castillo11abdcd2014-10-21 11:30:42 +01001/*
Manish V Badarkhea1ffcf72020-06-11 21:08:45 +01002 * Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
Juan Castillo11abdcd2014-10-21 11:30:42 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Juan Castillo11abdcd2014-10-21 11:30:42 +01005 */
6
Juan Castilloe6d30e92015-06-12 11:27:59 +01007#include "tbbr/tbb_cert.h"
8#include "tbbr/tbb_ext.h"
9#include "tbbr/tbb_key.h"
Juan Castillo11abdcd2014-10-21 11:30:42 +010010
11/*
12 * Certificates used in the chain of trust
13 *
14 * The order of the certificates must follow the enumeration specified in
Juan Castilloe6d30e92015-06-12 11:27:59 +010015 * tbb_cert.h. All certificates are self-signed, so the issuer certificate
16 * field points to itself.
Juan Castillo11abdcd2014-10-21 11:30:42 +010017 */
Juan Castilloe6d30e92015-06-12 11:27:59 +010018static cert_t tbb_certs[] = {
Juan Castillobe801202015-12-03 10:19:21 +000019 [TRUSTED_BOOT_FW_CERT] = {
20 .id = TRUSTED_BOOT_FW_CERT,
21 .opt = "tb-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000022 .help_msg = "Trusted Boot FW Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010023 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000024 .cn = "Trusted Boot FW Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010025 .key = ROT_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000026 .issuer = TRUSTED_BOOT_FW_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010027 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000028 TRUSTED_FW_NVCOUNTER_EXT,
Soby Mathew2ffb4732017-11-07 16:50:31 +000029 TRUSTED_BOOT_FW_HASH_EXT,
30 TRUSTED_BOOT_FW_CONFIG_HASH_EXT,
Manish V Badarkhea1ffcf72020-06-11 21:08:45 +010031 HW_CONFIG_HASH_EXT,
32 FW_CONFIG_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010033 },
Manish V Badarkhea1ffcf72020-06-11 21:08:45 +010034 .num_ext = 5
Juan Castillo11abdcd2014-10-21 11:30:42 +010035 },
Juan Castilloe6d30e92015-06-12 11:27:59 +010036 [TRUSTED_KEY_CERT] = {
Juan Castillo11abdcd2014-10-21 11:30:42 +010037 .id = TRUSTED_KEY_CERT,
Juan Castillo1218dd52015-07-03 16:23:16 +010038 .opt = "trusted-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000039 .help_msg = "Trusted Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010040 .fn = NULL,
41 .cn = "Trusted Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010042 .key = ROT_KEY,
43 .issuer = TRUSTED_KEY_CERT,
44 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000045 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000046 TRUSTED_WORLD_PK_EXT,
47 NON_TRUSTED_WORLD_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010048 },
Juan Castillo43529982016-01-22 11:05:24 +000049 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +010050 },
Juan Castillobe801202015-12-03 10:19:21 +000051 [SCP_FW_KEY_CERT] = {
52 .id = SCP_FW_KEY_CERT,
53 .opt = "scp-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000054 .help_msg = "SCP Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010055 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000056 .cn = "SCP Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010057 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000058 .issuer = SCP_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010059 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000060 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000061 SCP_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010062 },
Juan Castillo43529982016-01-22 11:05:24 +000063 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010064 },
Juan Castillobe801202015-12-03 10:19:21 +000065 [SCP_FW_CONTENT_CERT] = {
66 .id = SCP_FW_CONTENT_CERT,
67 .opt = "scp-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000068 .help_msg = "SCP Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010069 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000070 .cn = "SCP Firmware Content Certificate",
71 .key = SCP_FW_CONTENT_CERT_KEY,
72 .issuer = SCP_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010073 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000074 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000075 SCP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010076 },
Juan Castillo43529982016-01-22 11:05:24 +000077 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010078 },
Juan Castillobe801202015-12-03 10:19:21 +000079 [SOC_FW_KEY_CERT] = {
80 .id = SOC_FW_KEY_CERT,
81 .opt = "soc-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000082 .help_msg = "SoC Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010083 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000084 .cn = "SoC Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010085 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000086 .issuer = SOC_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010087 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000088 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000089 SOC_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010090 },
Juan Castillo43529982016-01-22 11:05:24 +000091 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010092 },
Juan Castillobe801202015-12-03 10:19:21 +000093 [SOC_FW_CONTENT_CERT] = {
94 .id = SOC_FW_CONTENT_CERT,
95 .opt = "soc-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000096 .help_msg = "SoC Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010097 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000098 .cn = "SoC Firmware Content Certificate",
99 .key = SOC_FW_CONTENT_CERT_KEY,
100 .issuer = SOC_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100101 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000102 TRUSTED_FW_NVCOUNTER_EXT,
Soby Mathew2bb78d32018-03-29 14:29:55 +0100103 SOC_AP_FW_HASH_EXT,
104 SOC_FW_CONFIG_HASH_EXT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100105 },
Soby Mathew2bb78d32018-03-29 14:29:55 +0100106 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100107 },
Juan Castillobe801202015-12-03 10:19:21 +0000108 [TRUSTED_OS_FW_KEY_CERT] = {
109 .id = TRUSTED_OS_FW_KEY_CERT,
110 .opt = "tos-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000111 .help_msg = "Trusted OS Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100112 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000113 .cn = "Trusted OS Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100114 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000115 .issuer = TRUSTED_OS_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100116 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000117 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000118 TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100119 },
Juan Castillo43529982016-01-22 11:05:24 +0000120 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100121 },
Juan Castillobe801202015-12-03 10:19:21 +0000122 [TRUSTED_OS_FW_CONTENT_CERT] = {
123 .id = TRUSTED_OS_FW_CONTENT_CERT,
124 .opt = "tos-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000125 .help_msg = "Trusted OS Firmware Content 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 Content Certificate",
128 .key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
129 .issuer = TRUSTED_OS_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100130 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000131 TRUSTED_FW_NVCOUNTER_EXT,
Summer Qin80726782017-04-20 16:28:39 +0100132 TRUSTED_OS_FW_HASH_EXT,
133 TRUSTED_OS_FW_EXTRA1_HASH_EXT,
Soby Mathew2bb78d32018-03-29 14:29:55 +0100134 TRUSTED_OS_FW_EXTRA2_HASH_EXT,
135 TRUSTED_OS_FW_CONFIG_HASH_EXT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100136 },
Soby Mathew2bb78d32018-03-29 14:29:55 +0100137 .num_ext = 5
Juan Castillo11abdcd2014-10-21 11:30:42 +0100138 },
Juan Castillobe801202015-12-03 10:19:21 +0000139 [NON_TRUSTED_FW_KEY_CERT] = {
140 .id = NON_TRUSTED_FW_KEY_CERT,
141 .opt = "nt-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000142 .help_msg = "Non-Trusted Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100143 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000144 .cn = "Non-Trusted Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100145 .key = NON_TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000146 .issuer = NON_TRUSTED_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100147 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000148 NON_TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000149 NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100150 },
Juan Castillo43529982016-01-22 11:05:24 +0000151 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100152 },
Juan Castillobe801202015-12-03 10:19:21 +0000153 [NON_TRUSTED_FW_CONTENT_CERT] = {
154 .id = NON_TRUSTED_FW_CONTENT_CERT,
155 .opt = "nt-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000156 .help_msg = "Non-Trusted Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100157 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000158 .cn = "Non-Trusted Firmware Content Certificate",
159 .key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
160 .issuer = NON_TRUSTED_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100161 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000162 NON_TRUSTED_FW_NVCOUNTER_EXT,
Soby Mathew2bb78d32018-03-29 14:29:55 +0100163 NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT,
164 NON_TRUSTED_FW_CONFIG_HASH_EXT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100165 },
Soby Mathew2bb78d32018-03-29 14:29:55 +0100166 .num_ext = 3
Yatharth Kochar5752b592015-08-21 15:30:55 +0100167 },
Manish Pandeyc70b4b42020-06-10 15:50:36 +0100168 [SIP_SECURE_PARTITION_CONTENT_CERT] = {
169 .id = SIP_SECURE_PARTITION_CONTENT_CERT,
170 .opt = "sip-sp-cert",
171 .help_msg = "SiP owned Secure Partition Content Certificate (output file)",
172 .fn = NULL,
173 .cn = "SiP owned Secure Partition Content Certificate",
174 .key = TRUSTED_WORLD_KEY,
175 .issuer = SIP_SECURE_PARTITION_CONTENT_CERT,
176 .ext = {
177 TRUSTED_FW_NVCOUNTER_EXT,
178 SP_PKG1_HASH_EXT,
179 SP_PKG2_HASH_EXT,
180 SP_PKG3_HASH_EXT,
181 SP_PKG4_HASH_EXT,
182 SP_PKG5_HASH_EXT,
183 SP_PKG6_HASH_EXT,
184 SP_PKG7_HASH_EXT,
185 SP_PKG8_HASH_EXT,
186 },
187 .num_ext = 9
188 },
Yatharth Kochar5752b592015-08-21 15:30:55 +0100189 [FWU_CERT] = {
190 .id = FWU_CERT,
191 .opt = "fwu-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000192 .help_msg = "Firmware Update Certificate (output file)",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100193 .fn = NULL,
Juan Castillo212f7382015-12-15 16:37:57 +0000194 .cn = "Firmware Update Certificate",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100195 .key = ROT_KEY,
196 .issuer = FWU_CERT,
197 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000198 SCP_FWU_CFG_HASH_EXT,
199 AP_FWU_CFG_HASH_EXT,
200 FWU_HASH_EXT
Yatharth Kochar5752b592015-08-21 15:30:55 +0100201 },
202 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100203 }
204};
Juan Castilloe6d30e92015-06-12 11:27:59 +0100205
206REGISTER_COT(tbb_certs);