14e56987cSopenharmony_ci# Copyright (C) 2022 Huawei Device Co., Ltd.
24e56987cSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
34e56987cSopenharmony_ci# you may not use this file except in compliance with the License.
44e56987cSopenharmony_ci# You may obtain a copy of the License at
54e56987cSopenharmony_ci#
64e56987cSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
74e56987cSopenharmony_ci#
84e56987cSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
94e56987cSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
104e56987cSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
114e56987cSopenharmony_ci# See the License for the specific language governing permissions and
124e56987cSopenharmony_ci# limitations under the License.
134e56987cSopenharmony_ci
144e56987cSopenharmony_ciimport("//build/ohos.gni")
154e56987cSopenharmony_ci
164e56987cSopenharmony_cideclare_args() {
174e56987cSopenharmony_ci  certificate_manager_feature_ca_enabled = "true"
184e56987cSopenharmony_ci}
194e56987cSopenharmony_ci
204e56987cSopenharmony_cideclare_args() {
214e56987cSopenharmony_ci  certificate_manager_feature_credential_enabled = "true"
224e56987cSopenharmony_ci}
234e56987cSopenharmony_ci
244e56987cSopenharmony_ciohos_prebuilt_etc("cert_manager_service.rc") {
254e56987cSopenharmony_ci  source = "cert_manager_service.cfg"
264e56987cSopenharmony_ci  relative_install_dir = "init"
274e56987cSopenharmony_ci  subsystem_name = "security"
284e56987cSopenharmony_ci  part_name = "certificate_manager"
294e56987cSopenharmony_ci}
304e56987cSopenharmony_ci
314e56987cSopenharmony_ciohos_shared_library("cert_manager_service") {
324e56987cSopenharmony_ci  branch_protector_ret = "pac_ret"
334e56987cSopenharmony_ci  sanitize = {
344e56987cSopenharmony_ci    cfi = true
354e56987cSopenharmony_ci    cfi_cross_dso = true
364e56987cSopenharmony_ci    boundary_sanitize = true
374e56987cSopenharmony_ci    debug = false
384e56987cSopenharmony_ci    integer_overflow = true
394e56987cSopenharmony_ci    ubsan = true
404e56987cSopenharmony_ci  }
414e56987cSopenharmony_ci  subsystem_name = "security"
424e56987cSopenharmony_ci  part_name = "certificate_manager"
434e56987cSopenharmony_ci  defines = [
444e56987cSopenharmony_ci    "L2_STANDARD",
454e56987cSopenharmony_ci    "_CM_LOG_ENABLE_",
464e56987cSopenharmony_ci  ]
474e56987cSopenharmony_ci
484e56987cSopenharmony_ci  if (certificate_manager_feature_ca_enabled == "false") {
494e56987cSopenharmony_ci    defines += [ "CERTIFICATE_MANAGER_FEATURE_CA_DISABLED" ]
504e56987cSopenharmony_ci  }
514e56987cSopenharmony_ci  if (certificate_manager_feature_credential_enabled == "false") {
524e56987cSopenharmony_ci    defines += [ "CERTIFICATE_MANAGER_FEATURE_CREDENTIAL_DISABLED" ]
534e56987cSopenharmony_ci  }
544e56987cSopenharmony_ci
554e56987cSopenharmony_ci  deps = [
564e56987cSopenharmony_ci    ":cert_manager_service.rc",
574e56987cSopenharmony_ci    "cert_manager_engine/main/core:cert_manager_engine_core_standard",
584e56987cSopenharmony_ci    "cert_manager_engine/main/rdb:libcert_manager_rdb_static",
594e56987cSopenharmony_ci    "cert_manager_service/main/os_dependency:libcert_manager_service_os_dependency_standard_static",
604e56987cSopenharmony_ci  ]
614e56987cSopenharmony_ci  external_deps = [
624e56987cSopenharmony_ci    "hilog:libhilog",
634e56987cSopenharmony_ci    "ipc:ipc_core",
644e56987cSopenharmony_ci    "safwk:system_ability_fwk",
654e56987cSopenharmony_ci    "samgr:samgr_proxy",
664e56987cSopenharmony_ci  ]
674e56987cSopenharmony_ci}
68