Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions xyz-iinuwa-credential-manager-portal-gtk/Cargo.lock

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

2 changes: 1 addition & 1 deletion xyz-iinuwa-credential-manager-portal-gtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ serde_json = "1.0.140"
tracing = "0.1.41"
tracing-subscriber = "0.3"
zbus = { version = "5.5.0", default-features = false, features = ["blocking-api", "tokio"] }
libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn", rev = "e73c76b5826801907340396b0fd9bd7dfb0f5760" }
libwebauthn = { git = "https://github.com/linux-credentials/libwebauthn", rev = "34f8a59cb1634175b8baf866e6d30d1869f5a221" }
async-trait = "0.1.88"
tokio = { version = "1.45.0", features = ["rt-multi-thread"] }
futures-lite = "2.6.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl HybridHandler for InternalHybridHandler {
};
tokio::spawn(async move {
let mut channel = match device.channel().await {
Ok((channel, _)) => channel,
Ok(channel) => channel,
Err(e) => {
tracing::error!("Failed to open hybrid channel: {:?}", e);
panic!();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ use libwebauthn::{
proto::CtapError,
transport::{
hid::{channel::HidChannelHandle, HidDevice},
Device,
Channel, Device,
},
webauthn::{Error as WebAuthnError, WebAuthn},
UxUpdate,
UvUpdate,
};
use tokio::sync::broadcast;
use tokio::sync::mpsc::{self, Receiver, Sender, WeakSender};
use tracing::{debug, warn};

Expand Down Expand Up @@ -84,7 +85,7 @@ impl InProcessUsbHandler {
let dev = device.clone();

let res = match device.channel().await {
Ok((ref mut channel, _)) => {
Ok(ref mut channel) => {
let cancel_handle = channel.get_handle();
stx.send((idx, dev, cancel_handle)).await.unwrap();
drop(stx);
Expand Down Expand Up @@ -292,10 +293,11 @@ async fn handle_events(
Err(err) => {
tracing::error!("Failed to open channel to USB authenticator, cannot receive user verification events: {:?}", err);
}
Ok((mut channel, state_rx)) => {
Ok(mut channel) => {
let signal_tx2 = signal_tx.clone().downgrade();
let ux_updates_rx = channel.get_ux_update_receiver();
tokio::spawn(async move {
handle_usb_updates(&signal_tx2, state_rx).await;
handle_usb_updates(&signal_tx2, ux_updates_rx).await;
debug!("Reached end of USB update task");
});
tracing::debug!(
Expand Down Expand Up @@ -527,23 +529,23 @@ impl From<UsbStateInternal> for UsbState {

async fn handle_usb_updates(
signal_tx: &WeakSender<Result<UsbUvMessage, Error>>,
mut state_rx: Receiver<UxUpdate>,
mut state_rx: broadcast::Receiver<UvUpdate>,
) {
while let Some(msg) = state_rx.recv().await {
while let Ok(msg) = state_rx.recv().await {
let signal_tx = match signal_tx.upgrade() {
Some(tx) => tx,
None => break,
};
match msg {
UxUpdate::UvRetry { attempts_left } => {
UvUpdate::UvRetry { attempts_left } => {
if let Err(err) = signal_tx
.send(Ok(UsbUvMessage::NeedsUserVerification { attempts_left }))
.await
{
tracing::error!("Authenticator requested user verficiation, but we cannot relay the message to credential service: {:?}", err);
}
}
UxUpdate::PinRequired(pin_update) => {
UvUpdate::PinRequired(pin_update) => {
let (pin_tx, mut pin_rx) = mpsc::channel(1);
if let Err(err) = signal_tx
.send(Ok(UsbUvMessage::NeedsPin {
Expand All @@ -562,7 +564,7 @@ async fn handle_usb_updates(
None => tracing::debug!("Pin channel closed before receiving pin from client."),
}
}
UxUpdate::PresenceRequired => {
UvUpdate::PresenceRequired => {
if let Err(err) = signal_tx.send(Ok(UsbUvMessage::NeedsUserPresence)).await {
tracing::error!("Authenticator requested user presence, but we cannot relay the message to the credential service: {:?}", err);
}
Expand Down