blob: fa0d2143f17acbf8266a9f37c1854099efc4695d [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 "xtest_test.h"
15#include <tee_client_api.h>
16#include <ta_create_fail_test.h>
17#include <ta_crypt.h>
18#include <ta_os_test.h>
19#include <ta_rpc_test.h>
20#include <ta_sims_test.h>
21#include <ta_storage.h>
Jens Wiklanderac27ec12015-07-15 15:23:14 +020022#include <ta_concurrent.h>
Jens Wiklander70672972016-04-06 00:01:45 +020023#include <ta_concurrent_large.h>
Pascal Brandc639ac82015-07-02 08:53:34 +020024#include <enc_fs_key_manager_test.h>
James Kungdf1e6cf2015-09-14 22:42:24 +080025#include <ta_storage_benchmark.h>
Pascal Brandc639ac82015-07-02 08:53:34 +020026#include <tee_api_defines.h>
Jerome Forissiere3688342015-09-24 10:45:17 -070027#ifdef WITH_GP_TESTS
Pascal Brand8a74e362015-09-10 12:41:52 +020028#include <tee_api_types.h>
29#include <TTA_DS_protocol.h>
30#endif
Pascal Brandc639ac82015-07-02 08:53:34 +020031
32ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_Result)
33ADBG_ENUM_TABLE_ENTRY(TEEC_SUCCESS),
34ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT),
35ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT_2),
36ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE),
37ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE_2),
38ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_GENERIC),
39ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_DENIED),
40ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_CANCEL),
41ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_CONFLICT),
42ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXCESS_DATA),
43ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_FORMAT),
44ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_PARAMETERS),
45ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_STATE),
46ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ITEM_NOT_FOUND),
47ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_IMPLEMENTED),
48ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_SUPPORTED),
49ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NO_DATA),
50ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_OUT_OF_MEMORY),
51ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BUSY),
52ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_COMMUNICATION),
53ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SECURITY),
54ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SHORT_BUFFER),
55ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXTERNAL_CANCEL),
56ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_OVERFLOW),
57ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TARGET_DEAD),
58ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NO_SPACE),
59ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_MAC_INVALID),
60ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_SIGNATURE_INVALID),
61ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NOT_SET),
62ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NEEDS_RESET)
63ADBG_ENUM_TABLE_DEFINE_END(TEEC_Result);
64
65ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_ErrorOrigin)
66ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_API),
67ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_COMMS),
68ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TEE),
69ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TRUSTED_APP)
70ADBG_ENUM_TABLE_DEFINE_END(TEEC_ErrorOrigin);
71
72#define ECC_SELF_TEST_UUID \
73 { 0xf34f4f3c, 0xab30, 0x4573, \
74 { 0x91, 0xBF, 0x3C, 0x57, 0x02, 0x4D, 0x51, 0x99 } }
75
Jens Wiklandercf16e842016-02-10 09:07:09 +010076#define STA_SELF_TEST_UUID \
77 { 0xd96a5b40, 0xc3e5, 0x21e3, \
78 { 0x87, 0x94, 0x10, 0x02, 0xa5, 0xd5, 0xc6, 0x1b } }
79
80
Pascal Brandc639ac82015-07-02 08:53:34 +020081const TEEC_UUID crypt_user_ta_uuid = TA_CRYPT_UUID;
82const TEEC_UUID os_test_ta_uuid = TA_OS_TEST_UUID;
83const TEEC_UUID create_fail_test_ta_uuid = TA_CREATE_FAIL_TEST_UUID;
84const TEEC_UUID ecc_test_ta_uuid = ECC_SELF_TEST_UUID;
Jens Wiklandercf16e842016-02-10 09:07:09 +010085const TEEC_UUID sta_test_ta_uuid = STA_SELF_TEST_UUID;
Pascal Brandc639ac82015-07-02 08:53:34 +020086const TEEC_UUID rpc_test_ta_uuid = TA_RPC_TEST_UUID;
87const TEEC_UUID sims_test_ta_uuid = TA_SIMS_TEST_UUID;
88const TEEC_UUID storage_ta_uuid = TA_STORAGE_UUID;
Jerome Forissiere3854162016-08-12 12:40:12 +020089const TEEC_UUID storage2_ta_uuid = TA_STORAGE2_UUID;
Pascal Brandc639ac82015-07-02 08:53:34 +020090const TEEC_UUID enc_fs_key_manager_test_ta_uuid = ENC_FS_KEY_MANAGER_TEST_UUID;
Jens Wiklanderac27ec12015-07-15 15:23:14 +020091const TEEC_UUID concurrent_ta_uuid = TA_CONCURRENT_UUID;
Jens Wiklander70672972016-04-06 00:01:45 +020092const TEEC_UUID concurrent_large_ta_uuid = TA_CONCURRENT_LARGE_UUID;
James Kungdf1e6cf2015-09-14 22:42:24 +080093const TEEC_UUID storage_benchmark_ta_uuid = TA_STORAGE_BENCHMARK_UUID;
Jerome Forissiere3688342015-09-24 10:45:17 -070094#ifdef WITH_GP_TESTS
Pascal Brand8a74e362015-09-10 12:41:52 +020095const TEEC_UUID gp_tta_ds_uuid = TA_TTA_DS_UUID;
96#endif