1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/config/features.gni") 15import("//build/test.gni") 16import("../../../../access_token.gni") 17 18module_output_path = "access_token/access_token_stub" 19 20ohos_fuzztest("AllocHapTokenStubFuzzTest") { 21 module_out_path = module_output_path 22 fuzz_config_file = "." 23 24 sources = [ "allochaptokenstub_fuzzer.cpp" ] 25 26 cflags = [ 27 "-g", 28 "-O0", 29 "-Wno-unused-variable", 30 "-fno-omit-frame-pointer", 31 ] 32 33 include_dirs = [ 34 "${access_token_path}/frameworks/accesstoken/include", 35 "${access_token_path}/services/accesstokenmanager/main/cpp/include", 36 ] 37 38 deps = [ 39 "${access_token_path}/interfaces/innerkits/accesstoken:libaccesstoken_sdk", 40 ] 41 42 configs = [ "${access_token_path}/config:coverage_flags" ] 43 44 external_deps = [ 45 "c_utils:utils", 46 "hilog:libhilog", 47 "ipc:ipc_core", 48 "safwk:system_ability_fwk", 49 ] 50 51 include_dirs += [ 52 "${access_token_path}/services/accesstokenmanager/main/cpp/include/callback", 53 "${access_token_path}/services/accesstokenmanager/main/cpp/include/service", 54 "${access_token_path}/services/accesstokenmanager/main/cpp/include/token", 55 "${access_token_path}/services/accesstokenmanager/main/cpp/include/permission", 56 "${access_token_path}/services/accesstokenmanager/main/cpp/include/database", 57 "${access_token_path}/frameworks/common/include", 58 "${access_token_path}/frameworks/accesstoken/include", 59 "${access_token_path}/interfaces/innerkits/privacy/include", 60 "${access_token_path}/interfaces/innerkits/tokensync/src", 61 "${access_token_path}/services/common/database/include", 62 "//third_party/sqlite/include/", 63 ] 64 65 include_dirs += access_token_impl_include_dirs 66 67 cflags_cc = [ "-DHILOG_ENABLE" ] 68 69 sources += [ 70 "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/callback_manager.cpp", 71 "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/perm_state_callback_death_recipient.cpp", 72 "${access_token_path}/services/accesstokenmanager/main/cpp/src/callback/permission_state_change_callback_proxy.cpp", 73 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_storage.cpp", 74 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/data_translator.cpp", 75 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/sqlite_storage.cpp", 76 "${access_token_path}/services/accesstokenmanager/main/cpp/src/database/token_field_const.cpp", 77 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_definition_cache.cpp", 78 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_grant_event.cpp", 79 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_manager.cpp", 80 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_policy_set.cpp", 81 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/permission_validator.cpp", 82 "${access_token_path}/services/accesstokenmanager/main/cpp/src/service/accesstoken_manager_service.cpp", 83 "${access_token_path}/services/accesstokenmanager/main/cpp/src/service/accesstoken_manager_stub.cpp", 84 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/accesstoken_id_manager.cpp", 85 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/accesstoken_info_manager.cpp", 86 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/hap_token_info_inner.cpp", 87 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/native_token_info_inner.cpp", 88 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/native_token_receptor.cpp", 89 ] 90 91 sources += access_token_impl_sources 92 93 if (dlp_permission_enable == true) { 94 cflags_cc += [ "-DSUPPORT_SANDBOX_APP" ] 95 sources += [ 96 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/dlp_permission_set_manager.cpp", 97 "${access_token_path}/services/accesstokenmanager/main/cpp/src/permission/dlp_permission_set_parser.cpp", 98 ] 99 } 100 101 deps += [ 102 "${access_token_path}/frameworks/accesstoken:accesstoken_communication_adapter_cxx", 103 "${access_token_path}/frameworks/common:accesstoken_common_cxx", 104 "${access_token_path}/interfaces/innerkits/accesstoken:libtokenid_sdk", 105 "${access_token_path}/interfaces/innerkits/privacy:libprivacy_sdk", 106 "${access_token_path}/services/accesstokenmanager:access_token.rc", 107 "${access_token_path}/services/common/database:accesstoken_database_cxx", 108 ] 109 110 deps += [ "${access_token_path}/services/accesstokenmanager/etc:param_files" ] 111 112 external_deps += [ 113 "c_utils:utils", 114 "dsoftbus:softbus_client", 115 "hilog:libhilog", 116 "hisysevent:libhisysevent", 117 "hitrace:hitrace_meter", 118 "init:libbegetutil", 119 "ipc:ipc_core", 120 "safwk:system_ability_fwk", 121 ] 122 123 if (hicollie_enable == true) { 124 external_deps += [ "hicollie:libhicollie" ] 125 cflags_cc += [ "-DHICOLLIE_ENABLE" ] 126 } 127 128 if (token_sync_enable == true) { 129 cflags_cc += [ "-DTOKEN_SYNC_ENABLE" ] 130 131 sources += [ 132 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/accesstoken_remote_token_manager.cpp", 133 "${access_token_path}/services/accesstokenmanager/main/cpp/src/token/token_modify_notifier.cpp", 134 ] 135 136 include_dirs += 137 [ "${access_token_path}/interfaces/innerkits/tokensync/include" ] 138 139 deps += [ 140 "${access_token_path}/interfaces/innerkits/tokensync:libtokensync_sdk", 141 ] 142 } 143} 144