1 /*
2  * Copyright (C) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "attest_type.h"
17 #include "attest_utils_log.h"
18 #include "attest_utils_timer.h"
19 #include "attest_service.h"
20 #include "attest_entry.h"
21 
22 static ATTEST_TIMER_ID g_ProcAttestTimerId = NULL;
23 
AttestTask(void)24 int32_t AttestTask(void)
25 {
26     ATTEST_LOG_INFO("[AttestTask] Begin.");
27     // 执行主流程代码
28     int32_t ret = ProcAttest();
29     if (ret != ATTEST_OK) {
30         ATTEST_LOG_ERROR("[AttestTask] Proc failed ret = %d.", ret);
31     }
32     ATTEST_LOG_INFO("[AttestTask] End.");
33     return ret;
34 }
35 
QueryAttest(int32_t** resultArray, int32_t arraySize, char** ticket, int32_t* ticketLength)36 int32_t QueryAttest(int32_t** resultArray, int32_t arraySize, char** ticket, int32_t* ticketLength)
37 {
38     return QueryAttestStatus(resultArray, arraySize, ticket, ticketLength);
39 }
40 
AttestWaitTaskOver(void)41 int32_t AttestWaitTaskOver(void)
42 {
43     return AttestWaitTaskOverImpl();
44 }
45 
AttestCreateTimerTask(void)46 int32_t AttestCreateTimerTask(void)
47 {
48     return 0;
49 }
50 
AttestDestroyTimerTask(void)51 int32_t AttestDestroyTimerTask(void)
52 {
53     return AttestStopTimerTask(g_ProcAttestTimerId);
54 }
55