• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/standard/crypto_hash_to_point.c",
36    "${key_management_adapter_path}/impl/src/standard/huks_adapter.c",
37    "${key_management_adapter_path}/impl/src/standard/mbedtls_ec_adapter.c",
38    "${os_adapter_path}/impl/src/hc_log.c",
39    "${os_adapter_path}/impl/src/linux/hc_condition.c",
40    "${os_adapter_path}/impl/src/linux/hc_dev_info.c",
41    "${os_adapter_path}/impl/src/linux/hc_file.c",
42    "${os_adapter_path}/impl/src/linux/hc_init_protection.c",
43    "${os_adapter_path}/impl/src/linux/hc_thread.c",
44    "${os_adapter_path}/impl/src/linux/hc_types.c",
45  ]
46  sources -= [
47    "${os_adapter_path}/impl/src/linux/hc_dev_info.c",
48    "${os_adapter_path}/impl/src/linux/hc_types.c",
49  ]
50  sources += [
51    "dev_info_mock/src/dev_info_mock.c",
52    "exception_controller/src/exception_controller.c",
53    "memory_mock/src/memory_mock.c",
54    "memory_monitor/src/memory_monitor.cpp",
55  ]
56
57  defines = [ "DEV_AUTH_MEMORY_DEBUG" ]
58  if (enable_extend_plugin) {
59    defines += [ "DEV_AUTH_PLUGIN_ENABLE" ]
60    sources += [ "${os_adapter_path}/impl/src/linux/dev_auth_dynamic_load.c" ]
61  }
62
63  cflags = [ "-DHILOG_ENABLE" ]
64  deps = [
65    "//third_party/cJSON:cjson",
66    "//third_party/mbedtls:mbedtls_shared",
67    "//third_party/openssl:libcrypto_shared",
68  ]
69  external_deps = [
70    "c_utils:utils",
71    "hilog:libhilog",
72    "huks:libhukssdk",
73    "init:libbegetutil",
74  ]
75}
76