blob: 956be709b4e47563332bd4f1ae46977fc3250166 [file] [log] [blame]
Pascal Brandc639ac82015-07-02 08:53:34 +02001/*
2 * Copyright (c) 2014, STMicroelectronics International N.V.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#include <string.h>
15#include <stdio.h>
16
17#include <adbg.h>
18#include <xtest_test.h>
19#include <xtest_helpers.h>
20
21#include <tee_client_api.h>
22#include <ta_storage.h>
23#include <tee_api_defines.h>
Jerome Forissier0e99d6a2016-07-25 14:21:43 +020024#include <tee_api_defines_extensions.h>
Pascal Brandc639ac82015-07-02 08:53:34 +020025#include <tee_api_types.h>
Jerome Forissiere3688342015-09-24 10:45:17 -070026#ifdef WITH_GP_TESTS
Pascal Brand8a74e362015-09-10 12:41:52 +020027#include <TTA_DS_protocol.h>
28#endif
Jerome Forissier0e99d6a2016-07-25 14:21:43 +020029#include <util.h>
30
31static uint32_t storage_ids[] = {
32 TEE_STORAGE_PRIVATE,
33#ifdef CFG_REE_FS
34 TEE_STORAGE_PRIVATE_REE,
35#endif
36#ifdef CFG_RPMB_FS
37 TEE_STORAGE_PRIVATE_RPMB,
38#endif
39};
Pascal Brandc639ac82015-07-02 08:53:34 +020040
41static uint8_t file_00[] = {
42 0x00, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
43 0xF0, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
44 0xE9, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
45 0xF0, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x8E
46};
47
48static uint8_t file_01[] = {
49 0x01, 0x00
50};
51
52static uint8_t file_02[] = {
53 0x02, 0x11, 0x02
54};
55
56static uint8_t file_03[] = {
57 0x03, 0x13, 0x03
58};
59
Pascal Brandeb84c442016-04-19 17:49:49 +020060static uint8_t file_04[] = {
61 0x00, 0x01, 0x02
62};
63
Pascal Brandc639ac82015-07-02 08:53:34 +020064static uint8_t data_00[] = {
65 0x00, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
66 0x00, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
67 0x00, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
68 0x00, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x00
69};
70
71static uint8_t data_01[] = {
72 0x01, 0x6E, 0x04, 0x57, 0x08, 0xFB, 0x71, 0x96,
73 0x01, 0x2E, 0x55, 0x3D, 0x02, 0xC3, 0xA6, 0x92,
74 0x01, 0xC3, 0xEF, 0x8A, 0xB2, 0x34, 0x53, 0xE6,
75 0x01, 0x74, 0x9C, 0xD6, 0x36, 0xE7, 0xA8, 0x01
76};
77
78static TEEC_Result fs_open(TEEC_Session *sess, void *id, uint32_t id_size,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +020079 uint32_t flags, uint32_t *obj, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +020080{
Aijun Sun473d9072015-08-06 15:24:49 +080081 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +020082 TEEC_Result res;
83 uint32_t org;
84
85 op.params[0].tmpref.buffer = id;
86 op.params[0].tmpref.size = id_size;
87 op.params[1].value.a = flags;
88 op.params[1].value.b = 0;
Jerome Forissier0e99d6a2016-07-25 14:21:43 +020089 op.params[2].value.a = storage_id;
Pascal Brandc639ac82015-07-02 08:53:34 +020090
91 op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +020092 TEEC_VALUE_INOUT, TEEC_VALUE_INPUT,
Pascal Brandc639ac82015-07-02 08:53:34 +020093 TEEC_NONE);
94
95 res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_OPEN, &op, &org);
96
97 if (res == TEEC_SUCCESS)
98 *obj = op.params[1].value.b;
99
100 return res;
101}
102
103static TEEC_Result fs_create(TEEC_Session *sess, void *id, uint32_t id_size,
104 uint32_t flags, uint32_t attr, void *data,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200105 uint32_t data_size, uint32_t *obj,
106 uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200107{
Aijun Sun473d9072015-08-06 15:24:49 +0800108 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200109 TEEC_Result res;
110 uint32_t org;
111
112 op.params[0].tmpref.buffer = id;
113 op.params[0].tmpref.size = id_size;
114 op.params[1].value.a = flags;
115 op.params[1].value.b = 0;
116 op.params[2].value.a = attr;
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200117 op.params[2].value.b = storage_id;
Pascal Brandc639ac82015-07-02 08:53:34 +0200118 op.params[3].tmpref.buffer = data;
119 op.params[3].tmpref.size = data_size;
120
121 op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
122 TEEC_VALUE_INOUT, TEEC_VALUE_INPUT,
123 TEEC_MEMREF_TEMP_INPUT);
124
125 res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_CREATE, &op, &org);
126
127 if (res == TEEC_SUCCESS)
128 *obj = op.params[1].value.b;
129
130 return res;
131}
132
Pascal Brandeb84c442016-04-19 17:49:49 +0200133static TEEC_Result fs_create_overwrite(TEEC_Session *sess, void *id,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200134 uint32_t id_size, uint32_t storage_id)
Pascal Brandeb84c442016-04-19 17:49:49 +0200135{
136 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
137 TEEC_Result res;
138 uint32_t org;
139
140 op.params[0].tmpref.buffer = id;
141 op.params[0].tmpref.size = id_size;
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200142 op.params[1].value.a = storage_id;
Pascal Brandeb84c442016-04-19 17:49:49 +0200143
144 op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200145 TEEC_VALUE_INPUT, TEEC_NONE,
Pascal Brandeb84c442016-04-19 17:49:49 +0200146 TEEC_NONE);
147
148 res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_CREATE_OVERWRITE, &op, &org);
149
150 return res;
151}
152
Pascal Brandc639ac82015-07-02 08:53:34 +0200153static TEEC_Result fs_close(TEEC_Session *sess, uint32_t obj)
154{
Aijun Sun473d9072015-08-06 15:24:49 +0800155 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200156 uint32_t org;
157
158 op.params[0].value.a = obj;
159
160 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
161 TEEC_NONE, TEEC_NONE);
162
163 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_CLOSE, &op, &org);
164}
165
166static TEEC_Result fs_read(TEEC_Session *sess, uint32_t obj, void *data,
167 uint32_t data_size, uint32_t *count)
168{
169 TEEC_Result res;
Aijun Sun473d9072015-08-06 15:24:49 +0800170 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200171 uint32_t org;
172
173 op.params[0].tmpref.buffer = data;
174 op.params[0].tmpref.size = data_size;
175 op.params[1].value.a = obj;
176 op.params[1].value.b = 0;
177
178 op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_OUTPUT,
179 TEEC_VALUE_INOUT, TEEC_NONE,
180 TEEC_NONE);
181
182 res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_READ, &op, &org);
183
184 if (res == TEEC_SUCCESS)
185 *count = op.params[1].value.b;
186
187 return res;
188}
189
190static TEEC_Result fs_write(TEEC_Session *sess, uint32_t obj, void *data,
191 uint32_t data_size)
192{
Aijun Sun473d9072015-08-06 15:24:49 +0800193 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200194 uint32_t org;
195
196 op.params[0].tmpref.buffer = data;
197 op.params[0].tmpref.size = data_size;
198 op.params[1].value.a = obj;
199 op.params[1].value.b = 0;
200
201 op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_INPUT,
202 TEEC_VALUE_INPUT, TEEC_NONE,
203 TEEC_NONE);
204
205 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_WRITE, &op, &org);
206}
207
208static TEEC_Result fs_seek(TEEC_Session *sess, uint32_t obj, int32_t offset,
209 int32_t whence)
210{
Aijun Sun473d9072015-08-06 15:24:49 +0800211 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200212 uint32_t org;
213
214 op.params[0].value.a = obj;
215 op.params[0].value.b = offset;
216 op.params[1].value.a = whence;
217
218 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_VALUE_INOUT,
219 TEEC_NONE, TEEC_NONE);
220
221 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_SEEK, &op, &org);
222}
223
224static TEEC_Result fs_unlink(TEEC_Session *sess, uint32_t obj)
225{
Aijun Sun473d9072015-08-06 15:24:49 +0800226 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200227 uint32_t org;
228
229 op.params[0].value.a = obj;
230
231 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
232 TEEC_NONE, TEEC_NONE);
233
234 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_UNLINK, &op, &org);
235}
236
237static TEEC_Result fs_trunc(TEEC_Session *sess, uint32_t obj, uint32_t len)
238{
Aijun Sun473d9072015-08-06 15:24:49 +0800239 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200240 uint32_t org;
241
242 op.params[0].value.a = obj;
243 op.params[0].value.b = len;
244
245 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
246 TEEC_NONE, TEEC_NONE);
247
248 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_TRUNC, &op, &org);
249}
250
251static TEEC_Result fs_rename(TEEC_Session *sess, uint32_t obj, void *id,
252 uint32_t id_size)
253{
Aijun Sun473d9072015-08-06 15:24:49 +0800254 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200255 uint32_t org;
256
257 op.params[0].value.a = obj;
258 op.params[1].tmpref.buffer = id;
259 op.params[1].tmpref.size = id_size;
260
261 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT,
262 TEEC_MEMREF_TEMP_INPUT, TEEC_NONE,
263 TEEC_NONE);
264
265 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_RENAME, &op, &org);
266}
267
268static TEEC_Result fs_alloc_enum(TEEC_Session *sess, uint32_t *e)
269{
270 TEEC_Result res;
Aijun Sun473d9072015-08-06 15:24:49 +0800271 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200272 uint32_t org;
273
274 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_OUTPUT, TEEC_NONE,
275 TEEC_NONE, TEEC_NONE);
276
277 res = TEEC_InvokeCommand(sess, TA_STORAGE_CMD_ALLOC_ENUM, &op, &org);
278
279 if (res == TEEC_SUCCESS)
280 *e = op.params[0].value.a;
281
282 return res;
283}
284
285static TEEC_Result fs_free_enum(TEEC_Session *sess, uint32_t e)
286{
Aijun Sun473d9072015-08-06 15:24:49 +0800287 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200288 uint32_t org;
289
290 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE,
291 TEEC_NONE);
292
293 op.params[0].value.a = e;
294
295 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_FREE_ENUM, &op, &org);
296}
297
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200298static TEEC_Result fs_start_enum(TEEC_Session *sess, uint32_t e,
299 uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200300{
Aijun Sun473d9072015-08-06 15:24:49 +0800301 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200302 uint32_t org;
303
304 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
305 TEEC_NONE, TEEC_NONE);
306
307 op.params[0].value.a = e;
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200308 op.params[0].value.b = storage_id;
Pascal Brandc639ac82015-07-02 08:53:34 +0200309
310 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_START_ENUM, &op, &org);
311}
312
313static TEEC_Result fs_next_enum(TEEC_Session *sess, uint32_t e, void *obj_info,
314 size_t info_size, void *id, uint32_t id_size)
315{
Aijun Sun473d9072015-08-06 15:24:49 +0800316 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
Pascal Brandc639ac82015-07-02 08:53:34 +0200317 uint32_t org;
318
Pascal Brandc603e0d2016-04-25 12:37:18 +0200319 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
Pascal Brandc639ac82015-07-02 08:53:34 +0200320 TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE);
Pascal Brandc603e0d2016-04-25 12:37:18 +0200321 if (obj_info && info_size)
322 op.paramTypes |= (TEEC_MEMREF_TEMP_OUTPUT << 4);
Pascal Brandc639ac82015-07-02 08:53:34 +0200323
324 op.params[0].value.a = e;
325 op.params[1].tmpref.buffer = obj_info;
326 op.params[1].tmpref.size = info_size;
327 op.params[2].tmpref.buffer = id;
328 op.params[2].tmpref.size = id_size;
329
330 return TEEC_InvokeCommand(sess, TA_STORAGE_CMD_NEXT_ENUM, &op, &org);
331}
332
James Kung98c0ba12015-09-09 15:51:59 +0800333/* trunc */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200334static void test_truncate_file_length(ADBG_Case_t *c, uint32_t storage_id)
James Kung98c0ba12015-09-09 15:51:59 +0800335{
336 TEEC_Session sess;
337 uint32_t obj;
338 uint8_t out[10] = { 0 };
339 uint32_t count;
340 uint32_t orig;
341
342 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
343 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
344 return;
345
346 /* create */
347 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
348 fs_create(&sess, file_01, sizeof(file_01),
349 TEE_DATA_FLAG_ACCESS_WRITE |
350 TEE_DATA_FLAG_ACCESS_READ |
351 TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200352 sizeof(data_00), &obj, storage_id)))
James Kung98c0ba12015-09-09 15:51:59 +0800353 goto exit;
354
355 /* trunc */
356 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_trunc(&sess, obj, 10)))
357 goto exit;
358
359 /* seek */
360 if (!ADBG_EXPECT_TEEC_SUCCESS(
361 c, fs_seek(&sess, obj, 5, TEE_DATA_SEEK_SET)))
362 goto exit;
363
364 /* verify */
365 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
366 goto exit;
367
368 /* check buffer */
369 (void)ADBG_EXPECT_BUFFER(c, &data_00[5], 5, out, count);
370
371 /* clean */
372 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
373 goto exit;
374
375exit:
376 TEEC_CloseSession(&sess);
377}
378
379/* extend */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200380static void test_extend_file_length(ADBG_Case_t *c, uint32_t storage_id)
James Kung98c0ba12015-09-09 15:51:59 +0800381{
382 TEEC_Session sess;
383 uint32_t obj;
384 uint8_t out[10] = { 0 };
385 uint8_t expect[10] = { 0 };
386 uint32_t count;
387 uint32_t orig;
388
389 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
390 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
391 return;
392
393 /* create */
394 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
395 fs_create(&sess, file_01, sizeof(file_01),
396 TEE_DATA_FLAG_ACCESS_WRITE |
397 TEE_DATA_FLAG_ACCESS_READ |
398 TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200399 sizeof(data_00), &obj, storage_id)))
James Kung98c0ba12015-09-09 15:51:59 +0800400 goto exit;
401
402 /* extend */
403 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_trunc(&sess, obj, 40)))
404 goto exit;
405
406 /* seek */
407 if (!ADBG_EXPECT_TEEC_SUCCESS(
408 c, fs_seek(&sess, obj, 30, TEE_DATA_SEEK_SET)))
409 goto exit;
410
411 /* verify */
412 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
413 goto exit;
414
415 /* check buffer */
416 expect[0] = data_00[30];
417 expect[1] = data_00[31];
418 (void)ADBG_EXPECT_BUFFER(c, &expect[0], 10, out, count);
419
420 /* clean */
421 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
422 goto exit;
423
424exit:
425 TEEC_CloseSession(&sess);
426}
427
428/* file hole */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200429static void test_file_hole(ADBG_Case_t *c, uint32_t storage_id)
James Kung98c0ba12015-09-09 15:51:59 +0800430{
431 TEEC_Session sess;
432 uint32_t obj;
433 uint8_t out[10] = { 0 };
434 uint8_t expect[10] = { 0 };
435 uint32_t count;
436 uint32_t orig;
437
438 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
439 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
440 return;
441
442 /* create */
443 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
444 fs_create(&sess, file_01, sizeof(file_01),
445 TEE_DATA_FLAG_ACCESS_WRITE |
446 TEE_DATA_FLAG_ACCESS_READ |
447 TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200448 sizeof(data_00), &obj, storage_id)))
James Kung98c0ba12015-09-09 15:51:59 +0800449 goto exit;
450
451 /* seek */
452 if (!ADBG_EXPECT_TEEC_SUCCESS(
453 c, fs_seek(&sess, obj, 80, TEE_DATA_SEEK_SET)))
454 goto exit;
455
456 /* write */
457 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_write(&sess, obj, data_00,
458 sizeof(data_00))))
459 goto exit;
460
461 /* seek */
462 if (!ADBG_EXPECT_TEEC_SUCCESS(
463 c, fs_seek(&sess, obj, 74, TEE_DATA_SEEK_SET)))
464 goto exit;
465
466 /* verify */
467 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
468 goto exit;
469
470 /* check buffer */
471 expect[6] = data_00[0];
472 expect[7] = data_00[1];
473 expect[8] = data_00[2];
474 expect[9] = data_00[3];
475 (void)ADBG_EXPECT_BUFFER(c, &expect[0], 10, out, count);
476
477 /* clean */
478 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
479 goto exit;
480
481exit:
482 TEEC_CloseSession(&sess);
483}
484
Jerome Forissiere3688342015-09-24 10:45:17 -0700485#ifdef WITH_GP_TESTS
Pascal Brand8a74e362015-09-10 12:41:52 +0200486static TEEC_Result ds_open_access_conf(TEEC_Session *sess)
487{
488 TEEC_Operation op;
489 uint32_t org;
490
491 op.paramTypes = TEEC_PARAM_TYPES(
492 TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
493
494 return TEEC_InvokeCommand(
495 sess, CMD_CreatePersistentObject_AccessConflict, &op, &org);
496}
497
498static TEEC_Result ds_res_obj_panic(TEEC_Session *sess)
499{
500 TEEC_Operation op;
501 uint32_t org;
502
503 op.paramTypes = TEEC_PARAM_TYPES(
504 TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
505
506 return TEEC_InvokeCommand(
507 sess, CMD_RestrictObjectUsagePanic, &op, &org);
508}
509
510static TEEC_Result ds_seek_obj_inv_handle(TEEC_Session *sess)
511{
512 TEEC_Operation op;
513 uint32_t org;
514
515 op.paramTypes = TEEC_PARAM_TYPES(
516 TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
517
518 op.params[0].value.a = CASE_DATA_OBJECT_NOT_PERSISTENT;
519
520 return TEEC_InvokeCommand(
521 sess, CMD_SeekObjectData_panic, &op, &org);
522}
523
524static TEEC_Result ds_seek_obj_bad_handle(TEEC_Session *sess)
525{
526 TEEC_Operation op;
527 uint32_t org;
528
529 op.paramTypes = TEEC_PARAM_TYPES(
530 TEEC_VALUE_INPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
531
532 op.params[0].value.a = CASE_DATA_BAD_HANDLE;
533
534 return TEEC_InvokeCommand(
535 sess, CMD_SeekObjectData_panic, &op, &org);
536}
537
538static TEEC_Result ds_seek_gp(
539 TEEC_Session *sess, TEE_Whence wh, uint32_t wh_off, uint32_t set_off,
540 void *in, size_t in_size, void *out, size_t out_size)
541{
542 TEEC_Operation op;
543 uint32_t org;
544
545 op.paramTypes = TEEC_PARAM_TYPES(
546 TEEC_VALUE_INPUT, TEEC_VALUE_INPUT, TEEC_MEMREF_TEMP_INPUT,
547 TEEC_MEMREF_TEMP_OUTPUT);
548
549 op.params[0].value.a = wh;
550 op.params[0].value.b = wh_off;
551 op.params[1].value.a = set_off;
552 op.params[2].tmpref.buffer = in;
553 op.params[2].tmpref.size = in_size;
554 op.params[3].tmpref.buffer = out;
555 op.params[3].tmpref.size = out_size;
556
557 return TEEC_InvokeCommand(sess, CMD_SeekWriteReadObjectData, &op, &org);
558}
559
560static TEEC_Result ds_init_object_and_attributes(TEEC_Session *sess,
561 uint32_t obj_type, uint32_t obj_size, const void *attr_meta,
562 size_t attr_meta_len, const void *attr_data, size_t attr_data_len,
563 uint32_t option)
564{
565 TEEC_Operation op;
566 uint32_t org;
567
568 op.paramTypes = TEEC_PARAM_TYPES(
569 TEEC_VALUE_INPUT, TEEC_MEMREF_TEMP_INPUT,
570 TEEC_MEMREF_TEMP_INPUT, TEEC_VALUE_INPUT);
571
572 op.params[0].value.a = obj_type;
573 op.params[0].value.b = obj_size;
574 op.params[1].tmpref.buffer = (void *)attr_meta;
575 op.params[1].tmpref.size = attr_meta_len;
576 op.params[2].tmpref.buffer = (void *)attr_data;
577 op.params[2].tmpref.size = attr_data_len;
578 op.params[3].value.a = option;
579
580 return TEEC_InvokeCommand(sess, CMD_InitObjectAndAttributes, &op, &org);
581}
582
583static TEEC_Result ds_rename_access_conflict(TEEC_Session *sess)
584{
585 TEEC_Operation op;
586 uint32_t org;
587
588 op.paramTypes = TEEC_PARAM_TYPES(
589 TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
590
591 return TEEC_InvokeCommand(
592 sess, CMD_RenamePersistentObject_AccessConflict, &op, &org);
593}
594
595static TEEC_Result ds_start_enum_no_item(TEEC_Session *sess)
596{
597 TEEC_Operation op;
598 uint32_t org;
599 TEEC_Result res;
600
601 op.paramTypes = TEEC_PARAM_TYPES(
602 TEEC_VALUE_OUTPUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
603
604 res = TEEC_InvokeCommand(
605 sess, CMD_StartNGetPersistentObjectEnumerator_itemNotFound, &op, &org);
606
607 if (res != TEEC_SUCCESS)
608 return res;
609
610 if (op.params[0].value.a != 0 || op.params[0].value.b != 0)
611 return TEEC_ERROR_GENERIC;
612
613 return res;
614}
615
616static TEEC_Result ds_rename_success(TEEC_Session *sess)
617{
618 TEEC_Operation op;
619 uint32_t org;
620
621 op.paramTypes = TEEC_PARAM_TYPES(
622 TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
623
624 return TEEC_InvokeCommand(
625 sess, CMD_RenamePersistentObject_Success, &op, &org);
626}
627
628static TEEC_Result ds_null_close_free_reset(TEEC_Session *sess)
629{
630 TEEC_Operation op;
631 uint32_t org;
632
633 op.paramTypes = TEEC_PARAM_TYPES(
634 TEEC_NONE, TEEC_NONE, TEEC_NONE, TEEC_NONE);
635
636 return TEEC_InvokeCommand(
637 sess, CMD_CloseFreeAndResetObjectSuccessHandleNull, &op, &org);
638}
639#endif
640
Pascal Brandc639ac82015-07-02 08:53:34 +0200641/* create */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200642static void xtest_tee_test_6001_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200643{
644 TEEC_Session sess;
645 uint32_t obj;
646 uint32_t orig;
647
648 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
649 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
650 return;
651
652 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
653 fs_create(&sess, file_00, sizeof(file_00),
654 TEE_DATA_FLAG_ACCESS_WRITE |
655 TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200656 sizeof(data_00), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200657 goto exit;
658
659 /* clean */
660 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
661 goto exit;
662
663exit:
664 TEEC_CloseSession(&sess);
665}
666
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200667#define DEFINE_TEST_MULTIPLE_STORAGE_IDS(test_name) \
668static void test_name(ADBG_Case_t *c) \
669{ \
670 size_t i; \
671 \
672 for (i = 0; i < ARRAY_SIZE(storage_ids); i++) { \
673 Do_ADBG_BeginSubCase(c, "Storage id: %08x", storage_ids[i]); \
674 test_name##_single(c, storage_ids[i]); \
675 Do_ADBG_EndSubCase(c, "Storage id: %08x", storage_ids[i]); \
676 } \
677}
678
679DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6001)
680
Pascal Brandc639ac82015-07-02 08:53:34 +0200681/* open */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200682static void xtest_tee_test_6002_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200683{
684 TEEC_Session sess;
685 uint32_t obj;
686 uint32_t orig;
687
688 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
689 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
690 return;
691
692 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
693 fs_create(&sess, file_01, sizeof(file_01),
694 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200695 sizeof(data_00), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200696 goto exit;
697
698 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
699 goto exit;
700
701 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
702 fs_open(&sess, file_01, sizeof(file_01),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200703 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200704 goto exit;
705
706 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
707 goto exit;
708
709 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
710 fs_open(&sess, file_01, sizeof(file_01),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200711 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200712 goto exit;
713
714 /* clean */
715 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
716 goto exit;
717
718exit:
719 TEEC_CloseSession(&sess);
720}
721
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200722DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6002)
723
Pascal Brandc639ac82015-07-02 08:53:34 +0200724/* read */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200725static void xtest_tee_test_6003_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200726{
727 TEEC_Session sess;
728 uint32_t obj;
729 uint8_t out[10] = { 0 };
730 uint32_t count;
731 uint32_t orig;
732
733 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
734 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
735 return;
736
737 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
738 fs_create(&sess, file_02, sizeof(file_02),
739 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200740 sizeof(data_01), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200741 goto exit;
742
743 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
744 goto exit;
745
746 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
747 fs_open(&sess, file_02, sizeof(file_02),
748 TEE_DATA_FLAG_ACCESS_READ |
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200749 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200750 goto exit;
751
752 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
753 goto exit;
754
755 (void)ADBG_EXPECT_BUFFER(c, data_01, 10, out, count);
756
757 /* clean */
758 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
759 goto exit;
760
761exit:
762 TEEC_CloseSession(&sess);
763}
764
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200765DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6003)
766
Pascal Brandc639ac82015-07-02 08:53:34 +0200767/* write */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200768static void xtest_tee_test_6004_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200769{
770 TEEC_Session sess;
771 uint32_t obj;
772 uint8_t out[10] = { 0 };
773 uint32_t count;
774 uint32_t orig;
775
776 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
777 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
778 return;
779
780 /* create */
781 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
782 fs_create(&sess, file_02, sizeof(file_02),
783 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200784 sizeof(data_01), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200785 goto exit;
786
787 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
788 goto exit;
789
790 /* write new data */
791 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
792 fs_open(&sess, file_02, sizeof(file_02),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200793 TEE_DATA_FLAG_ACCESS_WRITE, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200794 goto exit;
795
796 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
797 fs_write(&sess, obj, data_00, sizeof(data_00))))
798 goto exit;
799
800 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
801 goto exit;
802
803 /* verify */
804 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
805 fs_open(&sess, file_02, sizeof(file_02),
806 TEE_DATA_FLAG_ACCESS_READ |
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200807 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200808 goto exit;
809
810 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
811 goto exit;
812
813 (void)ADBG_EXPECT_BUFFER(c, data_00, 10, out, count);
814
815 /* clean */
816 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
817 goto exit;
818
819exit:
820 TEEC_CloseSession(&sess);
821}
822
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200823DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6004)
824
Pascal Brandc639ac82015-07-02 08:53:34 +0200825/* seek */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200826static void xtest_tee_test_6005_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200827{
828 TEEC_Session sess;
829 uint32_t obj;
830 uint8_t out[10] = { 0 };
831 uint32_t count;
832 uint32_t orig;
833
834 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
835 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
836 return;
837
838 /* create */
839 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
840 fs_create(&sess, file_01, sizeof(file_01),
841 TEE_DATA_FLAG_ACCESS_WRITE |
842 TEE_DATA_FLAG_ACCESS_READ |
843 TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200844 sizeof(data_00), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200845 goto exit;
846
847 /* seek */
848 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
849 fs_seek(&sess, obj, 10, TEE_DATA_SEEK_SET)))
850 goto exit;
851
852 /* verify */
853 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
854 goto exit;
855
856 (void)ADBG_EXPECT_BUFFER(c, &data_00[10], 10, out, count);
857
858 /* clean */
859 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
860 goto exit;
861
862exit:
863 TEEC_CloseSession(&sess);
864}
865
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200866DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6005)
867
Pascal Brandc639ac82015-07-02 08:53:34 +0200868/* unlink */
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200869static void xtest_tee_test_6006_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200870{
871 TEEC_Session sess;
872 uint32_t obj;
873 uint32_t orig;
874
875 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
876 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
877 return;
878
879 /* create */
880 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
881 fs_create(&sess, file_01, sizeof(file_01),
882 TEE_DATA_FLAG_ACCESS_WRITE_META, 0, data_00,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200883 sizeof(data_00), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200884 goto exit;
885
886 /* del & close */
887 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
888 goto exit;
889
890 /* check result */
891 if (!ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_ITEM_NOT_FOUND,
892 fs_open(&sess, file_01, sizeof(file_01),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200893 TEE_DATA_FLAG_ACCESS_READ, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200894 goto exit;
895
896exit:
897 TEEC_CloseSession(&sess);
898}
899
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200900DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6006)
901
902static void xtest_tee_test_6007_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200903{
James Kung98c0ba12015-09-09 15:51:59 +0800904 Do_ADBG_BeginSubCase(c, "Test truncate file length");
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200905 test_truncate_file_length(c, storage_id);
James Kung98c0ba12015-09-09 15:51:59 +0800906 Do_ADBG_EndSubCase(c, "Test truncate file length");
Pascal Brandc639ac82015-07-02 08:53:34 +0200907
James Kung98c0ba12015-09-09 15:51:59 +0800908 Do_ADBG_BeginSubCase(c, "Test extend file length");
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200909 test_extend_file_length(c, storage_id);
James Kung98c0ba12015-09-09 15:51:59 +0800910 Do_ADBG_EndSubCase(c, "Test extend file length");
Pascal Brandc639ac82015-07-02 08:53:34 +0200911
James Kung98c0ba12015-09-09 15:51:59 +0800912 Do_ADBG_BeginSubCase(c, "Test file hole");
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200913 test_file_hole(c, storage_id);
James Kung98c0ba12015-09-09 15:51:59 +0800914 Do_ADBG_EndSubCase(c, "Test file hole");
Pascal Brandc639ac82015-07-02 08:53:34 +0200915}
916
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200917DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6007)
918
919static void xtest_tee_test_6008_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200920{
921 TEEC_Session sess;
922 uint32_t obj;
923 uint8_t out[10] = { 0 };
924 uint32_t count;
925 uint32_t orig;
926
927 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
928 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
929 return;
930
931 /* create */
932 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
933 fs_create(&sess, file_02, sizeof(file_02),
934 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200935 sizeof(data_01), &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200936 goto exit;
937
938 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
939 goto exit;
940
941 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
942 fs_open(&sess, file_02, sizeof(file_02),
943 TEE_DATA_FLAG_ACCESS_WRITE |
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200944 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200945 goto exit;
946
947 /* write new data */
948 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
949 fs_write(&sess, obj, data_00, sizeof(data_00))))
950 goto exit;
951
952 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
953 fs_rename(&sess, obj, file_03, sizeof(file_03))))
954 goto exit;
955
956 /* close */
957 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj)))
958 goto exit;
959
960 /* verify */
961 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
962 fs_open(&sess, file_03, sizeof(file_03),
963 TEE_DATA_FLAG_ACCESS_READ |
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200964 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +0200965 goto exit;
966
967 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_read(&sess, obj, out, 10, &count)))
968 goto exit;
969
970 /* check buffer */
971 (void)ADBG_EXPECT_BUFFER(c, data_00, 10, out, count);
972
973 /* clean */
974 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
975 goto exit;
976
977exit:
978 TEEC_CloseSession(&sess);
979}
980
Jerome Forissier0e99d6a2016-07-25 14:21:43 +0200981DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6008)
982
983static void xtest_tee_test_6009_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandc639ac82015-07-02 08:53:34 +0200984{
985 TEEC_Session sess;
986 uint32_t obj0;
987 uint32_t obj1;
988 uint32_t obj2;
989 uint32_t e = 0;
990 uint8_t info[200];
991 uint8_t id[200];
992 uint32_t orig;
993
994 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
995 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
996 return;
997
998 /* create file 00 */
999 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1000 fs_create(&sess, file_00, sizeof(file_00),
1001 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001002 sizeof(data_01), &obj0, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001003 goto exit;
1004
1005 /* create file 01 */
1006 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1007 fs_create(&sess, file_01, sizeof(file_01),
1008 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001009 sizeof(data_01), &obj1, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001010 goto exit;
1011
1012 /* create file 02 */
1013 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1014 fs_create(&sess, file_02, sizeof(file_02),
1015 TEE_DATA_FLAG_ACCESS_WRITE, 0, data_01,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001016 sizeof(data_01), &obj2, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001017 goto exit;
1018
1019 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj0)))
1020 goto exit;
1021
1022 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj1)))
1023 goto exit;
1024
1025 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_close(&sess, obj2)))
1026 goto exit;
1027
1028 /* iterate */
1029 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_alloc_enum(&sess, &e)))
1030 goto exit;
1031
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001032 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_start_enum(&sess, e, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001033 goto exit;
1034
1035 /* get 00 */
1036 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1037 fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
1038 goto exit;
1039
1040 /* get 01 */
1041 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
Pascal Brandc603e0d2016-04-25 12:37:18 +02001042 fs_next_enum(&sess, e, NULL, 0, id, sizeof(id))))
Pascal Brandc639ac82015-07-02 08:53:34 +02001043 goto exit;
1044
1045 /* get 02 */
1046 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1047 fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
1048 goto exit;
1049
1050 /* we should not have more files */
1051 if (!ADBG_EXPECT_TEEC_RESULT(c, TEEC_ERROR_ITEM_NOT_FOUND,
1052 fs_next_enum(&sess, e, info, sizeof(info), id, sizeof(id))))
1053 goto exit;
1054
1055 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_free_enum(&sess, e)))
1056 goto exit;
1057
1058 /* clean */
1059 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1060 fs_open(&sess, file_00, sizeof(file_00),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001061 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj0, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001062 goto exit;
1063
1064 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj0)))
1065 goto exit;
1066
1067 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1068 fs_open(&sess, file_01, sizeof(file_01),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001069 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj1, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001070 goto exit;
1071
1072 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj1)))
1073 goto exit;
1074
1075 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1076 fs_open(&sess, file_02, sizeof(file_02),
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001077 TEE_DATA_FLAG_ACCESS_WRITE_META, &obj2, storage_id)))
Pascal Brandc639ac82015-07-02 08:53:34 +02001078 goto exit;
1079
1080 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj2)))
1081 goto exit;
1082
1083exit:
1084 TEEC_CloseSession(&sess);
1085}
1086
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001087DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6009)
1088
Jerome Forissiere3688342015-09-24 10:45:17 -07001089#ifdef WITH_GP_TESTS
Pascal Brand8a74e362015-09-10 12:41:52 +02001090static void xtest_tee_test_6010(ADBG_Case_t *c)
1091{
1092 TEEC_Session sess;
1093 uint32_t orig;
1094 uint8_t out[4000] = {0};
1095 uint8_t in[0x12c] = {'b'};
Pascal Brand30844922015-09-17 12:12:42 +02001096 int i;
1097
1098 for (i=0; i<sizeof(in); i++)
1099 in[i] = i;
Pascal Brand8a74e362015-09-10 12:41:52 +02001100
1101 if (!ADBG_EXPECT_TEEC_SUCCESS(
1102 c, xtest_teec_open_session(
1103 &sess, &gp_tta_ds_uuid, NULL, &orig)))
1104 return;
1105
1106 Do_ADBG_BeginSubCase(
1107 c, "GP DS CreatePersistentObject AccessConflict (9d-1d-62)");
1108
1109 if (!ADBG_EXPECT_TEEC_RESULT(
1110 c, TEEC_ERROR_ACCESS_CONFLICT, ds_open_access_conf(&sess)))
1111 goto exit;
1112
1113 Do_ADBG_EndSubCase(
1114 c, "GP DS CreatePersistentObject AccessConflict (9d-1d-62)");
1115 Do_ADBG_BeginSubCase(
1116 c, "GP DS RestrictObjectUsagePanic (9d-5d-46)");
1117
1118 if (!ADBG_EXPECT_TEEC_RESULT(
1119 c, TEE_ERROR_TARGET_DEAD, ds_res_obj_panic(&sess)))
1120 goto exit;
1121
1122 TEEC_CloseSession(&sess);
1123
1124 Do_ADBG_EndSubCase(
1125 c, "GP DS RestrictObjectUsagePanic (9d-5d-46)");
1126 Do_ADBG_BeginSubCase(
1127 c, "GP DS SeekObjectData BadHandle (9d-c3-c8)");
1128
1129 if (!ADBG_EXPECT_TEEC_SUCCESS(
1130 c, xtest_teec_open_session(
1131 &sess, &gp_tta_ds_uuid, NULL, &orig)))
1132 return;
1133
1134 if (!ADBG_EXPECT_TEEC_RESULT(
1135 c, TEE_ERROR_TARGET_DEAD, ds_seek_obj_bad_handle(&sess)))
1136 goto exit;
1137
1138 TEEC_CloseSession(&sess);
1139
1140 Do_ADBG_EndSubCase(
1141 c, "GP DS SeekObjectData BadHandle (9d-c3-c8)");
1142 Do_ADBG_BeginSubCase(
1143 c, "GP DS SeekObjectData NotPersist (9d-db-4a)");
1144
1145 if (!ADBG_EXPECT_TEEC_SUCCESS(
1146 c, xtest_teec_open_session(
1147 &sess, &gp_tta_ds_uuid, NULL, &orig)))
1148 return;
1149
1150 if (!ADBG_EXPECT_TEEC_RESULT(
1151 c, TEE_ERROR_TARGET_DEAD, ds_seek_obj_inv_handle(&sess)))
1152 goto exit;
1153
1154 TEEC_CloseSession(&sess);
1155
1156 Do_ADBG_EndSubCase(
1157 c, "GP DS SeekObjectData NotPersist (9d-db-4a)");
1158 Do_ADBG_BeginSubCase(c, "GP DS SeekWriteRead SEEK_END (9d-e4-58)");
1159
1160 if (!ADBG_EXPECT_TEEC_SUCCESS(
1161 c, xtest_teec_open_session(
1162 &sess, &gp_tta_ds_uuid, NULL, &orig)))
1163 return;
1164
1165 if (!ADBG_EXPECT_TEEC_SUCCESS(
1166 c, ds_seek_gp(
1167 &sess, TEE_DATA_SEEK_END, 0, 2, data_00, sizeof(data_00), out,
1168 sizeof(out))))
1169 goto exit;
1170
1171 /* check buffer */
1172 (void)ADBG_EXPECT_BUFFER(
1173 c, data_00, sizeof(data_00), out, sizeof(data_00));
Pascal Brand30844922015-09-17 12:12:42 +02001174 memset(out, 0xab, sizeof(out));
Pascal Brand8a74e362015-09-10 12:41:52 +02001175
1176 if (!ADBG_EXPECT_TEEC_SUCCESS(
1177 c, ds_seek_gp(
Pascal Brand30844922015-09-17 12:12:42 +02001178 &sess, TEE_DATA_SEEK_END, sizeof(in)/2, 0, in, sizeof(in), out,
Pascal Brand8a74e362015-09-10 12:41:52 +02001179 sizeof(out))))
1180 goto exit;
1181
Pascal Brand30844922015-09-17 12:12:42 +02001182 (void)ADBG_EXPECT_BUFFER(c, in, sizeof(in) / 2,
1183 out + (sizeof(in) / 2), sizeof(in) / 2);
1184 memset(in, 0, sizeof(in));
1185 (void)ADBG_EXPECT_BUFFER(c, in, sizeof(in) / 2,
1186 out, sizeof(in)/2);
1187 memset(out, 0xab, sizeof(out));
Pascal Brand8a74e362015-09-10 12:41:52 +02001188
1189 Do_ADBG_EndSubCase(c, "GP DS SeekWriteRead SEEK_END (9d-e4-58)");
1190 Do_ADBG_BeginSubCase(c, "GP DS Rename Access Conflict (9d-29-d1)");
1191
1192 if (!ADBG_EXPECT_TEEC_RESULT(
1193 c, TEE_ERROR_ACCESS_CONFLICT, ds_rename_access_conflict(&sess)))
1194 goto exit;
1195
1196 Do_ADBG_EndSubCase(c, "GP DS Rename Access Conflict (9d-29-d1)");
1197 Do_ADBG_BeginSubCase(
1198 c, "GP DS StartPersistentObjectEnumerator ItemNotFound (9d-52-ec)");
1199
1200 if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_start_enum_no_item(&sess)))
1201 goto exit;
1202
1203 Do_ADBG_EndSubCase(
1204 c, "GP DS StartPersistentObjectEnumerator ItemNotFound (9d-52-ec)");
1205 Do_ADBG_BeginSubCase(
1206 c, "GP DS RenamePersistent ReadWrite (9d-19-88)");
1207
1208 if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_rename_success(&sess)))
1209 goto exit;
1210
1211 Do_ADBG_EndSubCase(
1212 c, "GP DS RenamePersistent ReadWrite (9d-19-88)");
1213 Do_ADBG_BeginSubCase(
1214 c, "GP DS Close Free Reset Null (9d-6d-87)");
1215
1216 if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_null_close_free_reset(&sess)))
1217 goto exit;
1218
1219 Do_ADBG_EndSubCase(
1220 c, "GP DS Close Free Reset Null (9d-6d-87)");
1221
1222exit:
1223 TEEC_CloseSession(&sess);
1224}
1225
1226static void xtest_tee_test_6011(ADBG_Case_t *c)
1227{
1228 TEEC_Session sess;
1229 uint32_t orig;
1230 /*
1231 * Test data from
1232 * Invoke_InitObjectAndAttributes_TEE_TYPE_AES_success_attribute_
1233 * TEE_ATTR_SECRET_VALUE_correct_size (9d-9a-91)
1234 */
1235 static const uint8_t attr_meta[] = {
12360xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
12370x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
12380x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
12390x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
1240 };
1241 static const uint8_t attr_data[] = {
12420x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe,0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,
12430x81,0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7,0x2d,0x98,0x10,0xa3,0x09,0x14,
12440xdf,0xf4,
1245 };
1246
1247 if (!ADBG_EXPECT_TEEC_SUCCESS(
1248 c, xtest_teec_open_session(
1249 &sess, &gp_tta_ds_uuid, NULL, &orig)))
1250 return;
1251
1252 if (!ADBG_EXPECT_TEEC_SUCCESS(c, ds_init_object_and_attributes(&sess,
1253 0xa0000010, 0x100, attr_meta, sizeof(attr_meta), attr_data,
1254 sizeof(attr_data), 0)))
1255 goto exit;
1256
1257exit:
1258 TEEC_CloseSession(&sess);
1259}
1260#endif
1261
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001262static void xtest_tee_test_6012_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brandeb84c442016-04-19 17:49:49 +02001263{
1264 TEEC_Session sess;
1265 uint32_t orig;
1266 uint32_t obj;
1267
1268 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1269 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
1270 return;
1271
1272 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001273 fs_create_overwrite(&sess, file_04, sizeof(file_04), storage_id)))
Pascal Brandeb84c442016-04-19 17:49:49 +02001274 goto exit;
1275
1276 TEEC_CloseSession(&sess);
1277
1278 /* re-create the same */
1279 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1280 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
1281 return;
1282
1283 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001284 fs_create_overwrite(&sess, file_04, sizeof(file_04),
1285 storage_id)))
Pascal Brandeb84c442016-04-19 17:49:49 +02001286 goto exit;
1287
1288 /*
1289 * recreate it with an object, and remove it so that xtest 6009
1290 * can be replayed
1291 */
1292 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1293 fs_create(&sess, file_04, sizeof(file_04),
1294 TEE_DATA_FLAG_ACCESS_WRITE |
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001295 TEE_DATA_FLAG_ACCESS_WRITE_META |
1296 TEE_DATA_FLAG_OVERWRITE, 0, NULL, 0, &obj,
1297 storage_id)))
Pascal Brandeb84c442016-04-19 17:49:49 +02001298 goto exit;
1299
1300 /* clean */
1301 if (!ADBG_EXPECT_TEEC_SUCCESS(c, fs_unlink(&sess, obj)))
1302 goto exit;
1303
1304exit:
1305 TEEC_CloseSession(&sess);
1306}
1307
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001308DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6012)
1309
1310static void xtest_tee_test_6013_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brand90f23352016-05-19 15:15:47 +02001311{
1312 TEEC_Session sess;
1313 uint32_t orig;
1314 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
1315
1316 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1317 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
1318 return;
1319
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001320 op.params[0].value.a = storage_id;
1321 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
Pascal Brand90f23352016-05-19 15:15:47 +02001322 TEEC_NONE, TEEC_NONE);
1323
1324 ADBG_EXPECT_TEEC_SUCCESS(c,
1325 TEEC_InvokeCommand(&sess, TA_STORAGE_CMD_KEY_IN_PERSISTENT,
1326 &op, &orig));
1327
1328 TEEC_CloseSession(&sess);
1329}
1330
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001331DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6013)
1332
1333static void xtest_tee_test_6014_single(ADBG_Case_t *c, uint32_t storage_id)
Pascal Brand29ee18f2016-05-23 14:13:56 +02001334{
1335 TEEC_Session sess;
1336 uint32_t orig;
1337 TEEC_Operation op = TEEC_OPERATION_INITIALIZER;
1338
1339 if (!ADBG_EXPECT_TEEC_SUCCESS(c,
1340 xtest_teec_open_session(&sess, &storage_ta_uuid, NULL, &orig)))
1341 return;
1342
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001343 op.params[0].value.a = storage_id;
1344 op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INPUT, TEEC_NONE,
Pascal Brand29ee18f2016-05-23 14:13:56 +02001345 TEEC_NONE, TEEC_NONE);
1346
1347 ADBG_EXPECT_TEEC_SUCCESS(c,
1348 TEEC_InvokeCommand(&sess, TA_STORAGE_CMD_LOOP, &op, &orig));
1349
1350 TEEC_CloseSession(&sess);
1351}
1352
Jerome Forissier0e99d6a2016-07-25 14:21:43 +02001353DEFINE_TEST_MULTIPLE_STORAGE_IDS(xtest_tee_test_6014)
1354
Pascal Brandc639ac82015-07-02 08:53:34 +02001355ADBG_CASE_DEFINE(
1356 XTEST_TEE_6001, xtest_tee_test_6001,
1357 /* Title */
1358 "Test TEE_CreatePersistentObject",
1359 /* Short description */
1360 "Short description ...",
1361 /* Requirement IDs */
1362 "TEE-??",
1363 /* How to implement */
1364 "Description of how to implement ..."
1365 );
1366
1367ADBG_CASE_DEFINE(
1368 XTEST_TEE_6002, xtest_tee_test_6002,
1369 /* Title */
1370 "Test TEE_OpenPersistentObject",
1371 /* Short description */
1372 "Short description ...",
1373 /* Requirement IDs */
1374 "TEE-??",
1375 /* How to implement */
1376 "Description of how to implement ..."
1377 );
1378
1379ADBG_CASE_DEFINE(
1380 XTEST_TEE_6003, xtest_tee_test_6003,
1381 /* Title */
1382 "Test TEE_ReadObjectData",
1383 /* Short description */
1384 "Short description ...",
1385 /* Requirement IDs */
1386 "TEE-??",
1387 /* How to implement */
1388 "Description of how to implement ..."
1389 );
1390
1391ADBG_CASE_DEFINE(
1392 XTEST_TEE_6004, xtest_tee_test_6004,
1393 /* Title */
1394 "Test TEE_WriteObjectData",
1395 /* Short description */
1396 "Short description ...",
1397 /* Requirement IDs */
1398 "TEE-??",
1399 /* How to implement */
1400 "Description of how to implement ..."
1401 );
1402
1403ADBG_CASE_DEFINE(
1404 XTEST_TEE_6005, xtest_tee_test_6005,
1405 /* Title */
1406 "Test TEE_SeekObjectData",
1407 /* Short description */
1408 "Short description ...",
1409 /* Requirement IDs */
1410 "TEE-??",
1411 /* How to implement */
1412 "Description of how to implement ..."
1413 );
1414
1415ADBG_CASE_DEFINE(
1416 XTEST_TEE_6006, xtest_tee_test_6006,
1417 /* Title */
1418 "Test TEE_CloseAndDeletePersistentObject",
1419 /* Short description */
1420 "Short description ...",
1421 /* Requirement IDs */
1422 "TEE-??",
1423 /* How to implement */
1424 "Description of how to implement ..."
1425 );
1426
1427ADBG_CASE_DEFINE(
1428 XTEST_TEE_6007, xtest_tee_test_6007,
1429 /* Title */
1430 "Test TEE_TruncateObjectData",
1431 /* Short description */
1432 "Short description ...",
1433 /* Requirement IDs */
1434 "TEE-??",
1435 /* How to implement */
1436 "Description of how to implement ..."
1437 );
1438
1439ADBG_CASE_DEFINE(
1440 XTEST_TEE_6008, xtest_tee_test_6008,
1441 /* Title */
1442 "Test TEE_RenamePersistentObject",
1443 /* Short description */
1444 "Short description ...",
1445 /* Requirement IDs */
1446 "TEE-??",
1447 /* How to implement */
1448 "Description of how to implement ..."
1449 );
1450
1451ADBG_CASE_DEFINE(
1452 XTEST_TEE_6009, xtest_tee_test_6009,
1453 /* Title */
1454 "Test TEE Internal API Persistent Object Enumeration Functions",
1455 /* Short description */
1456 "Short description ...",
1457 /* Requirement IDs */
1458 "TEE-??",
1459 /* How to implement */
1460 "Description of how to implement ..."
1461 );
Pascal Brand8a74e362015-09-10 12:41:52 +02001462
Jerome Forissiere3688342015-09-24 10:45:17 -07001463#ifdef WITH_GP_TESTS
Pascal Brand8a74e362015-09-10 12:41:52 +02001464ADBG_CASE_DEFINE(
1465 XTEST_TEE_6010, xtest_tee_test_6010,
1466 /* Title */
1467 "Test TEE GP TTA DS storage",
1468 /* Short description */
1469 "Short description ...",
1470 /* Requirement IDs */
1471 "TEE-??",
1472 /* How to implement */
1473 "Description of how to implement ..."
1474);
1475
1476ADBG_CASE_DEFINE(
1477 XTEST_TEE_6011, xtest_tee_test_6011,
1478 /* Title */
1479 "Test TEE GP TTA DS init objects",
1480 /* Short description */
1481 "Short description ...",
1482 /* Requirement IDs */
1483 "TEE-??",
1484 /* How to implement */
1485 "Description of how to implement ..."
1486);
1487#endif
Pascal Brandeb84c442016-04-19 17:49:49 +02001488
1489ADBG_CASE_DEFINE(
1490 XTEST_TEE_6012, xtest_tee_test_6012,
1491 /* Title */
1492 "Test TEE GP TTA DS init objects",
1493 /* Short description */
1494 "Short description ...",
1495 /* Requirement IDs */
1496 "TEE-??",
1497 /* How to implement */
1498 "Description of how to implement ..."
1499);
Pascal Brand90f23352016-05-19 15:15:47 +02001500
1501ADBG_CASE_DEFINE(
1502 XTEST_TEE_6013, xtest_tee_test_6013,
1503 /* Title */
1504 "Key usage in Persistent objects",
1505 /* Short description */
1506 "Short description ...",
1507 /* Requirement IDs */
1508 "TEE-??",
1509 /* How to implement */
1510 "Description of how to implement ..."
1511);
Pascal Brand29ee18f2016-05-23 14:13:56 +02001512
1513ADBG_CASE_DEFINE(
1514 XTEST_TEE_6014, xtest_tee_test_6014,
1515 /* Title */
1516 "Loop on Persistent objects",
1517 /* Short description */
1518 "Short description ...",
1519 /* Requirement IDs */
1520 "TEE-??",
1521 /* How to implement */
1522 "Description of how to implement ..."
1523);