blob: 8fae19be46410d996a3e5b1b3ace0f924bd5cb92 [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>
22#include <enc_fs_key_manager_test.h>
23#include <tee_api_defines.h>
24
25ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_Result)
26ADBG_ENUM_TABLE_ENTRY(TEEC_SUCCESS),
27ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT),
28ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_CORRUPT_OBJECT_2),
29ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE),
30ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NOT_AVAILABLE_2),
31ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_GENERIC),
32ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_DENIED),
33ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_CANCEL),
34ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ACCESS_CONFLICT),
35ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXCESS_DATA),
36ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_FORMAT),
37ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_PARAMETERS),
38ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BAD_STATE),
39ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_ITEM_NOT_FOUND),
40ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_IMPLEMENTED),
41ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NOT_SUPPORTED),
42ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_NO_DATA),
43ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_OUT_OF_MEMORY),
44ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_BUSY),
45ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_COMMUNICATION),
46ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SECURITY),
47ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_SHORT_BUFFER),
48ADBG_ENUM_TABLE_ENTRY(TEEC_ERROR_EXTERNAL_CANCEL),
49ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_OVERFLOW),
50ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TARGET_DEAD),
51ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_STORAGE_NO_SPACE),
52ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_MAC_INVALID),
53ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_SIGNATURE_INVALID),
54ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NOT_SET),
55ADBG_ENUM_TABLE_ENTRY(TEE_ERROR_TIME_NEEDS_RESET)
56ADBG_ENUM_TABLE_DEFINE_END(TEEC_Result);
57
58ADBG_ENUM_TABLE_DEFINE_BEGIN(TEEC_ErrorOrigin)
59ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_API),
60ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_COMMS),
61ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TEE),
62ADBG_ENUM_TABLE_ENTRY(TEEC_ORIGIN_TRUSTED_APP)
63ADBG_ENUM_TABLE_DEFINE_END(TEEC_ErrorOrigin);
64
65#define ECC_SELF_TEST_UUID \
66 { 0xf34f4f3c, 0xab30, 0x4573, \
67 { 0x91, 0xBF, 0x3C, 0x57, 0x02, 0x4D, 0x51, 0x99 } }
68
69const TEEC_UUID crypt_user_ta_uuid = TA_CRYPT_UUID;
70const TEEC_UUID os_test_ta_uuid = TA_OS_TEST_UUID;
71const TEEC_UUID create_fail_test_ta_uuid = TA_CREATE_FAIL_TEST_UUID;
72const TEEC_UUID ecc_test_ta_uuid = ECC_SELF_TEST_UUID;
73const TEEC_UUID rpc_test_ta_uuid = TA_RPC_TEST_UUID;
74const TEEC_UUID sims_test_ta_uuid = TA_SIMS_TEST_UUID;
75const TEEC_UUID storage_ta_uuid = TA_STORAGE_UUID;
76const TEEC_UUID enc_fs_key_manager_test_ta_uuid = ENC_FS_KEY_MANAGER_TEST_UUID;
77