1 // SPDX-License-Identifier: BSD-2-Clause
2 /*
3 * Copyright (c) 2021, Huawei Technologies Co., Ltd
4 */
5 #include <pta_attestation.h>
6 #include <ta_os_test.h>
7 #include <tee_internal_api.h>
8
9 #include "os_test.h"
10
ta_entry_attestation(uint32_t param_types,TEE_Param params[4])11 TEE_Result ta_entry_attestation(uint32_t param_types, TEE_Param params[4])
12 {
13 TEE_TASessionHandle sess = TEE_HANDLE_NULL;
14 TEE_UUID att_uuid = PTA_ATTESTATION_UUID;
15 TEE_Result res = TEE_ERROR_GENERIC;
16 uint32_t ret_orig = 0;
17
18 res = TEE_OpenTASession(&att_uuid, TEE_TIMEOUT_INFINITE, 0, NULL, &sess,
19 &ret_orig);
20 if (res)
21 goto out;
22 res = TEE_InvokeTACommand(sess, TEE_TIMEOUT_INFINITE,
23 PTA_ATTESTATION_HASH_TA_MEMORY, param_types,
24 params, &ret_orig);
25 out:
26 TEE_CloseTASession(sess);
27 return res;
28 }
29