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, |
| 45 | .fn = NULL, |
| 46 | .cn = "BL2 Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 47 | .key = ROT_KEY, |
| 48 | .issuer = BL2_CERT, |
| 49 | .ext = { |
| 50 | BL2_HASH_EXT |
| 51 | }, |
| 52 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 53 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 54 | [TRUSTED_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 55 | .id = TRUSTED_KEY_CERT, |
| 56 | .fn = NULL, |
| 57 | .cn = "Trusted Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 58 | .key = ROT_KEY, |
| 59 | .issuer = TRUSTED_KEY_CERT, |
| 60 | .ext = { |
| 61 | TZ_WORLD_PK_EXT, |
| 62 | NTZ_WORLD_PK_EXT |
| 63 | }, |
| 64 | .num_ext = 2 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 65 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 66 | [BL30_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 67 | .id = BL30_KEY_CERT, |
| 68 | .fn = NULL, |
| 69 | .cn = "BL3-0 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 70 | .key = TRUSTED_WORLD_KEY, |
| 71 | .issuer = BL30_KEY_CERT, |
| 72 | .ext = { |
| 73 | BL30_CONTENT_CERT_PK_EXT |
| 74 | }, |
| 75 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 76 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 77 | [BL30_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 78 | .id = BL30_CERT, |
| 79 | .fn = NULL, |
| 80 | .cn = "BL3-0 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 81 | .key = BL30_KEY, |
| 82 | .issuer = BL30_CERT, |
| 83 | .ext = { |
| 84 | BL30_HASH_EXT |
| 85 | }, |
| 86 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 87 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 88 | [BL31_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 89 | .id = BL31_KEY_CERT, |
| 90 | .fn = NULL, |
| 91 | .cn = "BL3-1 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 92 | .key = TRUSTED_WORLD_KEY, |
| 93 | .issuer = BL31_KEY_CERT, |
| 94 | .ext = { |
| 95 | BL31_CONTENT_CERT_PK_EXT |
| 96 | }, |
| 97 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 98 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 99 | [BL31_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 100 | .id = BL31_CERT, |
| 101 | .fn = NULL, |
| 102 | .cn = "BL3-1 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 103 | .key = BL31_KEY, |
| 104 | .issuer = BL31_CERT, |
| 105 | .ext = { |
| 106 | BL31_HASH_EXT |
| 107 | }, |
| 108 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 109 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 110 | [BL32_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 111 | .id = BL32_KEY_CERT, |
| 112 | .fn = NULL, |
| 113 | .cn = "BL3-2 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 114 | .key = TRUSTED_WORLD_KEY, |
| 115 | .issuer = BL32_KEY_CERT, |
| 116 | .ext = { |
| 117 | BL32_CONTENT_CERT_PK_EXT |
| 118 | }, |
| 119 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 120 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 121 | [BL32_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 122 | .id = BL32_CERT, |
| 123 | .fn = NULL, |
| 124 | .cn = "BL3-2 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 125 | .key = BL32_KEY, |
| 126 | .issuer = BL32_CERT, |
| 127 | .ext = { |
| 128 | BL32_HASH_EXT |
| 129 | }, |
| 130 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 131 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 132 | [BL33_KEY_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 133 | .id = BL33_KEY_CERT, |
| 134 | .fn = NULL, |
| 135 | .cn = "BL3-3 Key Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 136 | .key = NON_TRUSTED_WORLD_KEY, |
| 137 | .issuer = BL33_KEY_CERT, |
| 138 | .ext = { |
| 139 | BL33_CONTENT_CERT_PK_EXT |
| 140 | }, |
| 141 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 142 | }, |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 143 | [BL33_CERT] = { |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 144 | .id = BL33_CERT, |
| 145 | .fn = NULL, |
| 146 | .cn = "BL3-3 Content Certificate", |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 147 | .key = BL33_KEY, |
| 148 | .issuer = BL33_CERT, |
| 149 | .ext = { |
| 150 | BL33_HASH_EXT |
| 151 | }, |
| 152 | .num_ext = 1 |
Juan Castillo | 11abdcd | 2014-10-21 11:30:42 +0100 | [diff] [blame] | 153 | } |
| 154 | }; |
Juan Castillo | e6d30e9 | 2015-06-12 11:27:59 +0100 | [diff] [blame] | 155 | |
| 156 | REGISTER_COT(tbb_certs); |