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/crypto_framework/common/common.gni") 15import("//base/security/crypto_framework/plugin/plugin.gni") 16import("//build/ohos.gni") 17 18config("plugin_config") { 19 include_dirs = [ 20 "../interfaces/inner_api/algorithm_parameter", 21 "../interfaces/inner_api/common", 22 "../interfaces/inner_api/crypto_operation", 23 "../interfaces/inner_api/key", 24 "../frameworks/spi", 25 ] 26} 27 28if (os_level == "standard") { 29 ohos_shared_library("crypto_openssl_plugin_lib") { 30 branch_protector_ret = "pac_ret" 31 subsystem_name = "security" 32 innerapi_tags = [ "platformsdk_indirect" ] 33 part_name = "crypto_framework" 34 public_configs = [ ":plugin_config" ] 35 include_dirs = plugin_inc_path + crypto_framwork_common_inc_path 36 37 sources = plugin_files 38 39 if (os_level == "standard") { 40 sanitize = { 41 cfi = true 42 cfi_cross_dso = true 43 debug = false 44 } 45 } 46 47 cflags = [ 48 "-DHILOG_ENABLE", 49 "-fPIC", 50 "-Wall", 51 ] 52 53 version_script = "openssl_plugin.map" 54 55 deps = [ "../common:crypto_plugin_common" ] 56 57 external_deps = [ 58 "c_utils:utils", 59 "hilog:libhilog", 60 "openssl:libcrypto_shared", 61 ] 62 defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ] 63 } 64} else if (os_level == "mini") { 65 ohos_static_library("crypto_mbedtls_plugin_lib") { 66 subsystem_name = "security" 67 part_name = "crypto_framework" 68 public_configs = [ ":plugin_config" ] 69 include_dirs = crypto_framwork_common_inc_path + mbedtls_plugin_inc_path 70 71 sources = mbedtls_plugin_files 72 73 defines = [ "MINI_HILOG_ENABLE" ] 74 75 deps = [ "../common:crypto_common_lite" ] 76 77 configs = [ "${product_path}:product_public_configs" ] 78 79 external_deps = [ "hilog_lite:hilog_lite" ] 80 } 81} 82