diff --git a/Cargo.lock b/Cargo.lock index 7fb16aa4..6b90e093 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,6 +178,7 @@ dependencies = [ "trussed", "trussed-auth", "trussed-chunked", + "trussed-fs-info", "trussed-hkdf", "trussed-manage", "trussed-rsa-alloc", @@ -494,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.3#b2427e67ac8ff53f012986d954586fa18d5e6921" +source = "git+https://github.com/Nitrokey/cbor-smol.git?tag=v0.4.0-nitrokey.4#d6211450a8e29fcf8cd41b01104c32ac15370508" dependencies = [ "delog", "heapless", @@ -872,9 +873,9 @@ dependencies = [ [[package]] name = "ctap-types" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb60d898980133d08bc1c5f3fc3facecf18833bf4ff3d962871bb43607ac0b81" +checksum = "bf6a69fe79c279d4e06b0064d25ee7d05f87d55c06e07a1386043bc14bbd5c6d" dependencies = [ "bitflags 1.3.2", "cbor-smol", @@ -1174,9 +1175,10 @@ dependencies = [ [[package]] name = "fido-authenticator" version = "0.1.1" -source = "git+https://github.com/Nitrokey/fido-authenticator.git?tag=v0.1.1-nitrokey.16#79b05b576863236fe54750b18e862ce0801f2040" +source = "git+https://github.com/Nitrokey/fido-authenticator.git?tag=v0.1.1-nitrokey.19#0fdecc93df800543aed0f1de0ea0f7178cf93b80" dependencies = [ "apdu-dispatch", + "cbor-smol", "cosey", "ctap-types", "ctaphid-dispatch", @@ -1189,6 +1191,7 @@ dependencies = [ "sha2", "trussed", "trussed-chunked", + "trussed-fs-info", "trussed-hkdf", ] @@ -3212,6 +3215,16 @@ dependencies = [ "trussed", ] +[[package]] +name = "trussed-fs-info" +version = "0.1.0" +source = "git+https://github.com/trussed-dev/trussed-staging.git?tag=fs-info-v0.1.0#72b082002e0869facfc11bf8d76a1272c7ddf4ee" +dependencies = [ + "serde", + "serde-byte-array", + "trussed", +] + [[package]] name = "trussed-hkdf" version = "0.2.0" @@ -3290,7 +3303,7 @@ dependencies = [ [[package]] name = "trussed-staging" version = "0.3.0" -source = "git+https://github.com/trussed-dev/trussed-staging.git?tag=v0.3.0#e016b25fbc49f3ba13272d58a9e9d47a16d8ea14" +source = "git+https://github.com/trussed-dev/trussed-staging.git?tag=v0.3.1#72b082002e0869facfc11bf8d76a1272c7ddf4ee" dependencies = [ "chacha20poly1305", "delog", @@ -3302,6 +3315,7 @@ dependencies = [ "sha2", "trussed", "trussed-chunked", + "trussed-fs-info", "trussed-hkdf", "trussed-manage", "trussed-wrap-key-to-file", @@ -3614,7 +3628,7 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "webcrypt" version = "0.8.0" -source = "git+https://github.com/nitrokey/nitrokey-websmartcard-rust?tag=v0.8.0-rc8#d6705ab95cbc3dd2e4120a5dfa1b8b5a2707b1c7" +source = "git+https://github.com/nitrokey/nitrokey-websmartcard-rust?tag=v0.8.0-rc9#5179795e6b1015efcfbbe22ad555fc5ae63d09bd" dependencies = [ "apdu-dispatch", "cbor-smol", @@ -3840,3 +3854,8 @@ dependencies = [ "quote", "syn 2.0.69", ] + +[[patch.unused]] +name = "ctap-types" +version = "0.2.0" +source = "git+https://github.com/trussed-dev/ctap-types.git?rev=72eb68b61e3f14957c5ab89bd22f776ac860eb62#72eb68b61e3f14957c5ab89bd22f776ac860eb62" diff --git a/Cargo.toml b/Cargo.toml index 8fb93be9..45f9a6fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,8 @@ 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.3"} -fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.16" } +cbor-smol = { git = "https://github.com/Nitrokey/cbor-smol.git", tag = "v0.4.0-nitrokey.4"} +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" } @@ -31,16 +31,18 @@ littlefs2-sys = { git = "https://github.com/trussed-dev/littlefs2-sys.git", rev usbd-ctaphid = { git = "https://github.com/trussed-dev/usbd-ctaphid.git", rev = "dcff9009c3cd1ef9e5b09f8f307aca998fc9a8c8" } usbd-ccid = { git = "https://github.com/Nitrokey/usbd-ccid", tag = "v0.2.0-nitrokey.1" } p256-cortex-m4 = { git = "https://github.com/ycrypto/p256-cortex-m4.git", rev = "cdb31e12594b4dc1f045b860a885fdc94d96aee2" } +ctap-types = { git = "https://github.com/trussed-dev/ctap-types.git", rev = "72eb68b61e3f14957c5ab89bd22f776ac860eb62" } # unreleased crates secrets-app = { git = "https://github.com/Nitrokey/trussed-secrets-app", tag = "v0.13.0" } -webcrypt = { git = "https://github.com/nitrokey/nitrokey-websmartcard-rust", tag = "v0.8.0-rc8" } +webcrypt = { git = "https://github.com/nitrokey/nitrokey-websmartcard-rust", tag = "v0.8.0-rc9" } opcard = { git = "https://github.com/Nitrokey/opcard-rs", tag = "v1.5.0" } piv-authenticator = { git = "https://github.com/Nitrokey/piv-authenticator.git", tag = "v0.3.7" } +trussed-fs-info = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "fs-info-v0.1.0" } trussed-chunked = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "chunked-v0.1.0" } trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" } trussed-wrap-key-to-file = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "wrap-key-to-file-v0.1.0" } -trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "v0.3.0" } +trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "v0.3.1" } trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", rev = "947ffe6cff426ccbbbb2d0f689437f427665919e" } trussed-hkdf = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "hkdf-v0.2.0" } trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.2.1" } diff --git a/components/apps/Cargo.toml b/components/apps/Cargo.toml index 4910492a..5ce688ef 100644 --- a/components/apps/Cargo.toml +++ b/components/apps/Cargo.toml @@ -23,7 +23,7 @@ littlefs2 = "0.4" trussed-auth = { version = "0.3.0", optional = true } trussed-rsa-alloc = { version = "0.2.0", optional = true } trussed-se050-backend = { version = "0.3.0", optional = true } -trussed-staging = { version = "0.3.0", features = ["wrap-key-to-file", "chunked", "hkdf", "manage"] } +trussed-staging = { version = "0.3.0", features = ["wrap-key-to-file", "chunked", "hkdf", "manage", "fs-info"] } # Extensions trussed-chunked = "0.1.0" @@ -31,6 +31,7 @@ trussed-hkdf = "0.2.0" trussed-manage = "0.1.0" trussed-se050-manage = { version = "0.1.0", optional = true } trussed-wrap-key-to-file = "0.1.0" +trussed-fs-info = "0.1.0" # apps admin-app = "0.1.0" diff --git a/components/apps/src/dispatch.rs b/components/apps/src/dispatch.rs index bc50e226..fdae5660 100644 --- a/components/apps/src/dispatch.rs +++ b/components/apps/src/dispatch.rs @@ -37,6 +37,7 @@ use trussed_auth::{AuthBackend, AuthContext, AuthExtension, MAX_HW_KEY_LEN}; use trussed_rsa_alloc::SoftwareRsa; use trussed_chunked::ChunkedExtension; +use trussed_fs_info::FsInfoExtension; use trussed_hkdf::HkdfExtension; use trussed_manage::ManageExtension; use trussed_staging::{StagingBackend, StagingContext}; @@ -306,6 +307,15 @@ impl ExtensionDispatch for Dispatch { request, resources, ), + Extension::FsInfo => { + ExtensionImpl::::extension_request_serialized( + &mut self.staging, + &mut ctx.core, + &mut ctx.backends.staging, + request, + resources, + ) + } #[allow(unreachable_patterns)] _ => Err(TrussedError::RequestNotAvailable), }, @@ -395,6 +405,7 @@ pub enum Extension { Chunked, WrapKeyToFile, Manage, + FsInfo, #[cfg(feature = "webcrypt")] HmacSha256P256, #[cfg(feature = "se050")] @@ -414,6 +425,7 @@ impl From for u8 { #[cfg(feature = "se050")] Extension::Se050Manage => 5, Extension::Hkdf => 6, + Extension::FsInfo => 7, } } } @@ -433,6 +445,7 @@ impl TryFrom for Extension { #[cfg(feature = "se050")] 5 => Ok(Extension::Se050Manage), 6 => Ok(Extension::Hkdf), + 7 => Ok(Extension::FsInfo), _ => Err(TrussedError::InternalError), } } @@ -483,6 +496,12 @@ impl ExtensionId for Dispatch { const ID: Self::Id = Self::Id::Se050Manage; } +impl ExtensionId for Dispatch { + type Id = Extension; + + const ID: Self::Id = Self::Id::FsInfo; +} + #[cfg(test)] mod tests { use super::*;