blob: 325b46223e81a0da5bca20f9f173752ad7166747 [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,
Juan Castillobe801202015-12-03 10:19:21 +0000102 SOC_AP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100103 },
Juan Castillo43529982016-01-22 11:05:24 +0000104 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100105 },
Juan Castillobe801202015-12-03 10:19:21 +0000106 [TRUSTED_OS_FW_KEY_CERT] = {
107 .id = TRUSTED_OS_FW_KEY_CERT,
108 .opt = "tos-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000109 .help_msg = "Trusted OS Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100110 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000111 .cn = "Trusted OS Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100112 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000113 .issuer = TRUSTED_OS_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100114 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000115 TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000116 TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100117 },
Juan Castillo43529982016-01-22 11:05:24 +0000118 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100119 },
Juan Castillobe801202015-12-03 10:19:21 +0000120 [TRUSTED_OS_FW_CONTENT_CERT] = {
121 .id = TRUSTED_OS_FW_CONTENT_CERT,
122 .opt = "tos-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000123 .help_msg = "Trusted OS Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100124 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000125 .cn = "Trusted OS Firmware Content Certificate",
126 .key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
127 .issuer = TRUSTED_OS_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100128 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000129 TRUSTED_FW_NVCOUNTER_EXT,
Summer Qin80726782017-04-20 16:28:39 +0100130 TRUSTED_OS_FW_HASH_EXT,
131 TRUSTED_OS_FW_EXTRA1_HASH_EXT,
132 TRUSTED_OS_FW_EXTRA2_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100133 },
Summer Qin80726782017-04-20 16:28:39 +0100134 .num_ext = 4
Juan Castillo11abdcd2014-10-21 11:30:42 +0100135 },
Juan Castillobe801202015-12-03 10:19:21 +0000136 [NON_TRUSTED_FW_KEY_CERT] = {
137 .id = NON_TRUSTED_FW_KEY_CERT,
138 .opt = "nt-fw-key-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000139 .help_msg = "Non-Trusted Firmware Key Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100140 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000141 .cn = "Non-Trusted Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100142 .key = NON_TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000143 .issuer = NON_TRUSTED_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100144 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000145 NON_TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000146 NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100147 },
Juan Castillo43529982016-01-22 11:05:24 +0000148 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +0100149 },
Juan Castillobe801202015-12-03 10:19:21 +0000150 [NON_TRUSTED_FW_CONTENT_CERT] = {
151 .id = NON_TRUSTED_FW_CONTENT_CERT,
152 .opt = "nt-fw-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000153 .help_msg = "Non-Trusted Firmware Content Certificate (output file)",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100154 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000155 .cn = "Non-Trusted Firmware Content Certificate",
156 .key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
157 .issuer = NON_TRUSTED_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100158 .ext = {
Juan Castillo43529982016-01-22 11:05:24 +0000159 NON_TRUSTED_FW_NVCOUNTER_EXT,
Juan Castillobe801202015-12-03 10:19:21 +0000160 NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100161 },
Juan Castillo43529982016-01-22 11:05:24 +0000162 .num_ext = 2
Yatharth Kochar5752b592015-08-21 15:30:55 +0100163 },
164 [FWU_CERT] = {
165 .id = FWU_CERT,
166 .opt = "fwu-cert",
Juan Castillo212f7382015-12-15 16:37:57 +0000167 .help_msg = "Firmware Update Certificate (output file)",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100168 .fn = NULL,
Juan Castillo212f7382015-12-15 16:37:57 +0000169 .cn = "Firmware Update Certificate",
Yatharth Kochar5752b592015-08-21 15:30:55 +0100170 .key = ROT_KEY,
171 .issuer = FWU_CERT,
172 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000173 SCP_FWU_CFG_HASH_EXT,
174 AP_FWU_CFG_HASH_EXT,
175 FWU_HASH_EXT
Yatharth Kochar5752b592015-08-21 15:30:55 +0100176 },
177 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100178 }
179};
Juan Castilloe6d30e92015-06-12 11:27:59 +0100180
181REGISTER_COT(tbb_certs);