• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//foundation/communication/dsoftbus/dsoftbus.gni")
15AUTH_SERVER_DEFINES = []
16if (dsoftbus_feature_auth_account == true) {
17  AUTH_SERVER_DEFINES += [ "AUTH_ACCOUNT" ]
18}
19
20authentication_path = "$dsoftbus_root_path/core/authentication"
21native_source_path = rebase_path("$dsoftbus_root_path")
22auth_dir = "dsoftbus_enhance/core/authentication/src"
23enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py",
24                       [
25                         "$native_source_path",
26                         "$auth_dir",
27                       ],
28                       "value")
29
30if (dsoftbus_feature_lnn_net) {
31  auth_server_src = [
32    "$authentication_path/src/auth_common.c",
33    "$authentication_path/src/auth_connection.c",
34    "$authentication_path/src/auth_hichain.c",
35    "$authentication_path/src/auth_hichain_adapter.c",
36    "$authentication_path/src/auth_manager.c",
37    "$authentication_path/src/auth_request.c",
38    "$authentication_path/src/auth_session_fsm.c",
39    "$authentication_path/src/auth_session_key.c",
40    "$authentication_path/src/auth_session_message.c",
41    "$authentication_path/src/auth_interface.c",
42  ]
43  if (enhanced) {
44    auth_server_src += [
45      "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/src/auth_meta_manager.c",
46      "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/src/auth_device_common_key.c",
47    ]
48  } else {
49    auth_server_src += [
50      "$authentication_path/src/virtual/auth_meta_manager_virtual.c",
51      "$authentication_path/src/virtual/auth_device_common_key_virtual.c",
52    ]
53  }
54  if (dsoftbus_feature_ip_auth) {
55    auth_server_src +=
56        [ "$dsoftbus_root_path/core/authentication/src/auth_tcp_connection.c" ]
57  } else {
58    auth_server_src += [ "$dsoftbus_root_path/core/authentication/src/virtual/auth_tcp_connection_virtual.c" ]
59  }
60} else {
61  auth_server_src = [
62    "$authentication_path/src/virtual/auth_interface_virtual.c",
63    "$authentication_path/src/virtual/auth_tcp_connection_virtual.c",
64    "$authentication_path/src/virtual/auth_meta_manager_virtual.c",
65  ]
66}
67auth_server_inc = [
68  "$dsoftbus_root_path/core/authentication/include",
69  "$dsoftbus_root_path/core/authentication/interface",
70  "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include",
71  "$dsoftbus_root_path/core/adapter/authentication/include",
72  "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include",
73]
74auth_server_deps = []
75
76if (defined(ohos_lite)) {
77  if (ohos_kernel_type == "liteos_m") {
78    auth_server_inc += [ "//base/security/device_auth/interfaces/inner_api" ]
79    if (dsoftbus_feature_lnn_net) {
80      auth_server_deps += [ "//base/security/device_auth/services:deviceauth" ]
81    }
82  } else {
83    auth_server_inc += [ "//third_party/cJSON" ]
84    if (dsoftbus_feature_lnn_net) {
85      auth_server_deps +=
86          [ "//base/security/device_auth/services:deviceauth_sdk" ]
87    }
88  }
89} else {
90  auth_server_inc += [ "//base/security/device_auth/interfaces/inner_api" ]
91}
92