1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef __PERSRV_API_IMP_H__ 13 #define __PERSRV_API_IMP_H__ 14 15 #include "permission_service.h" 16 17 #define HASH_FILE_MAX_SIZE (64 * 1024) 18 #define PERMSRV_FILE_OPT "permsrv_file_operation" 19 20 int perm_srv_msg_call(const char *path, perm_srv_req_msg_t *msg, perm_srv_reply_msg_t *rsp); 21 22 void tee_perm_init_msg(perm_srv_req_msg_t *req_msg, perm_srv_reply_msg_t *reply_msg); 23 24 TEE_Result rslot_file_msg_call(perm_srv_req_msg_t *req_msg, perm_srv_reply_msg_t *reply_msg); 25 26 void permsrv_registerta(const TEE_UUID *uuid, uint32_t task_id, uint32_t user_id, uint32_t opt_type); 27 28 TEE_Result tee_cert_import(const uint8_t *cert_buf, uint32_t cert_size, const uint8_t *pub_key, uint32_t pub_key_size); 29 30 void permsrv_notify_unload_ta(const TEE_UUID *uuid); 31 32 void permsrv_load_file(void); 33 34 TEE_Result permsrv_elf_verify(const void *verify_req, uint32_t len); 35 36 TEE_Result tee_crl_cert_process(const char *crl_cert, uint32_t crl_cert_size); 37 38 #endif /* __PERSRV_API_IMP_H__ */ 39