# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("../../dsoftbus.gni") import("../common/dfx/dsoftbus_dfx.gni") AUTH_SERVER_DEFINES = [] if (dsoftbus_feature_auth_account == true) { AUTH_SERVER_DEFINES += [ "AUTH_ACCOUNT" ] } authentication_path = "$dsoftbus_root_path/core/authentication" native_source_path = rebase_path("$dsoftbus_root_path") auth_dir = "dsoftbus_enhance/core/authentication/" enhanced = exec_script("$dsoftbus_root_path/check_sub_module.py", [ "$native_source_path", "$auth_dir", ], "value") auth_server_inc = [ "$dsoftbus_root_path/core/authentication/include", "$dsoftbus_root_path/core/authentication/interface", "$dsoftbus_root_path/core/common/dfx/hisysevent_adapter/include", "$dsoftbus_root_path/core/common/dfx/interface/include", "$dsoftbus_root_path/core/adapter/authentication/include", "$dsoftbus_root_path/core/bus_center/lnn/lane_hub/heartbeat/include", "$dsoftbus_root_path/core/bus_center/lnn/net_ledger/distributed_ledger/include", "$dsoftbus_root_path/core/adapter/bus_center/include", "$dsoftbus_root_path/core/bus_center/utils/include/", ] if (dsoftbus_feature_lnn_net) { auth_server_src = [ "$authentication_path/src/auth_common.c", "$authentication_path/src/auth_connection.c", "$authentication_path/src/auth_device.c", "$authentication_path/src/auth_hichain.c", "$authentication_path/src/auth_hichain_adapter.c", "$authentication_path/src/auth_lane.c", "$authentication_path/src/auth_manager.c", "$authentication_path/src/auth_normalize_request.c", "$authentication_path/src/auth_request.c", "$authentication_path/src/auth_session_fsm.c", "$authentication_path/src/auth_session_key.c", "$authentication_path/src/auth_session_json.c", "$authentication_path/src/auth_session_message.c", "$authentication_path/src/auth_interface.c", ] if (enhanced) { auth_server_src += [ "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_device_common_key.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_meta_manager.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_meta_ptk_proc.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_instance.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_key.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_manager.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_message_hml.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_message.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/src/ccmp_utils.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_generate_attest.c", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/auth_validate_attest.c", ] auth_server_inc += [ "$dsoftbus_root_path/adapter/common/include/", "$dsoftbus_root_path/core/adapter/huks/include/", "$dsoftbus_root_path/dsoftbus_enhance/core/authentication/ccmp/include/", ] } else { auth_server_src += [ "$authentication_path/src/virtual/auth_attest_virtual.c", "$authentication_path/src/virtual/auth_device_common_key_virtual.c", "$authentication_path/src/virtual/auth_meta_manager_virtual.c", "$authentication_path/src/virtual/customized_security_protocol_virtual.c", "$authentication_path/src/virtual/auth_meta_ptk_proc_virtual.c", ] } if (dsoftbus_feature_ip_auth) { auth_server_src += [ "$dsoftbus_root_path/core/authentication/src/auth_tcp_connection.c" ] } else { auth_server_src += [ "$dsoftbus_root_path/core/authentication/src/virtual/auth_tcp_connection_virtual.c" ] } } else { auth_server_src = [ "$authentication_path/src/virtual/auth_interface_virtual.c", "$authentication_path/src/virtual/auth_tcp_connection_virtual.c", "$authentication_path/src/virtual/auth_meta_manager_virtual.c", "$authentication_path/src/virtual/auth_meta_ptk_proc_virtual.c", ] } auth_server_deps = [ "$dsoftbus_dfx_path/anonymize:softbus_dfx_anonymizer", "$dsoftbus_dfx_path/log:softbus_dfx_log", ] auth_server_ex_deps = [] if (defined(ohos_lite)) { if (ohos_kernel_type == "liteos_m") { auth_server_inc += [ "//base/security/device_auth/interfaces/inner_api" ] if (dsoftbus_feature_lnn_net) { auth_server_deps += [ "//base/security/device_auth/services:deviceauth" ] } } else { auth_server_inc += [ "//third_party/cJSON" ] if (dsoftbus_feature_lnn_net) { auth_server_deps += [ "//base/security/device_auth/services:deviceauth_sdk" ] } } auth_server_src += [ "$authentication_path/src/virtual/auth_hichain_system_ability_monitor_virtual.c" ] } else { auth_server_ex_deps += [ "device_auth:deviceauth_sdk" ] auth_server_src += [ "$authentication_path/src/auth_hichain_system_ability_monitor.cpp" ] } if (!defined(global_parts_info) || defined(global_parts_info.deviceprofile_device_info_manager)) { auth_server_src += [ "$authentication_path/bind/auth_device_profile_listener.cpp", "$authentication_path/src/auth_deviceprofile.cpp", ] } else { auth_server_src += [ "$authentication_path/bind/auth_device_profile_listener_virtual.cpp", "$authentication_path/src/auth_deviceprofile_virtual.cpp", ] }