TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
attest_token_test_values.h
Go to the documentation of this file.
1 /*
2  * attest_token_test_values.h
3  *
4  * Copyright (c) 2019, Laurence Lundblade.
5  * Copyright (c) 2019-2020, Arm Limited.
6  *
7  * SPDX-License-Identifier: BSD-3-Clause
8  *
9  * See BSD-3-Clause license in README.md
10  */
11 
12 #ifndef __ATTEST_TOKEN_TEST_VALUES_H__
13 #define __ATTEST_TOKEN_TEST_VALUES_H__
14 
71 /* The 64 byte special option-packed nonce where option flags
72  * are packed in at the start. Binary. */
73 #define TOKEN_TEST_NONCE_BYTES \
74  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
75  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
76  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
77  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
78  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
79  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
80  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
81  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
82 #define TOKEN_TEST_VALUE_NONCE \
83  (struct q_useful_buf_c) {\
84  (uint8_t[]){TOKEN_TEST_NONCE_BYTES},\
85  64\
86  }
87 #define TOKEN_TEST_REQUIRE_NONCE true /* Mandatory claim */
88 
89 /* A 32 byte mostly random value. Binary. Value not checked */
90 #define TOKEN_TEST_VALUE_UEID NULL_Q_USEFUL_BUF_C
91 
92 /* A 32 byte mostly random value. Binary.
93  * platform/ext/common/template/tfm_initial_attestation_key_material.c
94  */
95 /*
96 #define TOKEN_TEST_VALUE_UEID \
97  (struct q_useful_buf_c) {\
98  (uint8_t[]){ \
99  0x01, \
100  0xfa, 0x58, 0x75, 0x5f, 0x65, 0x86, 0x27, 0xce, \
101  0x54, 0x60, 0xf2, 0x9b, 0x75, 0x29, 0x67, 0x13, \
102  0x24, 0x8c, 0xae, 0x7a, 0xd9, 0xe2, 0x98, 0x4b, \
103  0x90, 0x28, 0x0e, 0xfc, 0xbc, 0xb5, 0x02, 0x48 \
104  },\
105  33\
106  }
107 */
108 #define TOKEN_TEST_REQUIRE_UEID true /* Mandatory claim */
109 
110 /* If defined, check for the constant values defined in
111  * platform/ext/common/template/attest_hal.c
112  */
113 #ifdef CLAIM_VALUE_CHECK
114 
115 /* A 32 byte mostly random value. Binary.
116  * platform/ext/common/template/attest_hal.c
117  */
118 #define TOKEN_TEST_VALUE_BOOT_SEED \
119  (struct q_useful_buf_c) {\
120  (uint8_t[]){ \
121  0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, \
122  0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, \
123  0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, \
124  0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF \
125  },\
126  32\
127  }
128 
129 /* A text string in EAN 13 format
130  * platform/ext/common/template/attest_hal.c
131  */
132 #define TOKEN_TEST_VALUE_HW_VERSION "060456527282910010" /* Hard-coded value */
133 
134 /* A 32 byte mostly random value. Binary.
135  * platform/ext/common/template/attest_hal.c
136  */
137 #define TOKEN_TEST_VALUE_IMPLEMENTATION_ID \
138  (struct q_useful_buf_c) {\
139  (uint8_t[]){ \
140  0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, \
141  0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, \
142  0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, \
143  0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD \
144  },\
145  32\
146  }
147 
148 /* Text string naming the profile definition:
149  * platform/ext/common/template/attest_hal.c
150  */
151 #define TOKEN_TEST_VALUE_PROFILE_DEFINITION "PSA_IOT_PROFILE_1"
152 
153 /* Text string with verification URL or similar
154  * platform/ext/common/template/attest_hal.c
155  */
156 #define TOKEN_TEST_VALUE_ORIGINATION "www.trustedfirmware.org"
157 
158 /* A small unsigned integer
159  * platform/ext/common/template/attest_hal.c
160  */
161 #define TOKEN_TEST_VALUE_SECURITY_LIFECYCLE 0x3000u
162 #else
163 /* Do not check for the constant values defined in
164  * platform/ext/common/template/attest_hal.c
165  */
166 
167 #define TOKEN_TEST_VALUE_BOOT_SEED NULL_Q_USEFUL_BUF_C
168 #define TOKEN_TEST_VALUE_HW_VERSION NULL
169 #define TOKEN_TEST_VALUE_IMPLEMENTATION_ID NULL_Q_USEFUL_BUF_C
170 #define TOKEN_TEST_VALUE_PROFILE_DEFINITION NULL
171 #define TOKEN_TEST_VALUE_ORIGINATION NULL
172 #define TOKEN_TEST_VALUE_SECURITY_LIFECYCLE INT32_MAX
173 
174 #endif /* CLAIM_VALUE_CHECK */
175 
176 #define TOKEN_TEST_REQUIRE_BOOT_SEED true /* Mandatory claim */
177 #define TOKEN_TEST_REQUIRE_HW_VERSION false /* Optional claim */
178 #define TOKEN_TEST_REQUIRE_IMPLEMENTATION_ID true /* Mandatory claim */
179 #define TOKEN_TEST_REQUIRE_PROFILE_DEFINITION false /* Optional field */
180 #define TOKEN_TEST_REQUIRE_ORIGINATION false /* Optional field */
181 #define TOKEN_TEST_REQUIRE_SECURITY_LIFECYCLE true /* Mandatory claim */
182 
183 /* An integer (can be positive or negative) */
184 #define TOKEN_TEST_VALUE_CLIENT_ID 0 /* Invalid value to trigger check */
185 #define TOKEN_TEST_REQUIRE_CLIENT_ID true /* Mandatory claim */
186 
209 #define TOKEN_TEST_REQUIRED_NUM_SWC 0
210 
211 /* Text string */
212 #define TOKEN_TEST_VALUE_SWC1_MEASUREMENT_TYPE NULL /* Value not checked */
213 #define TOKEN_TEST_REQUIRE_SWC1_MEASUREMENT_TYPE false /* Optional field */
214 
215 /* A 32 byte mostly random value. Binary. Value not checked */
216 #define TOKEN_TEST_VALUE_SWC1_MEASUREMENT_VAL NULL_Q_USEFUL_BUF_C
217 /*
218 #define TOKEN_TEST_VALUE_SWC1_MEASUREMENT_VAL \
219  (struct q_useful_buf_c) {\
220  (uint8_t[]){ \
221  0x51, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
222  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
223  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
224  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 \
225  },\
226  32\
227  }
228 */
229 #define TOKEN_TEST_REQUIRE_SWC1_MEASUREMENT_VAL true /* Mandatory field */
230 
231 
232 /* Text string */
233 #define TOKEN_TEST_VALUE_SWC1_VERSION NULL /* Value not checked */
234 /* This field must be mandatory to ensure PSA compliance -
235  * based on PSA Security Model document.
236  */
237 #define TOKEN_TEST_REQUIRE_SWC1_VERSION true /* Mandatory field */
238 
239 /* A 32 byte mostly random value. Binary. Value not checked */
240 #define TOKEN_TEST_VALUE_SWC1_SIGNER_ID NULL_Q_USEFUL_BUF_C
241 /*
242 #define TOKEN_TEST_VALUE_SWC1_SIGNER_ID \
243  (struct q_useful_buf_c) {\
244  (uint8_t[]){ \
245  0x61, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
246  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
247  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
248  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 \
249  },\
250  32\
251  }
252 */
253 /* This field must be mandatory to ensure PSA compliance -
254  * based on PSA Security Model document.
255  */
256 #define TOKEN_TEST_REQUIRE_SWC1_SIGNER_ID true /* Mandatory field */
257 
258 /* Text string */
259 #define TOKEN_TEST_VALUE_SWC1_MEASUREMENT_DESC "SHA256" /* Hard-coded value */
260 #define TOKEN_TEST_REQUIRE_SWC1_MEASUREMENT_DESC false /* Optional field */
261 
262 /* Text string */
263 #define TOKEN_TEST_VALUE_SWC2_MEASUREMENT_TYPE NULL /* Value not checked */
264 #define TOKEN_TEST_REQUIRE_SWC2_MEASUREMENT_TYPE false /* Optional field */
265 
266 /* A 32 byte mostly random value. Binary. Value not checked */
267 #define TOKEN_TEST_VALUE_SWC2_MEASUREMENT_VAL NULL_Q_USEFUL_BUF_C
268 /*
269 #define TOKEN_TEST_VALUE_SWC2_MEASUREMENT_VAL \
270  (struct q_useful_buf_c) {\
271  (uint8_t[]){ \
272  0x71, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
273  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
274  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
275  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 \
276  },\
277  32\
278  }
279 */
280 #define TOKEN_TEST_REQUIRE_SWC2_MEASUREMENT_VAL true /* Mandatory field */
281 
282 /* Text string */
283 #define TOKEN_TEST_VALUE_SWC2_VERSION NULL /* Value not checked */
284 /* This field must be mandatory to ensure PSA compliance -
285  * based on PSA Security Model document.
286  */
287 #define TOKEN_TEST_REQUIRE_SWC2_VERSION true /* Mandatory field */
288 
289 /* A 32 byte mostly random value. Binary. Value not checked */
290 #define TOKEN_TEST_VALUE_SWC2_SIGNER_ID NULL_Q_USEFUL_BUF_C
291 /*
292 #define TOKEN_TEST_VALUE_SWC2_SIGNER_ID \
293  (struct q_useful_buf_c) {\
294  (uint8_t[]){ \
295  0x81, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
296  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
297  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \
298  0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 \
299  },\
300  32\
301  }
302 */
303 /* This field must be mandatory to ensure PSA compliance -
304  * based on PSA Security Model document.
305  */
306 #define TOKEN_TEST_REQUIRE_SWC2_SIGNER_ID true /* Mandatory field */
307 
308 /* Text string */
309 #define TOKEN_TEST_VALUE_SWC2_MEASUREMENT_DESC "SHA256" /* Hard-coded value */
310 #define TOKEN_TEST_REQUIRE_SWC2_MEASUREMENT_DESC false /* Optional field */
311 
312 /* Attest token maximum size, there are also platform dependent values
313  * defined in region_defs.h
314  */
315 #define ATTEST_TOKEN_MAX_SIZE 0x250
316 
317 #endif /* __ATTEST_TOKEN_TEST_VALUES_H__ */