BUILD.gn 4.9 KB
Newer Older
C
code4lala 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
# 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("//test/xts/acts/security_lite/deviceauth_basic_deps/deviceauth.gni")
import("//test/xts/tools/lite/build/suite_lite.gni")

hctest_suite("ActsSecurityHichainBasicDeps") {
  suite_name = "acts"

  sources = [ "test.c" ]

  sources += DEVICEAUTH_BASIC_DEPS_SOURCE

  include_dirs = [
    "//utils/native/base/include",
    "//utils/native/lite/include",
    "//test/xts/tools/lite/hctest/include",
    "//third_party/unity/src",
    "//foundation/distributedschedule/samgr_lite/interfaces/kits/samgr",
  ]

  include_dirs += DEVICEAUTH_BASIC_DEPS_INC

  deps = []

  cflags = [ "-Werror" ]

  ldflags = [
    "-lstdc++",
    "-lm",
    "-lpthread",
  ]

  defines = [
    "MKDIR_IMPLEMENTED=0",
    "STAT_IMPLEMENTED=0",
    "ACCESS_IMPLEMENTED=0",
    "F_API_IMPLEMENTED=0",
    "FLASH_START_ADDRESS_HICHAIN=0",
    "UTILS_FILE_IMPLEMENTED=1",
    "TEST_PTHREAD_CREATE_DETACHED=0",
    "TEST_HC_FILE_OPEN_SERIES=1",
  ]
C
code4lala 已提交
54
  defines += DEVICEAUTH_BASIC_DEPS_ALGORITHM_DEFINES
C
code4lala 已提交
55 56

  if (defined(ohos_lite)) {
C
code4lala 已提交
57
    include_dirs += [
H
heyinshen 已提交
58
      "//base/security/device_auth/deps_adapter/os_adapter/interfaces/liteos",
C
code4lala 已提交
59
    ]
C
code4lala 已提交
60 61 62 63 64 65 66 67 68 69 70
    if (ohos_kernel_type == "liteos_m") {
      # liteos m
      include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ]
      deps +=
          [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ]
      if (board_name == "rtl8720") {
        cflags +=
            [ "-isystem${ohos_root_path}/kernel/liteos_m/kal/posix/include" ]
        defines -= [
          "FLASH_START_ADDRESS_HICHAIN=0",
          "TEST_HC_FILE_OPEN_SERIES=1",
C
code4lala 已提交
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
          "TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
          "TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=1",
          "TEST_HASH_TO_POINT=1",
          "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
          "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
          "TEST_AGREE_SHARED_SECRET=1",
          "TEST_GENERATE_KEY_PAIR=1",
          "TEST_EXPORT_PUBLIC_KEY=1",
          "TEST_ALGORITHM_SIGN=1",
          "TEST_ALGORITHM_VERIFY=1",
          "TEST_IMPORT_PUBLIC_KEY=1",
          "TEST_CHECK_KEY_EXIST=1",
          "TEST_DELETE_KEY=1",
          "TEST_AES_GCM_ENCRYPT=1",
          "TEST_AES_GCM_DECRYPT=1",
C
code4lala 已提交
86 87 88 89
        ]
        defines += [
          "FLASH_START_ADDRESS_HICHAIN=0x1F6000",
          "TEST_HC_FILE_OPEN_SERIES=0",
C
code4lala 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
          "TEST_HKDF_WITH_KEY_ALIAS_TRUE=0",
          "TEST_COMPUTEHMAC_WITH_ISALIAS_TRUE=0",
          "TEST_HASH_TO_POINT=0",
          "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=0",
          "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=0",
          "TEST_AGREE_SHARED_SECRET=0",
          "TEST_GENERATE_KEY_PAIR=0",
          "TEST_EXPORT_PUBLIC_KEY=0",
          "TEST_ALGORITHM_SIGN=0",
          "TEST_ALGORITHM_VERIFY=0",
          "TEST_IMPORT_PUBLIC_KEY=0",
          "TEST_CHECK_KEY_EXIST=0",
          "TEST_DELETE_KEY=0",
          "TEST_AES_GCM_ENCRYPT=0",
          "TEST_AES_GCM_DECRYPT=0",
C
code4lala 已提交
105
        ]
C
code4lala 已提交
106
        defines += [ "DO_NOT_TEST_DEPRECATED_IMPORT_SYMMETRIC_KEY=1" ]
C
code4lala 已提交
107 108 109
      }
      if (board_name == "hispark_pegasus") {
        # 3861
C
code4lala 已提交
110 111 112 113 114 115
        defines -= [
          "TEST_HKDF_WITH_KEY_ALIAS_TRUE=1",
          "TEST_HASH_TO_POINT=1",
          "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=1",
          "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=1",
          "TEST_AGREE_SHARED_SECRET=1",
C
code4lala 已提交
116 117 118 119 120
          "TEST_GENERATE_KEY_PAIR=1",
          "TEST_EXPORT_PUBLIC_KEY=1",
          "TEST_ALGORITHM_SIGN=1",
          "TEST_ALGORITHM_VERIFY=1",
          "TEST_IMPORT_PUBLIC_KEY=1",
C
code4lala 已提交
121 122 123 124 125 126 127
        ]
        defines += [
          "TEST_HKDF_WITH_KEY_ALIAS_TRUE=0",
          "TEST_HASH_TO_POINT=0",
          "TEST_GENERATE_KEY_PAIR_WITH_STORAGE=0",
          "TEST_AGREE_SHARED_SECRET_WITH_STORAGE=0",
          "TEST_AGREE_SHARED_SECRET=0",
C
code4lala 已提交
128 129 130 131 132
          "TEST_GENERATE_KEY_PAIR=0",
          "TEST_EXPORT_PUBLIC_KEY=0",
          "TEST_ALGORITHM_SIGN=0",
          "TEST_ALGORITHM_VERIFY=0",
          "TEST_IMPORT_PUBLIC_KEY=0",
C
code4lala 已提交
133
        ]
C
code4lala 已提交
134 135 136 137 138 139 140 141 142 143 144 145
      }
    } else {
      #liteos a or L1 linux
      include_dirs += [ "//base/startup/syspara_lite/interfaces/kits" ]
      deps +=
          [ "//base/startup/syspara_lite/frameworks/parameter/src:sysparam" ]
    }
  } else {
    # linux
    include_dirs += [
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include",

H
heyinshen 已提交
146
      "//base/security/device_auth/deps_adapter/os_adapter/interfaces/linux",
C
code4lala 已提交
147 148 149 150 151 152
    ]
    deps += [
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
    ]
  }
}