| # Copyright 2021 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/components.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| rustc_binary("bin") { |
| name = "password_authenticator" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":password_authenticator_config", |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.device:fuchsia.device-rustc", |
| "//sdk/fidl/fuchsia.hardware.block:fuchsia.hardware.block-rustc", |
| "//sdk/fidl/fuchsia.hardware.block.encrypted:fuchsia.hardware.block.encrypted-rustc", |
| "//sdk/fidl/fuchsia.hardware.block.partition:fuchsia.hardware.block.partition-rustc", |
| "//sdk/fidl/fuchsia.identity.account:fuchsia.identity.account-rustc", |
| "//sdk/fidl/fuchsia.identity.credential:fuchsia.identity.credential-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle-rustc", |
| "//src/identity/lib/identity_common", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/storage/fs_management/rust:fs_management", |
| "//src/lib/storage/fuchsia-vfs-watcher", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hmac", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:rand", |
| "//third_party/rust_crates:scrypt", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:sha2", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| test_deps = [ |
| ":test.identity-rustc", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/account.rs", |
| "src/account_manager.rs", |
| "src/account_metadata.rs", |
| "src/constants.rs", |
| "src/disk_management.rs", |
| "src/keys.rs", |
| "src/main.rs", |
| "src/pinweaver.rs", |
| "src/scrypt.rs", |
| "src/testing.rs", |
| ] |
| } |
| |
| fuchsia_component_manifest("manifest") { |
| component_name = "password-authenticator" |
| manifest = "meta/password-authenticator.cml" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_structured_config_values("config") { |
| cm_label = ":manifest" |
| values = { |
| allow_scrypt = true |
| allow_pinweaver = false |
| } |
| } |
| |
| fuchsia_structured_config_rust_lib("password_authenticator_config") { |
| cm_label = ":manifest" |
| } |
| |
| fuchsia_package("password_authenticator") { |
| deps = [ |
| ":component", |
| ":config", |
| "//src/storage/bin/minfs", |
| ] |
| } |
| |
| fuchsia_unittest_package("password-authenticator-tests") { |
| manifest = "meta/password-authenticator-test.cml" |
| deps = [ |
| ":bin_test", |
| "//src/sys/test_runners:tmp_storage", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| fidl("test.identity") { |
| sources = [ "block.test.fidl" ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.device", |
| "//sdk/fidl/fuchsia.hardware.block", |
| "//sdk/fidl/fuchsia.hardware.block.partition", |
| "//sdk/fidl/fuchsia.io", |
| "//sdk/fidl/fuchsia.mem", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ ":password-authenticator-tests" ] |
| } |