blob: 20be59f77a0561d6ad84e1001eed65d1e0fa01a5 [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 Castillo11abdcd2014-10-21 11:30:42 +010046 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000047 .cn = "Trusted Boot FW Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010048 .key = ROT_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000049 .issuer = TRUSTED_BOOT_FW_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010050 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000051 TRUSTED_BOOT_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010052 },
53 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +010054 },
Juan Castilloe6d30e92015-06-12 11:27:59 +010055 [TRUSTED_KEY_CERT] = {
Juan Castillo11abdcd2014-10-21 11:30:42 +010056 .id = TRUSTED_KEY_CERT,
Juan Castillo1218dd52015-07-03 16:23:16 +010057 .opt = "trusted-key-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +010058 .fn = NULL,
59 .cn = "Trusted Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010060 .key = ROT_KEY,
61 .issuer = TRUSTED_KEY_CERT,
62 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000063 TRUSTED_WORLD_PK_EXT,
64 NON_TRUSTED_WORLD_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010065 },
66 .num_ext = 2
Juan Castillo11abdcd2014-10-21 11:30:42 +010067 },
Juan Castillobe801202015-12-03 10:19:21 +000068 [SCP_FW_KEY_CERT] = {
69 .id = SCP_FW_KEY_CERT,
70 .opt = "scp-fw-key-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +010071 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000072 .cn = "SCP Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010073 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000074 .issuer = SCP_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010075 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000076 SCP_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010077 },
78 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +010079 },
Juan Castillobe801202015-12-03 10:19:21 +000080 [SCP_FW_CONTENT_CERT] = {
81 .id = SCP_FW_CONTENT_CERT,
82 .opt = "scp-fw-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +010083 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000084 .cn = "SCP Firmware Content Certificate",
85 .key = SCP_FW_CONTENT_CERT_KEY,
86 .issuer = SCP_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010087 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +000088 SCP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +010089 },
90 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +010091 },
Juan Castillobe801202015-12-03 10:19:21 +000092 [SOC_FW_KEY_CERT] = {
93 .id = SOC_FW_KEY_CERT,
94 .opt = "soc-fw-key-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +010095 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +000096 .cn = "SoC Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +010097 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +000098 .issuer = SOC_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +010099 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000100 SOC_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100101 },
102 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100103 },
Juan Castillobe801202015-12-03 10:19:21 +0000104 [SOC_FW_CONTENT_CERT] = {
105 .id = SOC_FW_CONTENT_CERT,
106 .opt = "soc-fw-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100107 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000108 .cn = "SoC Firmware Content Certificate",
109 .key = SOC_FW_CONTENT_CERT_KEY,
110 .issuer = SOC_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100111 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000112 SOC_AP_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100113 },
114 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100115 },
Juan Castillobe801202015-12-03 10:19:21 +0000116 [TRUSTED_OS_FW_KEY_CERT] = {
117 .id = TRUSTED_OS_FW_KEY_CERT,
118 .opt = "tos-fw-key-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100119 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000120 .cn = "Trusted OS Firmware Key Certificate",
Juan Castilloe6d30e92015-06-12 11:27:59 +0100121 .key = TRUSTED_WORLD_KEY,
Juan Castillobe801202015-12-03 10:19:21 +0000122 .issuer = TRUSTED_OS_FW_KEY_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100123 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000124 TRUSTED_OS_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100125 },
126 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100127 },
Juan Castillobe801202015-12-03 10:19:21 +0000128 [TRUSTED_OS_FW_CONTENT_CERT] = {
129 .id = TRUSTED_OS_FW_CONTENT_CERT,
130 .opt = "tos-fw-cert",
Juan Castillo11abdcd2014-10-21 11:30:42 +0100131 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000132 .cn = "Trusted OS Firmware Content Certificate",
133 .key = TRUSTED_OS_FW_CONTENT_CERT_KEY,
134 .issuer = TRUSTED_OS_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100135 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000136 TRUSTED_OS_FW_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100137 },
138 .num_ext = 1
Juan Castillo11abdcd2014-10-21 11:30:42 +0100139 },
Juan Castillobe801202015-12-03 10:19:21 +0000140 [NON_TRUSTED_FW_KEY_CERT] = {
141 .id = NON_TRUSTED_FW_KEY_CERT,
142 .opt = "nt-fw-key-cert",
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 Castillobe801202015-12-03 10:19:21 +0000148 NON_TRUSTED_FW_CONTENT_CERT_PK_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100149 },
150 .num_ext = 1
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 Castillo11abdcd2014-10-21 11:30:42 +0100155 .fn = NULL,
Juan Castillobe801202015-12-03 10:19:21 +0000156 .cn = "Non-Trusted Firmware Content Certificate",
157 .key = NON_TRUSTED_FW_CONTENT_CERT_KEY,
158 .issuer = NON_TRUSTED_FW_CONTENT_CERT,
Juan Castilloe6d30e92015-06-12 11:27:59 +0100159 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000160 NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT
Juan Castilloe6d30e92015-06-12 11:27:59 +0100161 },
162 .num_ext = 1
Yatharth Kochar5752b592015-08-21 15:30:55 +0100163 },
164 [FWU_CERT] = {
165 .id = FWU_CERT,
166 .opt = "fwu-cert",
167 .fn = NULL,
168 .cn = "FWU Certificate",
169 .key = ROT_KEY,
170 .issuer = FWU_CERT,
171 .ext = {
Juan Castillobe801202015-12-03 10:19:21 +0000172 SCP_FWU_CFG_HASH_EXT,
173 AP_FWU_CFG_HASH_EXT,
174 FWU_HASH_EXT
Yatharth Kochar5752b592015-08-21 15:30:55 +0100175 },
176 .num_ext = 3
Juan Castillo11abdcd2014-10-21 11:30:42 +0100177 }
178};
Juan Castilloe6d30e92015-06-12 11:27:59 +0100179
180REGISTER_COT(tbb_certs);