1# Copyright (c) 2022 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/device_security_level/common/dslm.gni")
15import("//build/ohos.gni")
16
17# oem_common_obj object
18ohos_source_set("oem_common_obj") {
19  sources = [
20    "dslm_credential.c",
21    "dslm_credential_utils.c",
22  ]
23
24  include_dirs = [
25    "../../common/include",
26    "../../interfaces/inner_api/include",
27    "../include",
28  ]
29
30  deps = [ "../../baselib/utils:utils_static" ]
31
32  if (defined(ohos_lite)) {
33    if (ohos_kernel_type == "linux" || ohos_kernel_type == "liteos_a") {
34      deps += [ "//third_party/openssl/ohos_lite:openssl_shared" ]
35      external_deps = [ "hilog_lite:hilog_shared" ]
36    } else if (ohos_kernel_type == "liteos_m") {
37      deps += [ "$dslm_hilog_path/featured:hilog_static" ]
38    }
39  } else {
40    sanitize = {
41      integer_overflow = true
42      ubsan = true
43      boundary_sanitize = true
44      cfi = true
45      cfi_cross_dso = true
46      blocklist = "../../cfi_blocklist.txt"
47    }
48    branch_protector_ret = "pac_ret"
49
50    deps += [ "//third_party/openssl:libcrypto_shared" ]
51
52    external_deps = [
53      "c_utils:utils",
54      "hilog:libhilog",
55    ]
56  }
57  configs = [
58    "../../common:common_configs",
59    "../../common:common_lite_configs",
60  ]
61
62  part_name = "device_security_level"
63  subsystem_name = "security"
64}
65