blob: bef1dec30ce3a0f079a585f212314104cdc05d1c [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"],
Janis Danisevskisaaba4af2021-11-18 14:25:07 -080028 vendor_available: true,
Janis Danisevskisc51dff82021-10-20 09:51:16 -070029
30 rustlibs: [
31 "android.hardware.security.dice-V1-rust",
32 "libanyhow",
33 "libdiced_open_dice_cbor",
34 "libkeystore2_crypto_rust",
35 ],
36}
37
38rust_test {
39 name: "diced_utils_test",
40 crate_name: "diced_utils_test",
41 srcs: ["src/utils.rs"],
42 test_suites: ["general-tests"],
43 auto_gen_config: true,
44 rustlibs: [
45 "android.hardware.security.dice-V1-rust",
46 "libanyhow",
47 "libdiced_open_dice_cbor",
48 "libkeystore2_crypto_rust",
49 ],
50}
51
52rust_library {
53 name: "libdiced_sample_inputs",
54 crate_name: "diced_sample_inputs",
55 srcs: ["src/sample_inputs.rs"],
Janis Danisevskisaaba4af2021-11-18 14:25:07 -080056 vendor_available: true,
Janis Danisevskisc51dff82021-10-20 09:51:16 -070057
58 rustlibs: [
59 "android.hardware.security.dice-V1-rust",
60 "libanyhow",
61 "libdiced_open_dice_cbor",
62 "libdiced_utils",
63 "libkeystore2_crypto_rust",
64 ],
65}
66
67rust_test {
68 name: "diced_sample_inputs_test",
69 crate_name: "diced_sample_inputs_test",
70 srcs: ["src/sample_inputs.rs"],
71 test_suites: ["general-tests"],
72 auto_gen_config: true,
73 rustlibs: [
74 "android.hardware.security.dice-V1-rust",
75 "libanyhow",
76 "libdiced_open_dice_cbor",
77 "libdiced_utils",
78 "libkeystore2_crypto_rust",
79 ],
80}
81
82rust_library {
83 name: "libdiced",
84 crate_name: "diced",
85 srcs: ["src/lib.rs"],
86
87 rustlibs: [
88 "android.hardware.security.dice-V1-rust",
89 "android.security.dice-rust",
90 "libdiced_open_dice_cbor",
91 "libanyhow",
92 "libbinder_rs",
93 "libdiced_utils",
94 "libkeystore2_crypto_rust",
95 "libkeystore2_selinux",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070096 "liblibc",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070097 "liblog_rust",
98 "libthiserror",
99 ],
100}
101
Janis Danisevskisaaba4af2021-11-18 14:25:07 -0800102rust_library {
103 name: "libdiced_vendor",
104 crate_name: "diced",
105 srcs: ["src/lib_vendor.rs"],
106
107 vendor_available: true,
108 rustlibs: [
109 "android.hardware.security.dice-V1-rust",
110 "libdiced_open_dice_cbor",
111 "libanyhow",
112 "libbinder_rs",
113 "libdiced_utils",
114 "libkeystore2_crypto_rust",
115 "liblibc",
116 "liblog_rust",
117 "libnix",
118 "libserde",
119 "libserde_cbor",
120 "libthiserror",
121 ],
122}
123
Janis Danisevskisc51dff82021-10-20 09:51:16 -0700124rust_binary {
125 name: "diced",
126 srcs: ["src/diced_main.rs"],
127 rustlibs: [
128 "libandroid_logger",
129 "libbinder_rs",
130 "libdiced",
131 "libdiced_open_dice_cbor",
Janis Danisevskis99652dc2021-10-20 15:59:33 -0700132 "libdiced_sample_inputs",
Janis Danisevskisc51dff82021-10-20 09:51:16 -0700133 "libdiced_utils",
134 "liblog_rust",
135 ],
136 init_rc: ["diced.rc"],
137}
138
139rust_test {
140 name: "diced_test",
141 crate_name: "diced_test",
142 srcs: ["src/lib.rs"],
143 test_suites: ["general-tests"],
144 auto_gen_config: true,
145 rustlibs: [
146 "android.hardware.security.dice-V1-rust",
147 "android.security.dice-rust",
148 "libanyhow",
149 "libbinder_rs",
150 "libdiced_open_dice_cbor",
151 "libdiced_utils",
152 "libkeystore2_crypto_rust",
153 "libkeystore2_selinux",
154 "libkeystore2_vintf_rust",
155 "liblibc",
156 "liblog_rust",
Janis Danisevskisaaba4af2021-11-18 14:25:07 -0800157 "libnix",
158 "libserde",
159 "libserde_cbor",
160 "libthiserror",
161 ],
162}
163
164rust_test {
165 name: "diced_vendor_test",
166 crate_name: "diced_vendor_test",
167 srcs: ["src/lib_vendor.rs"],
168 test_suites: ["general-tests"],
169 auto_gen_config: true,
170 rustlibs: [
171 "android.hardware.security.dice-V1-rust",
172 "libanyhow",
173 "libdiced_open_dice_cbor",
174 "libdiced_sample_inputs",
175 "libdiced_utils",
176 "libbinder_rs",
177 "libkeystore2_crypto_rust",
178 "liblibc",
179 "liblog_rust",
180 "libnix",
181 "libserde",
182 "libserde_cbor",
Janis Danisevskisc51dff82021-10-20 09:51:16 -0700183 "libthiserror",
184 ],
185}
Janis Danisevskisda092a12021-11-17 22:58:16 -0800186
187rust_test {
188 name: "diced_client_test",
189 srcs: [
190 "src/diced_client_test.rs",
191 ],
192 require_root: true,
193 auto_gen_config: true,
194 test_suites: [
195 "general-tests",
196 ],
197
198 rustlibs: [
199 "android.hardware.security.dice-V1-rust",
200 "android.security.dice-rust",
201 "libanyhow",
202 "libbinder_rs",
203 "libdiced_open_dice_cbor",
204 "libdiced_sample_inputs",
205 "libdiced_utils",
206 "libnix",
207 ],
208}