blob: dfa81ec43c84a9a7e58d3778a75992b19afa5877 [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",
Alice Wang8722d9e2023-02-13 14:56:56 +000033 "libdiced_open_dice",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070034 "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",
Alice Wang8722d9e2023-02-13 14:56:56 +000047 "libdiced_open_dice",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070048 "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",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070063 ],
64}
65
66rust_test {
67 name: "diced_sample_inputs_test",
68 crate_name: "diced_sample_inputs_test",
69 srcs: ["src/sample_inputs.rs"],
70 test_suites: ["general-tests"],
71 auto_gen_config: true,
72 rustlibs: [
73 "android.hardware.security.dice-V1-rust",
74 "libanyhow",
75 "libdiced_open_dice_cbor",
76 "libdiced_utils",
Janis Danisevskisc51dff82021-10-20 09:51:16 -070077 ],
78}
79
80rust_library {
Janis Danisevskisaaba4af2021-11-18 14:25:07 -080081 name: "libdiced_vendor",
82 crate_name: "diced",
83 srcs: ["src/lib_vendor.rs"],
84
85 vendor_available: true,
86 rustlibs: [
87 "android.hardware.security.dice-V1-rust",
88 "libdiced_open_dice_cbor",
89 "libanyhow",
90 "libbinder_rs",
91 "libdiced_utils",
92 "libkeystore2_crypto_rust",
93 "liblibc",
94 "liblog_rust",
95 "libnix",
96 "libserde",
97 "libserde_cbor",
98 "libthiserror",
99 ],
100}
101
Janis Danisevskisc51dff82021-10-20 09:51:16 -0700102rust_test {
Janis Danisevskisaaba4af2021-11-18 14:25:07 -0800103 name: "diced_vendor_test",
104 crate_name: "diced_vendor_test",
105 srcs: ["src/lib_vendor.rs"],
106 test_suites: ["general-tests"],
107 auto_gen_config: true,
108 rustlibs: [
109 "android.hardware.security.dice-V1-rust",
110 "libanyhow",
111 "libdiced_open_dice_cbor",
112 "libdiced_sample_inputs",
113 "libdiced_utils",
114 "libbinder_rs",
115 "libkeystore2_crypto_rust",
116 "liblibc",
117 "liblog_rust",
118 "libnix",
119 "libserde",
120 "libserde_cbor",
Janis Danisevskisc51dff82021-10-20 09:51:16 -0700121 "libthiserror",
122 ],
123}
Janis Danisevskisda092a12021-11-17 22:58:16 -0800124
125rust_test {
126 name: "diced_client_test",
127 srcs: [
128 "src/diced_client_test.rs",
129 ],
130 require_root: true,
131 auto_gen_config: true,
132 test_suites: [
133 "general-tests",
134 ],
135
136 rustlibs: [
137 "android.hardware.security.dice-V1-rust",
138 "android.security.dice-rust",
139 "libanyhow",
140 "libbinder_rs",
141 "libdiced_open_dice_cbor",
142 "libdiced_sample_inputs",
143 "libdiced_utils",
144 "libnix",
145 ],
146}