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("../../dsoftbus.gni") 15import("../common/dfx/dsoftbus_dfx.gni") 16device_profile_common_path = 17 "//foundation/deviceprofile/device_info_manager/common" 18device_profile_interfaces_path = 19 "//foundation/deviceprofile/device_info_manager/interfaces" 20AUTH_SERVER_DEFINES = [] 21if (dsoftbus_feature_auth_account == true) { 22 AUTH_SERVER_DEFINES += [ "AUTH_ACCOUNT" ] 23} 24 25authentication_path = "$dsoftbus_root_path/core/authentication" 26native_source_path = rebase_path("$dsoftbus_root_path") 27auth_dir = "dsoftbus_enhance/core/authentication/" 28enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py", 29 [ 30 "$native_source_path", 31 "$auth_dir", 32 ], 33 "value") 34 35auth_server_inc = [ 36 "$dsoftbus_root_path/core/authentication/include", 37 "$dsoftbus_root_path/core/authentication/interface", 38 "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include", 39 "$dsoftbus_root_path/core/common/dfx/interface/include", 40 "$dsoftbus_root_path/core/adapter/authentication/include", 41 "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", 42 "$dsoftbus_root_path/core/adapter/bus_center/include", 43 "$dsoftbus_root_path/core/bus_center/utils/include/", 44] 45if (dsoftbus_feature_lnn_net) { 46 auth_server_src = [ 47 "$authentication_path/src/auth_common.c", 48 "$authentication_path/src/auth_connection.c", 49 "$authentication_path/src/auth_hichain.c", 50 "$authentication_path/src/auth_hichain_adapter.c", 51 "$authentication_path/src/auth_manager.c", 52 "$authentication_path/src/auth_request.c", 53 "$authentication_path/src/auth_session_fsm.c", 54 "$authentication_path/src/auth_session_key.c", 55 "$authentication_path/src/auth_session_message.c", 56 "$authentication_path/src/auth_interface.c", 57 ] 58 if (enhanced) { 59 auth_server_src += [ 60 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_device_common_key.c", 61 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_meta_manager.c", 62 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_instance.c", 63 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_key.c", 64 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_manager.c", 65 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_message.c", 66 ] 67 auth_server_inc += [ 68 "$dsoftbus_root_path/adapter/common/include/", 69 "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/include/", 70 ] 71 } else { 72 auth_server_src += [ 73 "$authentication_path/src/virtual/auth_device_common_key_virtual.c", 74 "$authentication_path/src/virtual/auth_meta_manager_virtual.c", 75 "$authentication_path/src/virtual/customized_security_protocol_virtual.c", 76 ] 77 } 78 if (dsoftbus_feature_ip_auth) { 79 auth_server_src += 80 [ "$dsoftbus_root_path/core/authentication/src/auth_tcp_connection.c" ] 81 } else { 82 auth_server_src += [ "$dsoftbus_root_path/core/authentication/src/virtual/auth_tcp_connection_virtual.c" ] 83 } 84} else { 85 auth_server_src = [ 86 "$authentication_path/src/virtual/auth_interface_virtual.c", 87 "$authentication_path/src/virtual/auth_tcp_connection_virtual.c", 88 "$authentication_path/src/virtual/auth_meta_manager_virtual.c", 89 ] 90} 91auth_server_deps = [ 92 "$dsoftbus_dfx_path/anonymize:softbus_dfx_anonymizer", 93 "$dsoftbus_dfx_path/log:softbus_dfx_log", 94] 95 96if (defined(ohos_lite)) { 97 if (ohos_kernel_type == "liteos_m") { 98 auth_server_inc += [ "//base/security/device_auth/interfaces/inner_api" ] 99 if (dsoftbus_feature_lnn_net) { 100 auth_server_deps += [ "//base/security/device_auth/services:deviceauth" ] 101 } 102 } else { 103 auth_server_inc += [ "//third_party/cJSON" ] 104 if (dsoftbus_feature_lnn_net) { 105 auth_server_deps += 106 [ "//base/security/device_auth/services:deviceauth_sdk" ] 107 } 108 } 109 auth_server_src += [ "$authentication_path/src/virtual/auth_hichain_system_ability_monitor_virtual.c" ] 110} else { 111 auth_server_inc += [ 112 "//base/security/device_auth/interfaces/inner_api", 113 "${device_profile_interfaces_path}/innerkits/core/include", 114 "${device_profile_common_path}/include/interfaces/", 115 "${device_profile_common_path}/include/constants", 116 "${device_profile_common_path}include/utils", 117 ] 118 auth_server_src += 119 [ "$authentication_path/src/auth_hichain_system_ability_monitor.cpp" ] 120} 121 122if (!defined(global_parts_info) || 123 defined(global_parts_info.deviceprofile_device_info_manager)) { 124 auth_server_src += [ 125 "$authentication_path/bind/auth_device_profile_listener.cpp", 126 "$authentication_path/src/auth_deviceprofile.cpp", 127 ] 128} else { 129 auth_server_src += [ 130 "$authentication_path/bind/auth_device_profile_listener_virtual.cpp", 131 "$authentication_path/src/auth_deviceprofile_virtual.cpp", 132 ] 133} 134