# Copyright (c) 2025 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

declare_args() {
  companion_device_auth_enable_auth_state_maintain_simulation = true
}

companion_device_auth_subsystem_name = "useriam"
companion_device_auth_part_name = "companion_device_auth"
companion_device_auth_path = "//base/useriam/companion_device_auth"
companion_device_auth_enable_coverage = false

companion_device_auth_has_account_os_account =
    defined(global_parts_info) && defined(global_parts_info.account_os_account)
companion_device_auth_has_soft_bus_channel =
    defined(global_parts_info) &&
    defined(global_parts_info.communication_dsoftbus)
companion_device_auth_has_ext =
    defined(global_parts_info) &&
    defined(global_parts_info.useriam_companion_device_auth_ext)

companion_device_auth_default_sanitize = {
  integer_overflow = true
  ubsan = true
  boundary_sanitize = true
  cfi = true
  cfi_cross_dso = true
  debug = false
  blocklist = "${companion_device_auth_path}/cfi_blocklist.txt"
}

companion_device_auth_no_cfi_sanitize = {
  integer_overflow = true
  ubsan = true
  boundary_sanitize = true
  cfi = false
  cfi_cross_dso = false
  debug = false
}