• 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 += hal_common_files
47  sources += hiview_adapter_files
48  sources += identity_manager_files
49  sources -= soft_bus_channel_files
50  sources += soft_bus_channel_mock_files
51  if (support_os_account) {
52    sources += account_subscriber_files
53    sources += sa_subscriber_files
54    sources += net_observer_files
55  }
56  sources += [
57    "${key_management_adapter_path}/impl/src/common/mbedtls_ec_adapter.c",
58    "${key_management_adapter_path}/impl/src/huks_adapter.c",
59    "${key_management_adapter_path}/impl/src/huks_adapter_utils.c",
60    "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c",
61    "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c",
62    "${os_adapter_path}/impl/src/hc_log.c",
63    "${os_adapter_path}/impl/src/linux/hc_condition.c",
64    "${os_adapter_path}/impl/src/linux/hc_file.c",
65    "${os_adapter_path}/impl/src/linux/hc_init_protection.c",
66    "${os_adapter_path}/impl/src/linux/hc_thread.c",
67    "${os_adapter_path}/impl/src/linux/hc_types.c",
68    "${tdd_framework_path}/common/src/hc_dev_info_mock.c",
69  ]
70  defines = [
71    "DEV_AUTH_FUZZ_TEST",
72    "DEV_AUTH_HIVIEW_ENABLE",
73  ]
74  cflags = [ "-DHILOG_ENABLE" ]
75  cflags += [
76    "-DDEV_AUTH_WORK_THREAD_STACK_SIZE=${device_auth_hichain_thread_stack_size}",
77    "-DMAX_AUTH_SESSION_COUNT=${max_auth_session_count}",
78  ]
79
80  deps = []
81
82  external_deps = [
83    "cJSON:cjson",
84    "c_utils:utils",
85    "dsoftbus:softbus_client",
86    "hilog:libhilog",
87    "hisysevent:libhisysevent",
88    "hitrace:hitrace_meter",
89    "huks:libhukssdk",
90    "mbedtls:mbedtls_shared",
91    "openssl:libcrypto_static",
92  ]
93  if (support_os_account) {
94    external_deps += [
95      "ability_base:want",
96      "common_event_service:cesfwk_innerkits",
97      "ipc:ipc_single",
98      "json:nlohmann_json_static",
99      "netmanager_base:net_conn_manager_if",
100      "os_account:os_account_innerkits",
101      "samgr:samgr_proxy",
102    ]
103  }
104}
105
106###############################################################################
107group("fuzztest") {
108  testonly = true
109  deps = []
110  deps += [
111    # deps file
112    ":GroupOperationCommonFuzzTest",
113  ]
114}
115###############################################################################
116