1# Copyright (C) 2021 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("//build/ohos.gni") 15 16# generate dlsm's cred 17action("gen_ohos_dslm_cred_file") { 18 file_name = "dslm_finger.cfg" 19 20 script = rebase_path("dslm_cred_tool.py") 21 outputs = [ "$target_gen_dir/$file_name" ] 22 23 out_dir = rebase_path("$target_gen_dir") 24 args = [ 25 "create", 26 "--artifacts-dir=$out_dir/artifacts", 27 "--field-manufacture=ohos", 28 "--field-brand=$device_name", 29 "--field-model=$product_name", 30 "--field-software-version=3.0.0", 31 "--field-security-level=SL1", 32 "--cred-file=$out_dir/$file_name", 33 "--strict=true", 34 ] 35} 36 37# sa lib 38ohos_shared_library("dslm_service") { 39 sources = [ "dslm_ohos_credential.c" ] 40 41 include_dirs = [ 42 "//base/security/device_security_level/common/include", 43 "//base/security/device_security_level/interfaces/inner_api/include", 44 ] 45 46 deps = [ 47 ":dslm_ohos_cred_obj", 48 "//base/security/device_security_level/baselib/utils:utils_static", 49 "//base/security/device_security_level/services/sa:service_sa_static", 50 ] 51 52 # generate the cred file 53 deps += [ ":dslm_ohos_cred_file" ] 54 55 external_deps = [ 56 "hilog_native:libhilog", 57 "utils_base:utils", 58 ] 59 60 part_name = "device_security_level" 61 subsystem_name = "security" 62} 63 64ohos_source_set("dslm_ohos_cred_obj") { 65 sources = [ 66 "impl/dslm_ohos_init.c", 67 "impl/dslm_ohos_request.c", 68 "impl/dslm_ohos_verify.c", 69 "impl/external_interface_adapter.c", 70 ] 71 72 include_dirs = [ 73 "//base/security/device_security_level/common/include", 74 "//base/security/device_security_level/interfaces/inner_api/include", 75 "//base/security/device_security_level/services/include", 76 "//base/security/deviceauth/interfaces/innerkits", 77 ] 78 79 deps = [ 80 "//base/security/device_security_level/baselib/utils:utils_static", 81 "//base/security/deviceauth/services:deviceauth_sdk", 82 ] 83 84 external_deps = [ 85 "deviceauth_standard:deviceauth_sdk", 86 "hilog_native:libhilog", 87 "huks:libhukssdk", 88 "startup_l2:syspara", 89 "utils_base:utils", 90 ] 91 92 part_name = "device_security_level" 93 subsystem_name = "security" 94} 95 96ohos_prebuilt_etc("dslm_ohos_cred_file") { 97 out = get_target_outputs(":gen_ohos_dslm_cred_file") 98 source = out[0] 99 100 deps = [ ":gen_ohos_dslm_cred_file" ] 101 102 part_name = "device_security_level" 103 subsystem_name = "security" 104} 105