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