1// 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 vendor_available: true, 29 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"], 56 vendor_available: true, 57 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", 96 "liblibc", 97 "liblog_rust", 98 "libthiserror", 99 ], 100} 101 102rust_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 124rust_binary { 125 name: "diced", 126 srcs: ["src/diced_main.rs"], 127 prefer_rlib: true, 128 rustlibs: [ 129 "android.hardware.security.dice-V1-rust", 130 "libandroid_logger", 131 "libbinder_rs", 132 "libdiced", 133 "libdiced_open_dice_cbor", 134 "libdiced_sample_inputs", 135 "libdiced_utils", 136 "liblog_rust", 137 ], 138 init_rc: ["diced.rc"], 139} 140 141rust_binary { 142 name: "diced.microdroid", 143 srcs: ["src/diced_main.rs"], 144 prefer_rlib: true, 145 rustlibs: [ 146 "android.hardware.security.dice-V1-rust", 147 "libandroid_logger", 148 "libbinder_rs", 149 "libdiced", 150 "libdiced_open_dice_cbor", 151 "libdiced_sample_inputs", 152 "libdiced_utils", 153 "liblog_rust", 154 ], 155 init_rc: ["diced.microdroid.rc"], 156 bootstrap: true, 157} 158 159rust_test { 160 name: "diced_test", 161 crate_name: "diced_test", 162 srcs: ["src/lib.rs"], 163 test_suites: ["general-tests"], 164 auto_gen_config: true, 165 rustlibs: [ 166 "android.hardware.security.dice-V1-rust", 167 "android.security.dice-rust", 168 "libanyhow", 169 "libbinder_rs", 170 "libdiced_open_dice_cbor", 171 "libdiced_utils", 172 "libkeystore2_crypto_rust", 173 "libkeystore2_selinux", 174 "libkeystore2_vintf_rust", 175 "liblibc", 176 "liblog_rust", 177 "libnix", 178 "libserde", 179 "libserde_cbor", 180 "libthiserror", 181 ], 182} 183 184rust_test { 185 name: "diced_vendor_test", 186 crate_name: "diced_vendor_test", 187 srcs: ["src/lib_vendor.rs"], 188 test_suites: ["general-tests"], 189 auto_gen_config: true, 190 rustlibs: [ 191 "android.hardware.security.dice-V1-rust", 192 "libanyhow", 193 "libdiced_open_dice_cbor", 194 "libdiced_sample_inputs", 195 "libdiced_utils", 196 "libbinder_rs", 197 "libkeystore2_crypto_rust", 198 "liblibc", 199 "liblog_rust", 200 "libnix", 201 "libserde", 202 "libserde_cbor", 203 "libthiserror", 204 ], 205} 206 207rust_test { 208 name: "diced_client_test", 209 srcs: [ 210 "src/diced_client_test.rs", 211 ], 212 require_root: true, 213 auto_gen_config: true, 214 test_suites: [ 215 "general-tests", 216 ], 217 218 rustlibs: [ 219 "android.hardware.security.dice-V1-rust", 220 "android.security.dice-rust", 221 "libanyhow", 222 "libbinder_rs", 223 "libdiced_open_dice_cbor", 224 "libdiced_sample_inputs", 225 "libdiced_utils", 226 "libnix", 227 ], 228} 229