1# Copyright (C) 2022-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("//base/security/huks/build/config.gni") 15import("//base/security/huks/huks.gni") 16import("//build/ohos.gni") 17 18config("huks_config") { 19 include_dirs = [ "include" ] 20} 21 22if (os_level == "standard") { 23 ohos_static_library("libhuks_utils_client_service_adapter_static") { 24 sanitize = { 25 integer_overflow = true 26 cfi = true 27 debug = false 28 cfi_cross_dso = true 29 } 30 subsystem_name = "security" 31 part_name = "huks" 32 public_configs = [ ":huks_config" ] 33 include_dirs = 34 [ "../../frameworks/huks_standard/main/crypto_engine/openssl/include" ] 35 defines = [ 36 "_HARDWARE_ROOT_KEY_", 37 "_HUKS_LOG_ENABLE_", 38 "OPENSSL_SUPPRESS_DEPRECATED", 39 ] 40 sources = [ 41 "hks_client_service_adapter.c", 42 "hks_client_service_adapter_common.c", 43 ] 44 configs = [ 45 "//base/security/huks/frameworks/config/build:l2_standard_common_config", 46 ] 47 cflags = [ 48 "-Wall", 49 "-Werror", 50 ] 51 deps = [ 52 "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static", 53 "//base/security/huks/frameworks/huks_standard/main/os_dependency:libhuks_os_dependency_standard_static", 54 "//third_party/openssl:libcrypto_shared", 55 ] 56 external_deps = [ 57 "c_utils:utils", 58 "hilog:libhilog", 59 ] 60 complete_static_lib = true 61 } 62} else { 63 ohos_static_library("libhuks_utils_client_service_adapter_static") { 64 public_configs = [ ":huks_config" ] 65 defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] 66 include_dirs = 67 [ "../../frameworks/huks_standard/main/crypto_engine/include/" ] 68 configs = [ 69 "//base/security/huks/frameworks/config/build:l1_small_common_config", 70 ] 71 72 sources = [ 73 "hks_client_service_adapter_common.c", 74 "hks_client_service_adapter_lite.c", 75 ] 76 77 deps = [ 78 "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_small_static", 79 "//base/security/huks/frameworks/huks_standard/main/crypto_engine:libhuks_crypto_engine_small_static", 80 "//base/security/huks/frameworks/huks_standard/main/os_dependency:libhuks_os_dependency_small_static", 81 ] 82 83 external_deps = [ "hilog_featured_lite:hilog_shared" ] 84 if (huks_dependency_mbedtls_path != "") { 85 deps += [ huks_dependency_mbedtls_path ] 86 } else { 87 deps += [ "//third_party/mbedtls" ] 88 } 89 if (huks_dependency_openssl_path != "") { 90 deps += [ huks_dependency_openssl_path ] 91 } else { 92 deps += [ "//third_party/openssl/ohos_lite:openssl_shared" ] 93 } 94 complete_static_lib = true 95 } 96} 97