• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    "${storage_interface_path}/innerkits/storage_manager/native",
25  ]
26
27  cflags = [
28    "-g3",
29    "-Wall",
30    "-O2",
31  ]
32}
33
34ohos_static_library("libsdcrypto") {
35  branch_protector_ret = "pac_ret"
36  sanitize = {
37    integer_overflow = true
38    ubsan = true
39    boundary_sanitize = true
40    cfi = true
41    cfi_cross_dso = true
42    debug = false
43  }
44
45  sources = [
46    "src/app_clone_key_manager.cpp",
47    "src/base_key.cpp",
48    "src/crypto_delay_handler.cpp",
49    "src/fbex.cpp",
50    "src/fscrypt_key_v1.cpp",
51    "src/fscrypt_key_v1_ext.cpp",
52    "src/fscrypt_key_v2.cpp",
53    "src/huks_master.cpp",
54    "src/iam_client.cpp",
55    "src/key_backup.cpp",
56    "src/key_crypto_utils.cpp",
57    "src/key_manager.cpp",
58    "src/openssl_crypto.cpp",
59    "src/recover_manager.cpp",
60  ]
61
62  defines = [
63    "STORAGE_LOG_TAG = \"StorageDaemon\"",
64    "LOG_DOMAIN = 0xD004301",
65    "OPENSSL_SUPPRESS_DEPRECATED",
66    "USER_CRYPTO_MIGRATE_KEY",
67    "KMSG_LOG",
68  ]
69
70  configs = [ ":storage_daemon_crypto_config" ]
71
72  deps = [
73    "${storage_daemon_path}:storage_common_utils",
74    "${storage_daemon_path}/libfscrypt:libfscryptutils",
75  ]
76
77  external_deps = [
78    "c_utils:utils",
79    "eventhandler:libeventhandler",
80    "hilog:libhilog",
81    "huks:libhukssdk",
82    "init:libbegetutil",
83    "ipc:ipc_single",
84    "openssl:libcrypto_shared",
85    "os_account:os_account_innerkits",
86    "samgr:samgr_proxy",
87  ]
88
89  if (storage_service_el5_filekey_manager) {
90    defines += [ "EL5_FILEKEY_MANAGER" ]
91    external_deps += [ "access_token:el5_filekey_manager_sdk" ]
92  }
93
94  if (enable_user_auth_framework) {
95    defines += [ "USER_AUTH_FRAMEWORK" ]
96    external_deps += [ "user_auth_framework:userauth_client" ]
97  }
98
99  if (enable_tee_client) {
100    defines += [ "RECOVER_KEY_TEE_ENVIRONMENT" ]
101    external_deps += [ "tee_client:libteec" ]
102  }
103
104  if (enable_screenlock_manager) {
105    defines += [ "ENABLE_SCREENLOCK_MANAGER" ]
106    external_deps += [ "screenlock_mgr:screenlock_client" ]
107  }
108
109  subsystem_name = "filemanagement"
110  part_name = "storage_service"
111}
112