Skip to content

Commit

Permalink
Use released dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Jan 10, 2025
1 parent 60c58eb commit 4fe4e4e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
21 changes: 12 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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" }
12 changes: 3 additions & 9 deletions examples/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -80,7 +77,7 @@ impl<C: Client, const N: usize> ctaphid_dispatch::app::App<'_, N> for DummyApp<C
command: Command,
_request: &[u8],
response: &mut heapless_bytes::Bytes<N>,
) -> AppResult {
) -> Result<(), Error> {
match command {
CTAPHID_COMMAND_RNG => self.rng(response),
_ => return Err(Error::InvalidCommand),
Expand Down Expand Up @@ -111,10 +108,7 @@ impl<'a, S: StoreProvider> trussed_usbip::Apps<'a, S, CoreOnly>
fn with_ctaphid_apps<T>(
&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])
Expand Down
4 changes: 2 additions & 2 deletions src/ctaphid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ 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};

use super::{Timeout, IS_WAITING};

pub fn setup<'bus, 'pipe, 'interrupt, B: UsbBus>(
bus_allocator: &'bus UsbBusAllocator<B>,
interchange: &'pipe ctaphid_dispatch::types::Channel,
interchange: &'pipe ctaphid_dispatch::Channel,
) -> (
CtapHid<'bus, 'pipe, 'interrupt, B>,
Dispatch<'pipe, 'interrupt>,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 4fe4e4e

Please sign in to comment.