blob: 3ba2c012686ad362ee9d6371fc68ae0b003b7c31 [file] [log] [blame]
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
group("tests") {
testonly = true
deps = [ ":kms_tests" ]
}
rustc_binary("bin") {
name = "kms"
edition = "2018"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.kms:fuchsia.kms-rustc",
"//sdk/fidl/fuchsia.mem:fuchsia.mem-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/mundane:mundane",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/boringssl/rust/boringssl-sys",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:base64",
"//third_party/rust_crates:bincode",
"//third_party/rust_crates:byteorder",
"//third_party/rust_crates:bytes",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:log",
"//third_party/rust_crates:rand",
"//third_party/rust_crates:rust-crypto",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:tempfile",
"//third_party/rust_crates:thiserror",
]
non_rust_deps = [ "//zircon/system/ulib/tee-client-api" ]
sources = [
"src/common.rs",
"src/crypto_provider/mock_provider.rs",
"src/crypto_provider/mod.rs",
"src/crypto_provider/mundane_provider.rs",
"src/crypto_provider/optee_provider/boringssl_wrapper.rs",
"src/crypto_provider/optee_provider/keysafe.rs",
"src/crypto_provider/optee_provider/mod.rs",
"src/crypto_provider/software_provider.rs",
"src/key_manager.rs",
"src/kms_asymmetric_key.rs",
"src/kms_sealing_key.rs",
"src/main.rs",
"src/tee/mod.rs",
"src/tee/tee_client_api.rs",
]
}
package("kms") {
deps = [ ":bin" ]
binaries = [
{
name = "kms"
},
]
meta = [
{
path = rebase_path("meta/key_manager.cmx")
dest = "key_manager.cmx"
},
]
}
test_package("kms_tests") {
deps = [ ":bin_test" ]
tests = [
{
name = "kms_bin_test"
dest = "kms_bin_test"
},
]
}
config_data("optee_provider_config") {
sources = [ "config/optee_provider_config.json" ]
for_pkg = "kms"
outputs = [ "crypto_provider_config.json" ]
}
config_data("optee_provider_test_config") {
sources = [ "config/optee_provider_config.json" ]
for_pkg = "kms_test_client_pkg"
outputs = [ "crypto_provider_config.json" ]
}