1# Copyright (c) 2021-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. 13import("//build/ohos.gni") 14import("//foundation/filemanagement/storage_service/storage_service_aafwk.gni") 15 16## build sm execute bin file 17config("storage_daemon_crypto_config") { 18 visibility = [ ":*" ] 19 20 include_dirs = [ 21 "../include", 22 "../include/crypto", 23 "${storage_service_common_path}/include", 24 "//third_party/openssl/include", 25 ] 26 27 cflags = [ 28 "-g3", 29 "-Wall", 30 ] 31} 32 33ohos_static_library("libsdcrypto") { 34 stack_protector_ret = true 35 sanitize = { 36 integer_overflow = true 37 ubsan = true 38 boundary_sanitize = true 39 cfi = true 40 cfi_cross_dso = true 41 debug = false 42 } 43 44 sources = [ 45 "src/base_key.cpp", 46 "src/fbex.cpp", 47 "src/fscrypt_key_v1.cpp", 48 "src/fscrypt_key_v1_ext.cpp", 49 "src/fscrypt_key_v2.cpp", 50 "src/huks_master.cpp", 51 "src/key_manager.cpp", 52 "src/openssl_crypto.cpp", 53 ] 54 55 defines = [ 56 "STORAGE_LOG_TAG = \"StorageDaemon\"", 57 "LOG_DOMAIN = 0xD004301", 58 "OPENSSL_SUPPRESS_DEPRECATED", 59 "USER_CRYPTO_MIGRATE_KEY", 60 "KMSG_LOG", 61 ] 62 63 configs = [ ":storage_daemon_crypto_config" ] 64 65 deps = [ 66 "${storage_daemon_path}:storage_common_utils", 67 "${storage_daemon_path}/libfscrypt:libfscryptutils", 68 "//third_party/openssl:libcrypto_shared", 69 ] 70 71 external_deps = [ 72 "c_utils:utils", 73 "hilog:libhilog", 74 "huks:libhukssdk", 75 "init:libbegetutil", 76 "ipc:ipc_core", 77 ] 78 79 subsystem_name = "filemanagement" 80 part_name = "storage_service" 81} 82