• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-2022 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("//base/security/device_auth/services/key_agree_sdk/key_agree_sdk.gni")
17import("//build/test.gni")
18
19module_output_path = "device_auth/deviceauth_test"
20
21ohos_unittest("deviceauth_llt") {
22  module_out_path = module_output_path
23
24  include_dirs = inc_path
25  include_dirs += hals_inc_path
26
27  include_dirs += [
28    "./include",
29    "${dev_frameworks_path}/inc/hiview_adapter",
30  ]
31
32  include_dirs += [
33    "//third_party/cJSON",
34    "//commonlibrary/c_utils/base/include",
35    "//third_party/openssl/include/",
36    "//base/security/huks/interfaces/innerkits/huks_standard/main/include",
37    "//third_party/mbedtls/include",
38    "//third_party/mbedtls/include/mbedtls",
39  ]
40
41  sources = hal_common_files
42  sources += [
43    "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c",
44    "${key_management_adapter_path}/impl/src/standard/huks_adapter.c",
45    "${key_management_adapter_path}/impl/src/standard/mbedtls_ec_adapter.c",
46    "${os_adapter_path}/impl/src/hc_log.c",
47    "${os_adapter_path}/impl/src/linux/hc_condition.c",
48    "${os_adapter_path}/impl/src/linux/hc_file.c",
49    "${os_adapter_path}/impl/src/linux/hc_init_protection.c",
50    "${os_adapter_path}/impl/src/linux/hc_thread.c",
51    "${os_adapter_path}/impl/src/linux/hc_types.c",
52    "source/hc_dev_info_mock.c",
53  ]
54
55  sources += dev_frameworks_files
56  sources += deviceauth_common_files
57  sources += database_manager_files
58  sources += broadcast_manager_files
59  sources += hiview_adapter_mock_files
60  sources += soft_bus_channel_mock_files
61
62  sources += group_auth_files
63  sources += group_auth_account_unrelated_files
64  sources += group_auth_account_related_files
65
66  sources += group_manager_files
67  sources += group_manager_peer_to_peer_files
68  sources += group_manager_identical_account_files
69  sources += group_manager_across_account_files
70
71  sources += authenticators_p2p_files
72  sources += authenticators_p2p_iso_files
73  sources += authenticators_p2p_pake_files
74  sources += authenticators_standard_exchange_task_files
75  sources += authenticators_account_related_files
76
77  sources -= [
78    "${authenticators_path}/src/account_unrelated/iso_task/iso_task_main.c",
79    "${authenticators_path}/src/account_unrelated/pake_task/pake_v1_task/pake_v1_task_main.c",
80  ]
81
82  sources += [
83    "source/deviceauth_standard_test.cpp",
84    "source/os_account_adapter_mock.c",
85    "source/protocol_task_main_mock.c",
86  ]
87  defines = [
88    "P2P_PAKE_DL_PRIME_LEN_384",
89    "P2P_PAKE_EC_TYPE",
90  ]
91
92  cflags = [
93    "-DHILOG_ENABLE",
94    "-DDEV_AUTH_DEBUG_PRINTF",
95  ]
96
97  deps = [
98    "//base/security/huks/interfaces/innerkits/huks_standard/main:libhukssdk",
99    "//third_party/cJSON:cjson",
100    "//third_party/googletest:gmock_main",
101    "//third_party/googletest:gtest_main",
102    "//third_party/mbedtls:mbedtls_shared",
103    "//third_party/openssl:libcrypto_static",
104  ]
105
106  external_deps = [
107    "c_utils:utils",
108    "hiviewdfx_hilog_native:libhilog",
109  ]
110}
111
112ohos_unittest("key_agree_sdk_llt") {
113  module_out_path = module_output_path
114
115  include_dirs = hals_inc_path + key_agree_inc_path
116  include_dirs += [ "./include" ]
117
118  sources = key_agree_sdk_file
119  sources += key_agree_deviceauth_common_files
120  sources += key_agree_hal_common_files
121  sources += [ "source/key_agree_sdk_test.cpp" ]
122
123  cflags = [ "-DHILOG_ENABLE" ]
124  if (target_cpu == "arm") {
125    cflags += [ "-DBINDER_IPC_32BIT" ]
126  }
127
128  deps = [
129    "${deps_adapter_path}:${hal_module_name}",
130    "//third_party/bounds_checking_function:libsec_shared",
131    "//third_party/cJSON:cjson_static",
132  ]
133
134  defines = [ "HILOG_ENABLE" ]
135  defines += key_agree_defines
136
137  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
138}
139