• 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")
16import("../../../unittest/tdd_framework/tdd_framework.gni")
17
18#####################hydra-fuzz###################
19import("//build/config/features.gni")
20import("//build/ohos.gni")
21import("//build/test.gni")
22module_output_path = "device_auth/device_auth"
23
24##############################fuzztest##########################################
25ohos_fuzztest("GroupOperationCommonFuzzTest") {
26  module_out_path = module_output_path
27  fuzz_config_file = "${deviceauth_path}/test/fuzztest/group_manage/groupoperationcommon_fuzzer"
28  include_dirs = inc_path + hals_inc_path
29  include_dirs += [
30    ".",
31    "${inner_api_path}",
32    "${frameworks_path}/inc/standard",
33    "${tdd_framework_path}/common/inc",
34    "${dev_frameworks_path}/inc/permission_adapter",
35    "${dev_frameworks_path}/inc/hiview_adapter",
36  ]
37  include_dirs += identity_manager_inc
38  if (support_os_account) {
39    include_dirs += [ "${dev_frameworks_path}/inc/account_subscriber" ]
40    include_dirs += [ "${dev_frameworks_path}/inc/sa_subscriber" ]
41    include_dirs += [ "${dev_frameworks_path}/inc/net_observer" ]
42  }
43  sources = [ "groupoperationcommon_fuzzer.cpp" ]
44  sources += identity_service_mock_files
45  sources += deviceauth_files
46  sources += sa_load_on_demand_mock_files
47  sources += hal_common_files
48  sources += hiview_adapter_files
49  sources += identity_manager_files
50  sources -= soft_bus_channel_files
51  sources += soft_bus_channel_mock_files
52  if (support_os_account) {
53    sources += account_subscriber_files
54    sources += sa_subscriber_files
55    sources += net_observer_files
56  }
57  sources += [
58    "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c",
59    "${key_management_adapter_path}/impl/src/huks_adapter.c",
60    "${key_management_adapter_path}/impl/src/huks_adapter_utils.c",
61    "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c",
62    "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c",
63    "${os_adapter_path}/impl/src/hc_log.c",
64    "${os_adapter_path}/impl/src/linux/hc_condition.c",
65    "${os_adapter_path}/impl/src/linux/hc_file.c",
66    "${os_adapter_path}/impl/src/linux/hc_init_protection.c",
67    "${os_adapter_path}/impl/src/linux/hc_thread.c",
68    "${os_adapter_path}/impl/src/linux/hc_types.c",
69    "${tdd_framework_path}/common/src/hc_dev_info_mock.c",
70  ]
71  defines = [
72    "DEV_AUTH_FUZZ_TEST",
73    "DEV_AUTH_HIVIEW_ENABLE",
74  ]
75  cflags = [ "-DHILOG_ENABLE" ]
76  cflags += [
77    "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}",
78    "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}",
79  ]
80
81  deps = []
82
83  external_deps = [
84    "cJSON:cjson",
85    "c_utils:utils",
86    "dsoftbus:softbus_client",
87    "hilog:libhilog",
88    "hisysevent:libhisysevent",
89    "hitrace:hitrace_meter",
90    "huks:libhukssdk",
91    "mbedtls:mbedtls_shared",
92    "openssl:libcrypto_static",
93  ]
94  if (support_os_account) {
95    external_deps += [
96      "ability_base:want",
97      "common_event_service:cesfwk_innerkits",
98      "ipc:ipc_single",
99      "json:nlohmann_json_static",
100      "netmanager_base:net_conn_manager_if",
101      "os_account:os_account_innerkits",
102      "samgr:samgr_proxy",
103    ]
104  }
105}
106
107###############################################################################
108group("fuzztest") {
109  testonly = true
110  deps = []
111  deps += [
112    # deps file
113    ":GroupOperationCommonFuzzTest",
114  ]
115}
116###############################################################################
117