• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2021-2022 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("//base/security/huks/build/config.gni")
15import("//build/ohos.gni")
16
17config("huks_config") {
18  include_dirs = [ "include" ]
19}
20
21ohos_static_library("libhuks_mbedtls_standard_static") {
22  sanitize = {
23    integer_overflow = true
24    cfi = true
25    debug = false
26  }
27  subsystem_name = "security"
28  part_name = "huks"
29  public_configs = [ ":huks_config" ]
30
31  include_dirs = [ "//commonlibrary/c_utils/base/include" ]
32
33  defines = [
34    "L2_STANDARD",
35    "_HARDWARE_ROOT_KEY_",
36    "_HUKS_LOG_ENABLE_",
37  ]
38  sources = [
39    "src/hks_crypto_ed25519.c",
40    "src/hks_mbedtls_ability.c",
41    "src/hks_mbedtls_aes.c",
42    "src/hks_mbedtls_bn.c",
43    "src/hks_mbedtls_common.c",
44    "src/hks_mbedtls_dh.c",
45    "src/hks_mbedtls_dsa.c",
46    "src/hks_mbedtls_ecc.c",
47    "src/hks_mbedtls_ecdh.c",
48    "src/hks_mbedtls_ecdsa.c",
49    "src/hks_mbedtls_engine.c",
50    "src/hks_mbedtls_hash.c",
51    "src/hks_mbedtls_hmac.c",
52    "src/hks_mbedtls_kdf.c",
53    "src/hks_mbedtls_rsa.c",
54    "src/hks_mbedtls_x25519.c",
55  ]
56
57  deps = [ "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static" ]
58  if (huks_dependency_mbedtls_path != "") {
59    deps += [ huks_dependency_mbedtls_path ]
60  } else {
61    deps += [ "//third_party/mbedtls" ]
62  }
63  if (huks_dependency_openssl_path != "") {
64    deps += [ huks_dependency_openssl_path ]
65  } else {
66    deps += [ "//third_party/openssl:libcrypto_shared" ]
67  }
68  cflags = [
69    "-DHILOG_ENABLE",
70    "-Wall",
71    "-Werror",
72  ]
73  external_deps = [ "hiviewdfx_hilog_native:libhilog" ]
74  complete_static_lib = true
75}
76