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("../tdd_framework.gni") 15 16ohos_static_library("device_auth_test_hal") { 17 subsystem_name = "security" 18 part_name = "device_auth" 19 include_dirs = hals_inc_path 20 include_dirs += [ 21 "//third_party/cJSON", 22 "//third_party/openssl/include/", 23 "//third_party/mbedtls/include", 24 "//third_party/mbedtls/include/mbedtls", 25 ] 26 include_dirs += [ 27 "exception_controller/inc", 28 "memory_mock/inc", 29 "memory_monitor/inc", 30 "dev_info_mock/inc", 31 ] 32 33 sources = hal_common_files 34 sources += [ 35 "${key_management_adapter_path}/impl/src/huks_adapter.c", 36 "${key_management_adapter_path}/impl/src/mbedtls_ec_adapter.c", 37 "${key_management_adapter_path}/impl/src/standard/crypto_hash_to_point.c", 38 "${key_management_adapter_path}/impl/src/standard/huks_adapter_diff_impl.c", 39 "${os_adapter_path}/impl/src/hc_log.c", 40 "${os_adapter_path}/impl/src/linux/hc_condition.c", 41 "${os_adapter_path}/impl/src/linux/hc_dev_info.c", 42 "${os_adapter_path}/impl/src/linux/hc_file.c", 43 "${os_adapter_path}/impl/src/linux/hc_init_protection.c", 44 "${os_adapter_path}/impl/src/linux/hc_thread.c", 45 "${os_adapter_path}/impl/src/linux/hc_types.c", 46 ] 47 sources -= [ 48 "${os_adapter_path}/impl/src/linux/hc_dev_info.c", 49 "${os_adapter_path}/impl/src/linux/hc_types.c", 50 ] 51 sources += [ 52 "dev_info_mock/src/dev_info_mock.c", 53 "exception_controller/src/exception_controller.c", 54 "memory_mock/src/memory_mock.c", 55 "memory_monitor/src/memory_monitor.cpp", 56 ] 57 58 defines = [ "DEV_AUTH_MEMORY_DEBUG" ] 59 if (enable_extend_plugin) { 60 defines += [ "DEV_AUTH_PLUGIN_ENABLE" ] 61 sources += [ "${os_adapter_path}/impl/src/linux/dev_auth_dynamic_load.c" ] 62 } 63 64 cflags = [ "-DHILOG_ENABLE" ] 65 deps = [ 66 "//third_party/cJSON:cjson", 67 "//third_party/mbedtls:mbedtls_shared", 68 "//third_party/openssl:libcrypto_shared", 69 ] 70 external_deps = [ 71 "c_utils:utils", 72 "hilog:libhilog", 73 "huks:libhukssdk", 74 "init:libbegetutil", 75 ] 76} 77