1# Copyright (c) 2020-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
14base_root = "../../../../../../"
15import("$base_root/base/security/huks/build/config.gni")
16import("$base_root/base/security/huks/huks.gni")
17import("$base_root/test/xts/tools/build/suite.gni")
18
19config("module_private_config") {
20  visibility = [ ":*" ]
21  include_dirs = [
22    "$base_root/commonlibrary/c_utils/base/include",
23    "$base_root/third_party/bounds_checking_function/include",
24    "include",
25  ]
26}
27
28ohos_moduletest_suite("ActsHuksNAPITest") {
29  configs = [ ":module_private_config" ]
30  cflags_cc = [ "-DHILOG_ENABLE" ]
31  defines = [
32    "_STANDARD_SYSTEM_",
33    "CONFIG_HUKS_STAGED",
34    "_USE_OPENSSL_",
35  ]
36  subsystem_name = "security"
37  part_name = "huks"
38
39  sources = [
40    "src/huks_agree_dh_test.cpp",
41    "src/huks_agree_ecdh_test.cpp",
42    "src/huks_agree_ecdh_test_common.cpp",
43    "src/huks_agree_x25519_test.cpp",
44    "src/huks_cipher_aes_test.cpp",
45    "src/huks_cipher_aes_test_common.cpp",
46    "src/huks_cipher_rsa_test.cpp",
47    "src/huks_cipher_rsa_test_common.cpp",
48    "src/huks_cipher_sm4_test.cpp",
49    "src/huks_cipher_sm4_test_common.cpp",
50    "src/huks_derive_hkdf_test.cpp",
51    "src/huks_derive_hkdf_test_common.cpp",
52    "src/huks_derive_pbkdf_test.cpp",
53    "src/huks_derive_pbkdf_test_common.cpp",
54    "src/huks_hmac_test.cpp",
55    "src/huks_mem.cpp",
56    "src/huks_misc_test.cpp",
57    "src/huks_nullptr_test.cpp",
58    "src/huks_signverify_ecc_test.cpp",
59    "src/huks_signverify_ecc_test_common.cpp",
60    "src/huks_signverify_ed25519_test.cpp",
61    "src/huks_signverify_rsa_test.cpp",
62    "src/huks_signverify_rsa_test_common.cpp",
63    "src/huks_signverify_sm2_test.cpp",
64    "src/huks_three_stage_test_common.cpp",
65    "src/huks_warpped_test.cpp",
66    "src/huks_wrapped_test_common.cpp",
67  ]
68
69  if (huks_security_level != "trusted_environment") {
70    sources += [
71      "src/huks_attest_test.cpp",
72      "src/huks_attest_test_common.cpp",
73      "src/huks_signverify_dsa_test.cpp",
74    ]
75  }
76
77  include_dirs = [
78    "$base_root/test/xts/acts/security/security_huks_basic/huks_napi_BasicTest/include",
79    "include",
80    "$base_root/base/security/huks/interfaces/kits/c/include",
81    "commonlibrary/c_utils/base/include",
82  ]
83
84  external_deps = [
85    "c_utils:utils",
86    "huks:libhukssdk",
87  ]
88  deps = [
89    "$base_root/base/security/huks/frameworks/huks_standard/main:huks_standard_frameworks",
90    "$base_root/base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static",
91    "$base_root/base/security/huks/interfaces/kits/c:huks_ndk",
92    "$base_root/third_party/bounds_checking_function:libsec_static",
93    "$base_root/third_party/openssl:libcrypto_shared",
94  ]
95}
96