From 4fe4e4e287dac1d92fcd4f97e8926497bfa9d7a9 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Wed, 8 Jan 2025 21:35:41 +0100 Subject: [PATCH] Use released dependencies --- Cargo.lock | 21 ++++++++++++--------- Cargo.toml | 7 ++----- examples/dummy.rs | 12 +++--------- src/ctaphid.rs | 4 ++-- src/lib.rs | 4 ++-- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71d87a2..8c54e35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -342,9 +342,9 @@ dependencies = [ [[package]] name = "ctaphid-app" -version = "0.1.0-rc.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1179116598f4f53694ce2fda6bb38183f71efcb9ff6385d08ca1d79d6254841" +checksum = "1fe93489fe96c998488d0843dffea35c02ed9add2585e55228e1d45988727ecc" dependencies = [ "heapless-bytes", "trussed-core", @@ -352,8 +352,9 @@ dependencies = [ [[package]] name = "ctaphid-dispatch" -version = "0.1.1" -source = "git+https://github.com/trussed-dev/ctaphid-dispatch.git?rev=5a2864c76fea6785d9ffe4c7b6596237d8378755#5a2864c76fea6785d9ffe4c7b6596237d8378755" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27caf0a07de6b0af58ba69562c1834ddf7aa27bc1d1687fed3b18fea1501e59e" dependencies = [ "ctaphid-app", "delog", @@ -1489,9 +1490,9 @@ dependencies = [ [[package]] name = "trussed-core" -version = "0.1.0-rc.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc8831dee63f373a6bb031caac114c6672d593d03e371fd95b41a47be7d415e0" +checksum = "afddad280ae8a5235e1b06408cca909ce9454cdd89f941b94b024c580732b3ce" dependencies = [ "heapless-bytes", "littlefs2-core", @@ -1559,7 +1560,8 @@ checksum = "1f6cc3adc849b5292b4075fc0d5fdcf2f24866e88e336dd27a8943090a520508" [[package]] name = "usbd-ccid" version = "0.3.0" -source = "git+https://github.com/trussed-dev/usbd-ccid?tag=0.3.0#0a31e9cf7c5aa8498c65982c95b9faeebe8e3f52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403fefa622483869d1b36f2accd7458291202c18aa2f2e5147caf638825dde0c" dependencies = [ "delog", "embedded-time", @@ -1571,8 +1573,9 @@ dependencies = [ [[package]] name = "usbd-ctaphid" -version = "0.1.0" -source = "git+https://github.com/trussed-dev/usbd-ctaphid.git?rev=96bf04e97cfc8077b4d9b6b97b3e34ec3ca3e2fc#96bf04e97cfc8077b4d9b6b97b3e34ec3ca3e2fc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092fad7bf817001ecade9272fe6ccbea4e5d0c02f99ca24c4c5ce97fbbff5371" dependencies = [ "ctaphid-dispatch", "delog", diff --git a/Cargo.toml b/Cargo.toml index 23f91c0..311be6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,8 +12,8 @@ usb-device = { version = "0.2.7", default-features = false } usbip-device = "0.1.5" # ctaphid -ctaphid-dispatch = { version = "0.1", features = ["log-all"], optional = true } -usbd-ctaphid = { version = "0.1", features = ["log-all"], optional = true } +ctaphid-dispatch = { version = "0.2", features = ["log-all"], optional = true } +usbd-ctaphid = { version = "0.2", features = ["log-all"], optional = true } # ccid apdu-dispatch = { version = "0.3", optional = true } @@ -35,6 +35,3 @@ ccid = ["apdu-dispatch", "usbd-ccid"] [patch.crates-io] trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "6bba8fde36d05c0227769eb63345744e87d84b2b" } -usbd-ctaphid = { git = "https://github.com/trussed-dev/usbd-ctaphid.git", rev = "96bf04e97cfc8077b4d9b6b97b3e34ec3ca3e2fc" } -usbd-ccid = { git = "https://github.com/trussed-dev/usbd-ccid", tag = "0.3.0" } -ctaphid-dispatch = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", rev = "5a2864c76fea6785d9ffe4c7b6596237d8378755" } diff --git a/examples/dummy.rs b/examples/dummy.rs index e76d6a1..3b8dcf0 100644 --- a/examples/dummy.rs +++ b/examples/dummy.rs @@ -12,10 +12,7 @@ use std::path::PathBuf; #[cfg(feature = "ccid")] use apdu_dispatch::command::SIZE as ApduCommandSize; #[cfg(feature = "ctaphid")] -use ctaphid_dispatch::{ - command::{Command, VendorCommand}, - types::{AppResult, Error}, -}; +use ctaphid_dispatch::app::{Command, Error, VendorCommand}; use clap::Parser; use clap_num::maybe_hex; @@ -80,7 +77,7 @@ impl ctaphid_dispatch::app::App<'_, N> for DummyApp, - ) -> AppResult { + ) -> Result<(), Error> { match command { CTAPHID_COMMAND_RNG => self.rng(response), _ => return Err(Error::InvalidCommand), @@ -111,10 +108,7 @@ impl<'a, S: StoreProvider> trussed_usbip::Apps<'a, S, CoreOnly> fn with_ctaphid_apps( &mut self, f: impl FnOnce( - &mut [&mut dyn ctaphid_dispatch::app::App< - 'a, - { ctaphid_dispatch::types::MESSAGE_SIZE }, - >], + &mut [&mut dyn ctaphid_dispatch::app::App<'a, { ctaphid_dispatch::MESSAGE_SIZE }>], ) -> T, ) -> T { f(&mut [&mut self.dummy]) diff --git a/src/ctaphid.rs b/src/ctaphid.rs index 29ffcd8..da638f8 100644 --- a/src/ctaphid.rs +++ b/src/ctaphid.rs @@ -3,7 +3,7 @@ use std::{ time::{Duration, Instant}, }; -use ctaphid_dispatch::dispatch::Dispatch; +use ctaphid_dispatch::Dispatch; use usb_device::bus::{UsbBus, UsbBusAllocator}; use usbd_ctaphid::{types::Status, CtapHid}; @@ -11,7 +11,7 @@ use super::{Timeout, IS_WAITING}; pub fn setup<'bus, 'pipe, 'interrupt, B: UsbBus>( bus_allocator: &'bus UsbBusAllocator, - interchange: &'pipe ctaphid_dispatch::types::Channel, + interchange: &'pipe ctaphid_dispatch::Channel, ) -> ( CtapHid<'bus, 'pipe, 'interrupt, B>, Dispatch<'pipe, 'interrupt>, diff --git a/src/lib.rs b/src/lib.rs index 1cccd90..60ebe8d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,7 +60,7 @@ pub trait Apps<'interrupt, S: StoreProvider, D: Dispatch> { f: impl FnOnce( &mut [&mut dyn ctaphid_dispatch::app::App< 'interrupt, - { ctaphid_dispatch::types::MESSAGE_SIZE }, + { ctaphid_dispatch::MESSAGE_SIZE }, >], ) -> T, ) -> T; @@ -96,7 +96,7 @@ impl<'interrupt, S: StoreProvider, D: Dispatch, A: Apps<'interrupt, S, D>> Runne let bus_allocator = UsbBusAllocator::new(UsbIpBus::new()); #[cfg(feature = "ctaphid")] - let ctap_channel = ctaphid_dispatch::types::Channel::new(); + let ctap_channel = ctaphid_dispatch::Channel::new(); #[cfg(feature = "ctaphid")] let (mut ctaphid, mut ctaphid_dispatch) = ctaphid::setup(&bus_allocator, &ctap_channel);