From 73458dbd4cc630b1f86a931f78a5cb9e82978043 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 1 Feb 2025 02:31:59 +0800 Subject: [PATCH] make a wish list of the dependencies we want to isolate gate the dependencies behind a "gen1" and "gen2" feature flag. --- services/pddb/Cargo.toml | 54 +++++++++++++++++++++++++++++++--------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/services/pddb/Cargo.toml b/services/pddb/Cargo.toml index 3767a60f9..fb62d206d 100644 --- a/services/pddb/Cargo.toml +++ b/services/pddb/Cargo.toml @@ -13,7 +13,7 @@ xous-ipc = "0.10.4" log-server = { package = "xous-api-log", version = "0.1.63" } ticktimer-server = { package = "xous-api-ticktimer", version = "0.9.63" } xous-names = { package = "xous-api-names", version = "0.9.65" } -susres = { package = "xous-api-susres", version = "0.9.63" } +susres = { package = "xous-api-susres", version = "0.9.63", optional = true } log = "0.4.14" num-derive = { version = "0.4.2", default-features = false } num-traits = { version = "0.2.14", default-features = false } @@ -21,10 +21,10 @@ rkyv = { version = "0.8.8", default-features = false, features = [ "std", "alloc", ] } -trng = { path = "../trng" } -spinor = { path = "../spinor" } +trng = { path = "../trng", optional = true } +spinor = { path = "../spinor", optional = true } aes = { path = "../aes" } -root-keys = { path = "../root-keys" } +root-keys = { path = "../root-keys", optional = true } cipher = "0.4.2" bitfield = "0.13.2" aes-gcm-siv = { version = "0.11.1", default-features = false, features = [ @@ -32,10 +32,11 @@ aes-gcm-siv = { version = "0.11.1", default-features = false, features = [ "aes", ] } # aes-gcm-siv = {git="https://github.com/RustCrypto/AEADs.git", branch="master"} -llio = { path = "../llio" } +llio = { path = "../llio", optional = true } subtle = { version = "2.4.1", default-features = false } -tts-frontend = { path = "../tts" } +tts-frontend = { path = "../tts", optional = true } rand_core = "0.6.4" +cram-hal-service = { path = "../cram-hal-service", optional = true } # passwords sha2 = { version = "0.10.8" } @@ -48,9 +49,9 @@ zeroize_derive = "1.4.2" blowfish = { version = "0.9.1", features = ["bcrypt"] } # UX (for password entry and notifications) -gam = { path = "../gam" } -locales = { path = "../../locales" } -modals = { path = "../modals" } +gam = { path = "../gam", optional = true } +locales = { path = "../../locales", optional = true } +modals = { path = "../modals", optional = true } utralib = { version = "0.1.25", optional = true, default-features = false } @@ -66,9 +67,38 @@ hex = { version = "0.4.3", default-features = false, features = [ ], optional = true } [features] -precursor = ["utralib/precursor", "sha2/precursor"] -hosted = ["utralib/hosted", "sha2/hosted"] -renode = ["utralib/renode", "sha2/renode"] +precursor = ["utralib/precursor", "sha2/precursor", "gen1"] +hosted = ["utralib/hosted", "sha2/hosted", "gen1"] +renode = ["utralib/renode", "sha2/renode", "gen1"] +cramium-soc = ["utralib/cramium-soc", "gen2", "cram-hal-service"] + +# gen1 PDDB pulls in the graphical libraries for direct capture of passwords +# from users. This gives maximum control over the flow of sensitive password data, +# but also complicates the code base and dependencies, making it less portable. + +# gen2 PDDB focuses on cross-platform portability, keeping the PDDB dependencies tightly +# focused on just doing what the PDDB needs to do from a filesystem perspective. This +# means that the PDDB must inevitably rely upon some less well specified mechanism for +# gathering password materials from the user. + +# gen-1 implementation feature set +gen1 = [ + "susres", + "trng", + "spinor", + "root-keys", + "llio", + "tts-frontend", + "gam", + "locales", + "modals", +] + +# gen-2 features +gen2 = [] +# gen-2 boards +board-baosec = [] + # when selected, physical disk addresses are set to 64 bits, otherwise, they are 32 bits. # 32 bit addressing is recommended for Precursor, as its disk is only 128MiB and it has limited RAM for bookkeeping. u64_pa = []