blob: c3ff4a836adceef1a5c06b6dec09983a9040f0f1 [file] [log] [blame]
Janis Danisevskisc51dff82021-10-20 09:51:16 -07001// Copyright 2021, The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "system_security_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["system_security_license"],
22}
23
24rust_library {
25 name: "libdiced_utils",
26 crate_name: "diced_utils",
27 srcs: ["src/utils.rs"],
28
29 rustlibs: [
30 "android.hardware.security.dice-V1-rust",
31 "libanyhow",
32 "libdiced_open_dice_cbor",
33 "libkeystore2_crypto_rust",
34 ],
35}
36
37rust_test {
38 name: "diced_utils_test",
39 crate_name: "diced_utils_test",
40 srcs: ["src/utils.rs"],
41 test_suites: ["general-tests"],
42 auto_gen_config: true,
43 rustlibs: [
44 "android.hardware.security.dice-V1-rust",
45 "libanyhow",
46 "libdiced_open_dice_cbor",
47 "libkeystore2_crypto_rust",
48 ],
49}
50
51rust_library {
52 name: "libdiced_sample_inputs",
53 crate_name: "diced_sample_inputs",
54 srcs: ["src/sample_inputs.rs"],
55
56 rustlibs: [
57 "android.hardware.security.dice-V1-rust",
58 "libanyhow",
59 "libdiced_open_dice_cbor",
60 "libdiced_utils",
61 "libkeystore2_crypto_rust",
62 ],
63}
64
65rust_test {
66 name: "diced_sample_inputs_test",
67 crate_name: "diced_sample_inputs_test",
68 srcs: ["src/sample_inputs.rs"],
69 test_suites: ["general-tests"],
70 auto_gen_config: true,
71 rustlibs: [
72 "android.hardware.security.dice-V1-rust",
73 "libanyhow",
74 "libdiced_open_dice_cbor",
75 "libdiced_utils",
76 "libkeystore2_crypto_rust",
77 ],
78}
79
80rust_library {
81 name: "libdiced",
82 crate_name: "diced",
83 srcs: ["src/lib.rs"],
84
85 rustlibs: [
86 "android.hardware.security.dice-V1-rust",
87 "android.security.dice-rust",
88 "libdiced_open_dice_cbor",
89 "libanyhow",
90 "libbinder_rs",
91 "libdiced_utils",
92 "libkeystore2_crypto_rust",
93 "libkeystore2_selinux",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070094 "liblibc",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070095 "liblog_rust",
96 "libthiserror",
97 ],
98}
99
100rust_binary {
101 name: "diced",
102 srcs: ["src/diced_main.rs"],
103 rustlibs: [
104 "libandroid_logger",
105 "libbinder_rs",
106 "libdiced",
107 "libdiced_open_dice_cbor",
Janis Danisevskis99652dc2021-10-20 15:59:33 -0700108 "libdiced_sample_inputs",
Janis Danisevskisc51dff82021-10-20 09:51:16 -0700109 "libdiced_utils",
110 "liblog_rust",
111 ],
112 init_rc: ["diced.rc"],
113}
114
115rust_test {
116 name: "diced_test",
117 crate_name: "diced_test",
118 srcs: ["src/lib.rs"],
119 test_suites: ["general-tests"],
120 auto_gen_config: true,
121 rustlibs: [
122 "android.hardware.security.dice-V1-rust",
123 "android.security.dice-rust",
124 "libanyhow",
125 "libbinder_rs",
126 "libdiced_open_dice_cbor",
127 "libdiced_utils",
128 "libkeystore2_crypto_rust",
129 "libkeystore2_selinux",
130 "libkeystore2_vintf_rust",
131 "liblibc",
132 "liblog_rust",
133 "libthiserror",
134 ],
135}