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("//base/security/device_auth/deps_adapter/deviceauth_hals.gni") 15import("//base/security/device_auth/services/deviceauth.gni") 16 17#####################hydra-fuzz################### 18import("//build/config/features.gni") 19import("//build/ohos.gni") 20import("//build/test.gni") 21module_output_path = "device_auth/fuzztest" 22 23##############################fuzztest########################################## 24ohos_fuzztest("DevAuthFuzzTest") { 25 module_out_path = module_output_path 26 fuzz_config_file = "${deviceauth_path}/test/fuzztest/devauth_fuzzer" 27 include_dirs = inc_path + hals_inc_path 28 include_dirs += [ 29 ".", 30 "//third_party/cJSON", 31 "${frameworks_path}/inc/standard", 32 "${dev_frameworks_path}/inc/hiview_adapter", 33 "${dev_frameworks_path}/inc/permission_adapter", 34 ] 35 sources = [ "devauth_fuzzer.cpp" ] 36 sources += deviceauth_ipc_files 37 sources += permission_adapter_files 38 sources += [ "${frameworks_path}/src/ipc_service.c" ] 39 defines = [ "HILOG_ENABLE" ] 40 defines += [ "DEV_AUTH_HIVIEW_ENABLE" ] 41 defines += [ "DEV_AUTH_FUZZ_TEST" ] 42 cflags = [ 43 "-g", 44 "-O0", 45 "-Wno-unused-variable", 46 "-fno-omit-frame-pointer", 47 "-DHILOG_ENABLE", 48 ] 49 cflags += build_flags 50 if (target_cpu == "arm") { 51 cflags += [ "-DBINDER_IPC_32BIT" ] 52 } 53 deps = [ 54 "${deps_adapter_path}:${hal_module_name}", 55 "${services_path}:deviceauth", 56 "//third_party/cJSON:cjson", 57 ] 58 external_deps = [ 59 "access_token:libaccesstoken_sdk", 60 "access_token:libnativetoken", 61 "access_token:libtoken_setproc", 62 "c_utils:utils", 63 "hilog:libhilog", 64 "hisysevent:libhisysevent", 65 "hitrace:hitrace_meter", 66 "init:libbegetutil", 67 "ipc:ipc_core", 68 "samgr:samgr_proxy", 69 ] 70} 71 72############################################################################### 73group("fuzztest") { 74 testonly = true 75 deps = [] 76 deps += [ 77 # deps file 78 ":DevAuthFuzzTest", 79 ] 80} 81############################################################################### 82