Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 1 | /* |
Summer Qin | 8072678 | 2017-04-20 16:28:39 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 7 | #include "tbbr/tbb_cert.h" |
| 8 | #include "tbbr/tbb_ext.h" |
| 9 | #include "tbbr/tbb_key.h" |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 10 | |
| 11 | /* |
| 12 | * Certificates used in the chain of trust |
| 13 | * |
| 14 | * The order of the certificates must follow the enumeration specified in |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 15 | * tbb_cert.h. All certificates are self-signed, so the issuer certificate |
| 16 | * field points to itself. |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 17 | */ |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 18 | static cert_t tbb_certs[] = { |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 19 | [TRUSTED_BOOT_FW_CERT] = { |
| 20 | .id = TRUSTED_BOOT_FW_CERT, |
| 21 | .opt = "tb-fw-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 22 | .help_msg = "Trusted Boot FW Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 23 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 24 | .cn = "Trusted Boot FW Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 25 | .key = ROT_KEY, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 26 | .issuer = TRUSTED_BOOT_FW_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 27 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 28 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 29 | TRUSTED_BOOT_FW_HASH_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 30 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 31 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 32 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 33 | [TRUSTED_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 34 | .id = TRUSTED_KEY_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 35 | .opt = "trusted-key-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 36 | .help_msg = "Trusted Key Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 37 | .fn = NULL, |
| 38 | .cn = "Trusted Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 39 | .key = ROT_KEY, |
| 40 | .issuer = TRUSTED_KEY_CERT, |
| 41 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 42 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 43 | TRUSTED_WORLD_PK_EXT, |
| 44 | NON_TRUSTED_WORLD_PK_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 45 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 46 | .num_ext = 3 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 47 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 48 | [SCP_FW_KEY_CERT] = { |
| 49 | .id = SCP_FW_KEY_CERT, |
| 50 | .opt = "scp-fw-key-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 51 | .help_msg = "SCP Firmware Key Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 52 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 53 | .cn = "SCP Firmware Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 54 | .key = TRUSTED_WORLD_KEY, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 55 | .issuer = SCP_FW_KEY_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 56 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 57 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 58 | SCP_FW_CONTENT_CERT_PK_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 59 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 60 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 61 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 62 | [SCP_FW_CONTENT_CERT] = { |
| 63 | .id = SCP_FW_CONTENT_CERT, |
| 64 | .opt = "scp-fw-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 65 | .help_msg = "SCP Firmware Content Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 66 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 67 | .cn = "SCP Firmware Content Certificate", |
| 68 | .key = SCP_FW_CONTENT_CERT_KEY, |
| 69 | .issuer = SCP_FW_CONTENT_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 70 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 71 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 72 | SCP_FW_HASH_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 73 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 74 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 75 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 76 | [SOC_FW_KEY_CERT] = { |
| 77 | .id = SOC_FW_KEY_CERT, |
| 78 | .opt = "soc-fw-key-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 79 | .help_msg = "SoC Firmware Key Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 80 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 81 | .cn = "SoC Firmware Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 82 | .key = TRUSTED_WORLD_KEY, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 83 | .issuer = SOC_FW_KEY_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 84 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 85 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 86 | SOC_FW_CONTENT_CERT_PK_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 87 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 88 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 89 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 90 | [SOC_FW_CONTENT_CERT] = { |
| 91 | .id = SOC_FW_CONTENT_CERT, |
| 92 | .opt = "soc-fw-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 93 | .help_msg = "SoC Firmware Content Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 94 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 95 | .cn = "SoC Firmware Content Certificate", |
| 96 | .key = SOC_FW_CONTENT_CERT_KEY, |
| 97 | .issuer = SOC_FW_CONTENT_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 98 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 99 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 100 | SOC_AP_FW_HASH_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 101 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 102 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 103 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 104 | [TRUSTED_OS_FW_KEY_CERT] = { |
| 105 | .id = TRUSTED_OS_FW_KEY_CERT, |
| 106 | .opt = "tos-fw-key-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 107 | .help_msg = "Trusted OS Firmware Key Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 108 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 109 | .cn = "Trusted OS Firmware Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 110 | .key = TRUSTED_WORLD_KEY, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 111 | .issuer = TRUSTED_OS_FW_KEY_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 112 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 113 | TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 114 | TRUSTED_OS_FW_CONTENT_CERT_PK_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 115 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 116 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 117 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 118 | [TRUSTED_OS_FW_CONTENT_CERT] = { |
| 119 | .id = TRUSTED_OS_FW_CONTENT_CERT, |
| 120 | .opt = "tos-fw-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 121 | .help_msg = "Trusted OS Firmware Content Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 122 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 123 | .cn = "Trusted OS Firmware Content Certificate", |
| 124 | .key = TRUSTED_OS_FW_CONTENT_CERT_KEY, |
| 125 | .issuer = TRUSTED_OS_FW_CONTENT_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 126 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 127 | TRUSTED_FW_NVCOUNTER_EXT, |
Summer Qin | 8072678 | 2017-04-20 16:28:39 +0100 | [diff] [blame^] | 128 | TRUSTED_OS_FW_HASH_EXT, |
| 129 | TRUSTED_OS_FW_EXTRA1_HASH_EXT, |
| 130 | TRUSTED_OS_FW_EXTRA2_HASH_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 131 | }, |
Summer Qin | 8072678 | 2017-04-20 16:28:39 +0100 | [diff] [blame^] | 132 | .num_ext = 4 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 133 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 134 | [NON_TRUSTED_FW_KEY_CERT] = { |
| 135 | .id = NON_TRUSTED_FW_KEY_CERT, |
| 136 | .opt = "nt-fw-key-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 137 | .help_msg = "Non-Trusted Firmware Key Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 138 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 139 | .cn = "Non-Trusted Firmware Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 140 | .key = NON_TRUSTED_WORLD_KEY, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 141 | .issuer = NON_TRUSTED_FW_KEY_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 142 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 143 | NON_TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 144 | NON_TRUSTED_FW_CONTENT_CERT_PK_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 145 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 146 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 147 | }, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 148 | [NON_TRUSTED_FW_CONTENT_CERT] = { |
| 149 | .id = NON_TRUSTED_FW_CONTENT_CERT, |
| 150 | .opt = "nt-fw-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 151 | .help_msg = "Non-Trusted Firmware Content Certificate (output file)", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 152 | .fn = NULL, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 153 | .cn = "Non-Trusted Firmware Content Certificate", |
| 154 | .key = NON_TRUSTED_FW_CONTENT_CERT_KEY, |
| 155 | .issuer = NON_TRUSTED_FW_CONTENT_CERT, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 156 | .ext = { |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 157 | NON_TRUSTED_FW_NVCOUNTER_EXT, |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 158 | NON_TRUSTED_WORLD_BOOTLOADER_HASH_EXT |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 159 | }, |
Juan Castillo | 4352998 | 2016-01-22 11:05:24 +0000 | [diff] [blame] | 160 | .num_ext = 2 |
Yatharth Kochar | 5752b59 | 2015-08-21 15:30:55 +0100 | [diff] [blame] | 161 | }, |
| 162 | [FWU_CERT] = { |
| 163 | .id = FWU_CERT, |
| 164 | .opt = "fwu-cert", |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 165 | .help_msg = "Firmware Update Certificate (output file)", |
Yatharth Kochar | 5752b59 | 2015-08-21 15:30:55 +0100 | [diff] [blame] | 166 | .fn = NULL, |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 167 | .cn = "Firmware Update Certificate", |
Yatharth Kochar | 5752b59 | 2015-08-21 15:30:55 +0100 | [diff] [blame] | 168 | .key = ROT_KEY, |
| 169 | .issuer = FWU_CERT, |
| 170 | .ext = { |
Juan Castillo | be80120 | 2015-12-03 10:19:21 +0000 | [diff] [blame] | 171 | SCP_FWU_CFG_HASH_EXT, |
| 172 | AP_FWU_CFG_HASH_EXT, |
| 173 | FWU_HASH_EXT |
Yatharth Kochar | 5752b59 | 2015-08-21 15:30:55 +0100 | [diff] [blame] | 174 | }, |
| 175 | .num_ext = 3 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 176 | } |
| 177 | }; |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 178 | |
| 179 | REGISTER_COT(tbb_certs); |