diff --git a/Cargo.lock b/Cargo.lock index 55edbe6f..1ce6c9e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,7 +5,7 @@ version = 3 [[package]] name = "admin-app" version = "0.1.0" -source = "git+https://github.com/Nitrokey/admin-app.git?tag=v0.1.0-nitrokey.13#c24149193fb9bdcaa9ed4dd99fd2a503159a66ee" +source = "git+https://github.com/Nitrokey/admin-app.git?rev=e4d636f84cd7184b5c3af6e65357b122dda7f97c#e4d636f84cd7184b5c3af6e65357b122dda7f97c" dependencies = [ "apdu-dispatch", "cbor-smol", @@ -495,7 +495,7 @@ dependencies = [ [[package]] name = "cbor-smol" version = "0.4.0" -source = "git+https://github.com/Nitrokey/cbor-smol.git?tag=v0.4.0-nitrokey.4#d6211450a8e29fcf8cd41b01104c32ac15370508" +source = "git+https://github.com/trussed-dev/cbor-smol.git?rev=c0e68c70d144ab815440f859cbd633239d5d9e80#c0e68c70d144ab815440f859cbd633239d5d9e80" dependencies = [ "delog", "heapless", @@ -1726,7 +1726,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d2a6b10d..9a7565c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ version = "1.7.2" memory-regions = { path = "components/memory-regions" } # forked -admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.13" } -cbor-smol = { git = "https://github.com/Nitrokey/cbor-smol.git", tag = "v0.4.0-nitrokey.4"} +admin-app = { git = "https://github.com/Nitrokey/admin-app.git", rev = "e4d636f84cd7184b5c3af6e65357b122dda7f97c" } +cbor-smol = { git = "https://github.com/trussed-dev/cbor-smol.git", rev = "c0e68c70d144ab815440f859cbd633239d5d9e80" } fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.19" } lpc55-hal = { git = "https://github.com/Nitrokey/lpc55-hal", tag = "v0.3.0-nitrokey.2" } trussed = { git = "https://github.com/nitrokey/trussed.git", tag = "v0.1.0-nitrokey.21" } diff --git a/components/apps/Cargo.toml b/components/apps/Cargo.toml index 5ce688ef..2b88b7f2 100644 --- a/components/apps/Cargo.toml +++ b/components/apps/Cargo.toml @@ -10,6 +10,7 @@ bitflags = "2" ctaphid-dispatch = "0.1" embedded-hal = "0.2.7" heapless = "0.7" +heapless-bytes = "0.3" se05x = { version = "0.1.1", optional = true} serde = { version = "1.0.180", default-features = false } trussed = { version = "0.1", features = ["serde-extensions"] } diff --git a/components/apps/src/lib.rs b/components/apps/src/lib.rs index 9495156c..7932f05a 100644 --- a/components/apps/src/lib.rs +++ b/components/apps/src/lib.rs @@ -17,6 +17,7 @@ use heapless::Vec; #[cfg(any(feature = "factory-reset", feature = "se050"))] use littlefs2::path; +use admin_app::ConfigField; #[cfg(feature = "factory-reset")] use admin_app::ResetConfigResult; @@ -82,6 +83,24 @@ impl admin_app::Config for Config { } } + fn list_available_config(&self) -> &'static [ConfigField] { + &[ + ConfigField { + name: "fido.disable_skip_up_timeout", + requires_touch: false, + requires_reboot: false, + destructive: false, + }, + #[cfg(feature = "se050")] + ConfigField { + name: "opcard.use_se050_backend", + requires_touch: true, + requires_reboot: true, + destructive: true, + }, + ] + } + fn reset_client_id( &self, key: &str, @@ -1103,8 +1122,8 @@ impl App for ProvisionerApp { #[cfg(test)] mod tests { - use super::{Config, FidoConfig, OpcardConfig}; - use cbor_smol::{cbor_serialize_bytes, Bytes}; + use super::{Config, FidoConfig, OpcardConfig, PivConfig}; + use cbor_smol::cbor_serialize_bytes; #[test] fn test_config_size() { @@ -1115,10 +1134,14 @@ mod tests { opcard: OpcardConfig { #[cfg(feature = "se050")] use_se050_backend: true, + disabled: true, + }, + piv: PivConfig { + disabled: true, }, fs_version: 1, }; - let data: Bytes<1024> = cbor_serialize_bytes(&config).unwrap(); + let data: heapless_bytes::Bytes<1024> = cbor_serialize_bytes(&config).unwrap(); // littlefs2 is most efficient with files < 1/4 of the block size. The block sizes are 512 // bytes for LPC55 and 256 bytes for NRF52. As the block count is only problematic on the // LPC55, this could be increased to 128 if necessary.