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_openssl_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 defines = [ 32 "L2_STANDARD", 33 "_HARDWARE_ROOT_KEY_", 34 "_HUKS_LOG_ENABLE_", 35 ] 36 sources = [ 37 "src/hks_openssl_ability.c", 38 "src/hks_openssl_aes.c", 39 "src/hks_openssl_bn.c", 40 "src/hks_openssl_common.c", 41 "src/hks_openssl_curve25519.c", 42 "src/hks_openssl_dh.c", 43 "src/hks_openssl_dsa.c", 44 "src/hks_openssl_ecc.c", 45 "src/hks_openssl_ed25519tox25519.c", 46 "src/hks_openssl_engine.c", 47 "src/hks_openssl_hash.c", 48 "src/hks_openssl_hmac.c", 49 "src/hks_openssl_kdf.c", 50 "src/hks_openssl_rsa.c", 51 "src/hks_openssl_sm2.c", 52 "src/hks_openssl_sm3.c", 53 "src/hks_openssl_sm4.c", 54 ] 55 56 deps = [ "//base/security/huks/frameworks/huks_standard/main/common:libhuks_common_standard_static" ] 57 if (huks_dependency_openssl_path != "") { 58 deps += [ huks_dependency_openssl_path ] 59 } else { 60 deps += [ "//third_party/openssl:libcrypto_shared" ] 61 } 62 external_deps = [ 63 "c_utils:utils", 64 "hiviewdfx_hilog_native:libhilog", 65 ] 66 cflags = [ 67 "-DHILOG_ENABLE", 68 "-Wall", 69 "-Werror", 70 ] 71 complete_static_lib = true 72} 73