• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/device_auth"
22
23##############################fuzztest##########################################
24ohos_fuzztest("ECSpekeFuzzTest") {
25  module_out_path = module_output_path
26  fuzz_config_file = "${deviceauth_path}/test/fuzztest/protocol/ecspeke_fuzzer"
27  include_dirs = inc_path + hals_inc_path
28  include_dirs += [
29    ".",
30    "${inner_api_path}",
31    "${frameworks_path}/inc/standard",
32    "${dev_frameworks_path}/inc/hiview_adapter",
33    "${dev_frameworks_path}/inc/permission_adapter",
34    "${dev_frameworks_path}/inc",
35    "${session_manager_path}/inc/session/v2/auth_sub_session/protocol_lib",
36    "${frameworks_path}/sdk/sa_load_on_demand/inc",
37  ]
38  sources = [ "ecspeke_fuzzer.cpp" ]
39  sources += deviceauth_ipc_files
40  sources += permission_adapter_files
41  sources += sa_load_on_demand_mock_files
42  sources += sdk_load_on_demand_mock_files
43  sources += hiview_adapter_files
44
45  defines = [ "ENABLE_EC_SPEKE" ]
46  defines += [ "HILOG_ENABLE" ]
47  defines += [ "DEV_AUTH_HIVIEW_ENABLE" ]
48  defines += [ "DEV_AUTH_FUZZ_TEST" ]
49  cflags = [
50    "-g",
51    "-O0",
52    "-Wno-unused-variable",
53    "-fno-omit-frame-pointer",
54    "-DHILOG_ENABLE",
55  ]
56  cflags += build_flags
57  if (target_cpu == "arm") {
58    cflags += [ "-DBINDER_IPC_32BIT" ]
59  }
60  deps = [ "${deps_adapter_path}:${hal_module_test_name}" ]
61  external_deps = [
62    "access_token:libaccesstoken_sdk",
63    "access_token:libnativetoken",
64    "access_token:libtoken_setproc",
65    "cJSON:cjson",
66    "c_utils:utils",
67    "hilog:libhilog",
68    "hisysevent:libhisysevent",
69    "hitrace:hitrace_meter",
70    "huks:libhukssdk",
71    "init:libbegetutil",
72    "ipc:ipc_core",
73    "samgr:samgr_proxy",
74  ]
75}
76
77###############################################################################
78group("fuzztest") {
79  testonly = true
80  deps = []
81  deps += [
82    # deps file
83    ":ECSpekeFuzzTest",
84  ]
85}
86###############################################################################
87