# Copyright (C) 2021 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. import("//build/ohos.gni") # generate dlsm's cred action("gen_ohos_dslm_cred_file") { file_name = "dslm_finger.cfg" script = rebase_path("dslm_cred_tool.py") outputs = [ "$target_gen_dir/$file_name" ] out_dir = rebase_path("$target_gen_dir") args = [ "create", "--artifacts-dir=$out_dir/artifacts", "--field-manufacture=ohos", "--field-brand=$device_name", "--field-model=$product_name", "--field-software-version=3.0.0", "--field-security-level=SL1", "--cred-file=$out_dir/$file_name", "--strict=true", ] } # sa lib ohos_shared_library("dslm_service") { sources = [ "dslm_ohos_credential.c" ] include_dirs = [ "//base/security/device_security_level/common/include", "//base/security/device_security_level/interfaces/inner_api/include", ] deps = [ ":dslm_ohos_cred_obj", "//base/security/device_security_level/baselib/utils:utils_static", "//base/security/device_security_level/services/sa:service_sa_static", ] # generate the cred file deps += [ ":dslm_ohos_cred_file" ] external_deps = [ "hilog_native:libhilog", "utils_base:utils", ] part_name = "device_security_level" subsystem_name = "security" } ohos_source_set("dslm_ohos_cred_obj") { sources = [ "impl/dslm_ohos_init.c", "impl/dslm_ohos_request.c", "impl/dslm_ohos_verify.c", "impl/external_interface_adapter.c", ] include_dirs = [ "//base/security/device_security_level/common/include", "//base/security/device_security_level/interfaces/inner_api/include", "//base/security/device_security_level/services/include", "//base/security/deviceauth/interfaces/innerkits", ] deps = [ "//base/security/device_security_level/baselib/utils:utils_static", "//base/security/deviceauth/services:deviceauth_sdk", ] external_deps = [ "deviceauth_standard:deviceauth_sdk", "hilog_native:libhilog", "huks:libhukssdk", "startup_l2:syspara", "utils_base:utils", ] part_name = "device_security_level" subsystem_name = "security" } ohos_prebuilt_etc("dslm_ohos_cred_file") { out = get_target_outputs(":gen_ohos_dslm_cred_file") source = out[0] deps = [ ":gen_ohos_dslm_cred_file" ] part_name = "device_security_level" subsystem_name = "security" }