• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 __SSA_ENUMERATOR
13 #define __SSA_ENUMERATOR
14 
15 #include "tee_ss_agent_api.h"
16 
17 #define ENUM_FILE_NAME_PREFIX     "enum_file_"
18 /* "enum_file_" and "sec_storage_data/" */
19 #define ENUM_FILE_NAME_PREFIX_LEN 27
20 #define UUID_SIZE                 16
21 /* add '-' num */
22 #define UUID_STR_LEN              (UUID_SIZE + 4)
23 #define ENUM_FILE_NAME_LEN        (ENUM_FILE_NAME_PREFIX_LEN + UUID_STR_LEN + 1)
24 
25 enum operation_flag {
26     ENUM_INVALID_OPER = 0,
27     ENUM_CREATE       = 1,
28     ENUM_OPEN         = 2,
29 };
30 
31 TEE_Result add_objinfo_into_enum_file(const struct create_obj_msg_t *create_obj, uint32_t data_size, uint32_t sndr);
32 TEE_Result update_objinfo_in_enum_file(const uint8_t *object_id, uint32_t object_id_len,
33                                        uint32_t new_size, uint32_t new_pos, uint32_t sndr);
34 TEE_Result rename_obj_in_enum_file(const uint8_t *origin_obj_id, const uint8_t *new_obj_id, uint32_t new_obj_id_len,
35                                    uint32_t sndr);
36 TEE_Result delete_obj_in_enum_file(const uint8_t *object_id, uint32_t object_id_len, uint32_t sndr);
37 void ssa_get_enum_file_size(union ssa_agent_msg *msg, uint32_t sndr, struct ssa_agent_rsp *rsp);
38 void ssa_start_enumerator(union ssa_agent_msg *msg, uint32_t sndr, struct ssa_agent_rsp *rsp);
39 #endif
40