diff --git a/Cargo.lock b/Cargo.lock index b9185af..918181c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -170,8 +170,7 @@ dependencies = [ [[package]] name = "cbor-smol" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d516e3e353d5fc5ee156028f43224033430fd08ef05f8d5dba18a57a4ee5df49" +source = "git+https://github.com/Nitrokey/cbor-smol.git?tag=v0.4.0-nitrokey.4#d6211450a8e29fcf8cd41b01104c32ac15370508" dependencies = [ "delog", "heapless", @@ -302,9 +301,9 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "cosey" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb743c2c58b69b970e02f5ba7f552f75fcfc8393768e3ae4316e055aabacfdaa" +checksum = "39323fe531b92e7acad90b8550b58cec63d29a6c5a56e02de4b25b6aeedbf82e" dependencies = [ "heapless-bytes", "serde", @@ -389,9 +388,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", @@ -577,11 +576,12 @@ 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.18#58a8ca1166cdda5dc7119ae393b05f71a16164be" dependencies = [ "apdu-dispatch", + "cbor-smol", "cosey", - "ctap-types 0.2.0", + "ctap-types 0.3.0", "ctaphid-dispatch", "delog", "heapless", @@ -591,6 +591,7 @@ dependencies = [ "serde_bytes", "sha2 0.10.8", "trussed", + "trussed-fs-info", "trussed-hkdf", ] @@ -792,8 +793,9 @@ dependencies = [ [[package]] name = "iso7816" -version = "0.1.1" -source = "git+https://github.com/Nitrokey/iso7816.git?tag=v0.1.1-nitrokey.1#d1ee4146c43b9f25d21821c70fefdd87b886f4a9" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3af73ac9c821e7aea3280532118e15cdf9e7bb45c923cbf0e319ae25b27d20c" dependencies = [ "delog", "heapless", @@ -1730,6 +1732,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" @@ -1765,7 +1777,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", @@ -1777,6 +1789,7 @@ dependencies = [ "sha2 0.10.8", "trussed", "trussed-chunked", + "trussed-fs-info", "trussed-hkdf", "trussed-manage", ] @@ -1885,7 +1898,7 @@ dependencies = [ "cbor-smol", "clap", "clap-num", - "ctap-types 0.2.0", + "ctap-types 0.3.0", "ctaphid-dispatch", "delog", "fido-authenticator", @@ -1900,6 +1913,7 @@ dependencies = [ "sha2 0.10.8", "trussed", "trussed-auth", + "trussed-fs-info", "trussed-hkdf", "trussed-manage", "trussed-rsa-alloc", @@ -2081,3 +2095,8 @@ dependencies = [ "quote", "syn 2.0.52", ] + +[[patch.unused]] +name = "iso7816" +version = "0.1.1" +source = "git+https://github.com/Nitrokey/iso7816.git?tag=v0.1.1-nitrokey.1#d1ee4146c43b9f25d21821c70fefdd87b886f4a9" diff --git a/Cargo.toml b/Cargo.toml index f65dbff..c3167fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ serde = { version = "1.0", default-features = false } serde-indexed = "0.1.0" serde_bytes = { version = "0.11.10", default-features = false, features=["alloc"] } generic-array = "0.14.3" -ctap-types = "0.2" +ctap-types = "0.3" ctaphid-dispatch = "0.1" apdu-dispatch = "0.1" @@ -42,7 +42,8 @@ delog = { version = "0.1.6", features = ["std-log"] } fido-authenticator = {version = "0.1.1", features = ["dispatch", "log-all"]} trussed-hkdf = { version = "0.2.0" } trussed-manage = { version = "0.1.0" } -trussed-staging = { version = "0.3.0", features = ["chunked", "hkdf", "manage", "virt"] } +trussed-fs-info = { version = "0.1.0" } +trussed-staging = { version = "0.3.0", features = ["chunked", "hkdf", "manage", "virt", "fs-info"] } trussed-usbip = { version = "0.0.1", features = ["ctaphid"], default-features = false } admin-app = { version = "0.1", features = ["log-all"] } @@ -76,6 +77,8 @@ inject-any-key = ["hmacsha256p256"] # Support RSA rsa = ["trussed-rsa-alloc"] +test-commands = [] + log-all = [] log-none = [] log-info = [] @@ -97,7 +100,8 @@ ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch", tag = # forked admin-app = { git = "https://github.com/Nitrokey/admin-app.git", tag = "v0.1.0-nitrokey.11" } -fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.16" } +fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.18" } +cbor-smol = { git = "https://github.com/Nitrokey/cbor-smol.git", tag = "v0.4.0-nitrokey.4"} # unreleased upstream changes apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" } @@ -107,12 +111,13 @@ trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "b548d379d usbd-ctaphid = { git = "https://github.com/Nitrokey/usbd-ctaphid", tag = "v0.1.0-nitrokey.1" } # unreleased crates +trussed-fs-info = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "fs-info-v0.1.0" } trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", rev = "62235294bd63977bbb88eb01e7ac44b8010eb450" } trussed-chunked = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "chunked-v0.1.0" } trussed-hkdf = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "hkdf-v0.2.0" } trussed-manage = { git = "https://github.com/trussed-dev/trussed-staging.git", tag = "manage-v0.1.0" } trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.2.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-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner", tag = "v0.0.1-nitrokey.1" } # Local development diff --git a/examples/usbip/main.rs b/examples/usbip/main.rs index a6788c3..c1537cd 100644 --- a/examples/usbip/main.rs +++ b/examples/usbip/main.rs @@ -7,6 +7,7 @@ use std::path::{Path, PathBuf}; const LOCATION_FOR_SIMULATION: Location = Location::Internal; mod dispatch { + use trussed_fs_info::FsInfoExtension; use trussed_hkdf::HkdfExtension; use trussed_manage::ManageExtension; use trussed_staging::StagingBackend; @@ -49,6 +50,7 @@ mod dispatch { HmacShaP256, Manage, Hkdf, + FsInfo, } impl From for u8 { @@ -58,6 +60,7 @@ mod dispatch { Extension::HmacShaP256 => 1, Extension::Manage => 2, Extension::Hkdf => 3, + Extension::FsInfo => 4, } } } @@ -71,6 +74,7 @@ mod dispatch { 1 => Ok(Extension::HmacShaP256), 2 => Ok(Extension::Manage), 3 => Ok(Extension::Hkdf), + 4 => Ok(Extension::FsInfo), _ => Err(Error::InternalError), } } @@ -178,6 +182,15 @@ mod dispatch { resources, ) } + Extension::FsInfo => { + ExtensionImpl::::extension_request_serialized( + &mut self.staging, + &mut ctx.core, + &mut ctx.backends.staging, + request, + resources, + ) + } _ => Err(Error::RequestNotAvailable), }, Backend::HmacShaP256 => match extension { @@ -221,6 +234,11 @@ mod dispatch { const ID: Self::Id = Self::Id::Hkdf; } + impl ExtensionId for Dispatch { + type Id = Extension; + + const ID: Self::Id = Self::Id::FsInfo; + } } #[cfg(feature = "ccid")]