• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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")
15import("../../code_signature.gni")
16
17ohos_rust_executable("key_enable") {
18  sources = [ "src/main.rs" ]
19  deps = [
20    "utils:libkey_enable_utils",
21    "${rust_openssl_dir}/openssl:lib"
22  ]
23  external_deps = [
24    "hisysevent:hisysevent_rust",
25    "hilog:hilog_rust",
26  ]
27  if (build_variant == "root") {
28    rustenv = [ "code_signature_debuggable=on" ]
29  } else {
30    rustenv = [ "code_signature_debuggable=off" ]
31  }
32  crate_name = "key_enable"
33  crate_type = "bin"
34  subsystem_name = "security"
35  part_name = "code_signature"
36}
37
38ohos_prebuilt_etc("trusted_code_signature_certs") {
39  source = "config/trusted_code_signature_certs.cer"
40  part_name = "code_signature"
41  subsystem_name = "security"
42  relative_install_dir = "security"
43}
44
45ohos_prebuilt_etc("trusted_code_signature_test_certs") {
46  source = "config/trusted_code_signature_test_certs.cer"
47  part_name = "code_signature"
48  subsystem_name = "security"
49  relative_install_dir = "security"
50}
51
52ohos_prebuilt_etc("key_enable.cfg") {
53  source = "key_enable.cfg"
54  relative_install_dir = "init"
55  subsystem_name = "security"
56  part_name = "code_signature"
57}
58
59group("key_enable_targets") {
60  deps = [
61    ":key_enable",
62    ":key_enable.cfg",
63    ":trusted_code_signature_certs",
64    ":trusted_code_signature_test_certs"
65  ]
66}