Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 1 | /* |
| 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 Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 31 | #include "tbbr/tbb_cert.h" |
| 32 | #include "tbbr/tbb_ext.h" |
| 33 | #include "tbbr/tbb_key.h" |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 34 | |
| 35 | /* |
| 36 | * Certificates used in the chain of trust |
| 37 | * |
| 38 | * The order of the certificates must follow the enumeration specified in |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 39 | * tbb_cert.h. All certificates are self-signed, so the issuer certificate |
| 40 | * field points to itself. |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 41 | */ |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 42 | static cert_t tbb_certs[] = { |
| 43 | [BL2_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 44 | .id = BL2_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 45 | .opt = "bl2-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 46 | .fn = NULL, |
| 47 | .cn = "BL2 Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 48 | .key = ROT_KEY, |
| 49 | .issuer = BL2_CERT, |
| 50 | .ext = { |
| 51 | BL2_HASH_EXT |
| 52 | }, |
| 53 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 54 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 55 | [TRUSTED_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 56 | .id = TRUSTED_KEY_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 57 | .opt = "trusted-key-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 58 | .fn = NULL, |
| 59 | .cn = "Trusted Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 60 | .key = ROT_KEY, |
| 61 | .issuer = TRUSTED_KEY_CERT, |
| 62 | .ext = { |
| 63 | TZ_WORLD_PK_EXT, |
| 64 | NTZ_WORLD_PK_EXT |
| 65 | }, |
| 66 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 67 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 68 | [BL30_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 69 | .id = BL30_KEY_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 70 | .opt = "bl30-key-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 71 | .fn = NULL, |
| 72 | .cn = "BL3-0 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 73 | .key = TRUSTED_WORLD_KEY, |
| 74 | .issuer = BL30_KEY_CERT, |
| 75 | .ext = { |
| 76 | BL30_CONTENT_CERT_PK_EXT |
| 77 | }, |
| 78 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 79 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 80 | [BL30_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 81 | .id = BL30_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 82 | .opt = "bl30-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 83 | .fn = NULL, |
| 84 | .cn = "BL3-0 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 85 | .key = BL30_KEY, |
| 86 | .issuer = BL30_CERT, |
| 87 | .ext = { |
| 88 | BL30_HASH_EXT |
| 89 | }, |
| 90 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 91 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 92 | [BL31_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 93 | .id = BL31_KEY_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 94 | .opt = "bl31-key-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 95 | .fn = NULL, |
| 96 | .cn = "BL3-1 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 97 | .key = TRUSTED_WORLD_KEY, |
| 98 | .issuer = BL31_KEY_CERT, |
| 99 | .ext = { |
| 100 | BL31_CONTENT_CERT_PK_EXT |
| 101 | }, |
| 102 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 103 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 104 | [BL31_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 105 | .id = BL31_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 106 | .opt = "bl31-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 107 | .fn = NULL, |
| 108 | .cn = "BL3-1 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 109 | .key = BL31_KEY, |
| 110 | .issuer = BL31_CERT, |
| 111 | .ext = { |
| 112 | BL31_HASH_EXT |
| 113 | }, |
| 114 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 115 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 116 | [BL32_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 117 | .id = BL32_KEY_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 118 | .opt = "bl32-key-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 119 | .fn = NULL, |
| 120 | .cn = "BL3-2 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 121 | .key = TRUSTED_WORLD_KEY, |
| 122 | .issuer = BL32_KEY_CERT, |
| 123 | .ext = { |
| 124 | BL32_CONTENT_CERT_PK_EXT |
| 125 | }, |
| 126 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 127 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 128 | [BL32_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 129 | .id = BL32_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 130 | .opt = "bl32-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 131 | .fn = NULL, |
| 132 | .cn = "BL3-2 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 133 | .key = BL32_KEY, |
| 134 | .issuer = BL32_CERT, |
| 135 | .ext = { |
| 136 | BL32_HASH_EXT |
| 137 | }, |
| 138 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 139 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 140 | [BL33_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 141 | .id = BL33_KEY_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 142 | .opt = "bl33-key-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 143 | .fn = NULL, |
| 144 | .cn = "BL3-3 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 145 | .key = NON_TRUSTED_WORLD_KEY, |
| 146 | .issuer = BL33_KEY_CERT, |
| 147 | .ext = { |
| 148 | BL33_CONTENT_CERT_PK_EXT |
| 149 | }, |
| 150 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 151 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 152 | [BL33_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 153 | .id = BL33_CERT, |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 154 | .opt = "bl33-cert", |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 155 | .fn = NULL, |
| 156 | .cn = "BL3-3 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 157 | .key = BL33_KEY, |
| 158 | .issuer = BL33_CERT, |
| 159 | .ext = { |
| 160 | BL33_HASH_EXT |
| 161 | }, |
| 162 | .num_ext = 1 |
Yatharth Kochar | 5752b59 | 2015-08-21 15:30:55 +0100 | [diff] [blame] | 163 | }, |
| 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 = { |
| 172 | SCP_BL2U_HASH_EXT, |
| 173 | BL2U_HASH_EXT, |
| 174 | NS_BL2U_HASH_EXT |
| 175 | }, |
| 176 | .num_ext = 3 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 177 | } |
| 178 | }; |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 179 | |
| 180 | REGISTER_COT(tbb_certs); |