blob: 7fb32d82c869612c56c63a77418a95076397070d [file] [log] [blame]
Juan Castillo11abdcd2014-10-21 11:30:42 +01001/*
Soby Mathew2ffb4732017-11-07 16:50:31 +00002 * Copyright (c) 2015-2018, 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,
31 HW_CONFIG_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010032 },
Soby Mathew2ffb4732017-11-07 16:50:31 +000033 .num_ext = 4
Juan Castillo11abdcd2014-10-21 11:30:42 +010034 },
Juan Castilloe6d30e92015-06-12 11:27:59 +010035 [TRUSTED_KEY_CERT] = {
Juan Castillo11abdcd2014-10-21 11:30:42 +010036 .id = TRUSTED_KEY_CERT,
Juan Castillo1218dd52015-07-03 16:23:16 +010037 .opt = "trusted-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000038 .help_msg = "Trusted Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010039 .fn = NULL,
40 .cn = "Trusted Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010041 .key = ROT_KEY,
42 .issuer = TRUSTED_KEY_CERT,
43 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000044 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000045 TRUSTED_WORLD_PK_EXT,
46 NON_TRUSTED_WORLD_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010047 },
Juan Castillo43529982016-01-22 11:05:24 +000048 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +010049 },
Juan Castillobe801202015-12-03 10:19:21 +000050 [SCP_FW_KEY_CERT] = {
51 .id = SCP_FW_KEY_CERT,
52 .opt = "scp-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000053 .help_msg = "SCP Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010054 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000055 .cn = "SCP Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010056 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000057 .issuer = SCP_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010058 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000059 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000060 SCP_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010061 },
Juan Castillo43529982016-01-22 11:05:24 +000062 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010063 },
Juan Castillobe801202015-12-03 10:19:21 +000064 [SCP_FW_CONTENT_CERT] = {
65 .id = SCP_FW_CONTENT_CERT,
66 .opt = "scp-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000067 .help_msg = "SCP Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010068 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000069 .cn = "SCP Firmware Content Certificate",
70 .key = SCP_FW_CONTENT_CERT_KEY,
71 .issuer = SCP_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010072 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000073 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000074 SCP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010075 },
Juan Castillo43529982016-01-22 11:05:24 +000076 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010077 },
Juan Castillobe801202015-12-03 10:19:21 +000078 [SOC_FW_KEY_CERT] = {
79 .id = SOC_FW_KEY_CERT,
80 .opt = "soc-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000081 .help_msg = "SoC Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010082 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000083 .cn = "SoC Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010084 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000085 .issuer = SOC_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010086 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +000087 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +000088 SOC_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010089 },
Juan Castillo43529982016-01-22 11:05:24 +000090 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010091 },
Juan Castillobe801202015-12-03 10:19:21 +000092 [SOC_FW_CONTENT_CERT] = {
93 .id = SOC_FW_CONTENT_CERT,
94 .opt = "soc-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +000095 .help_msg = "SoC Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +010096 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000097 .cn = "SoC Firmware Content Certificate",
98 .key = SOC_FW_CONTENT_CERT_KEY,
99 .issuer = SOC_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100100 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000101 TRUSTED_FW_NVCOUNTER_EXT,
Soby Mathew2bb78d32018-03-29 14:29:55 +0100102 SOC_AP_FW_HASH_EXT,
103 SOC_FW_CONFIG_HASH_EXT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100104 },
Soby Mathew2bb78d32018-03-29 14:29:55 +0100105 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100106 },
Juan Castillobe801202015-12-03 10:19:21 +0000107 [TRUSTED_OS_FW_KEY_CERT] = {
108 .id = TRUSTED_OS_FW_KEY_CERT,
109 .opt = "tos-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000110 .help_msg = "Trusted OS Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100111 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000112 .cn = "Trusted OS Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100113 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000114 .issuer = TRUSTED_OS_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100115 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000116 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000117 TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100118 },
Juan Castillo43529982016-01-22 11:05:24 +0000119 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100120 },
Juan Castillobe801202015-12-03 10:19:21 +0000121 [TRUSTED_OS_FW_CONTENT_CERT] = {
122 .id = TRUSTED_OS_FW_CONTENT_CERT,
123 .opt = "tos-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000124 .help_msg = "Trusted OS Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100125 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000126 .cn = "Trusted OS Firmware Content Certificate",
127 .key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
128 .issuer = TRUSTED_OS_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100129 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000130 TRUSTED_FW_NVCOUNTER_EXT,
Summer Qin80726782017-04-20 16:28:39 +0100131 TRUSTED_OS_FW_HASH_EXT,
132 TRUSTED_OS_FW_EXTRA1_HASH_EXT,
Soby Mathew2bb78d32018-03-29 14:29:55 +0100133 TRUSTED_OS_FW_EXTRA2_HASH_EXT,
134 TRUSTED_OS_FW_CONFIG_HASH_EXT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100135 },
Soby Mathew2bb78d32018-03-29 14:29:55 +0100136 .num_ext = 5
Juan Castillo11abdcd2014-10-21 11:30:42 +0100137 },
Juan Castillobe801202015-12-03 10:19:21 +0000138 [NON_TRUSTED_FW_KEY_CERT] = {
139 .id = NON_TRUSTED_FW_KEY_CERT,
140 .opt = "nt-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000141 .help_msg = "Non-Trusted Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100142 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000143 .cn = "Non-Trusted Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100144 .key = NON_TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000145 .issuer = NON_TRUSTED_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100146 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000147 NON_TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000148 NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100149 },
Juan Castillo43529982016-01-22 11:05:24 +0000150 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100151 },
Juan Castillobe801202015-12-03 10:19:21 +0000152 [NON_TRUSTED_FW_CONTENT_CERT] = {
153 .id = NON_TRUSTED_FW_CONTENT_CERT,
154 .opt = "nt-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000155 .help_msg = "Non-Trusted Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100156 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000157 .cn = "Non-Trusted Firmware Content Certificate",
158 .key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
159 .issuer = NON_TRUSTED_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100160 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000161 NON_TRUSTED_FW_NVCOUNTER_EXT,
Soby Mathew2bb78d32018-03-29 14:29:55 +0100162 NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT,
163 NON_TRUSTED_FW_CONFIG_HASH_EXT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100164 },
Soby Mathew2bb78d32018-03-29 14:29:55 +0100165 .num_ext = 3
Yatharth Kochar5752b592015-08-21 15:30:55 +0100166 },
167 [FWU_CERT] = {
168 .id = FWU_CERT,
169 .opt = "fwu-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000170 .help_msg = "Firmware Update Certificate (output file)",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100171 .fn = NULL,
Juan Castillo212f7382015-12-15 16:37:57 +0000172 .cn = "Firmware Update Certificate",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100173 .key = ROT_KEY,
174 .issuer = FWU_CERT,
175 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000176 SCP_FWU_CFG_HASH_EXT,
177 AP_FWU_CFG_HASH_EXT,
178 FWU_HASH_EXT
Yatharth Kochar5752b592015-08-21 15:30:55 +0100179 },
180 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100181 }
182};
Juan Castilloe6d30e92015-06-12 11:27:59 +0100183
184REGISTER_COT(tbb_certs);