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
117 changes: 115 additions & 2 deletions Cargo.lock

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

5 changes: 2 additions & 3 deletions credentialsd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ base64 = "0.22.1"
credentialsd-common = { path = "../credentialsd-common" }
futures-lite.workspace = true
libc.workspace = true
libwebauthn = { version = "0.3.0", features = ["libnfc","pcsc"] }
# TODO: split nfc and pcsc into separate features
# Also, 0.6.1 fails to build with non-vendored library.
libwebauthn = { version = "0.5.0", features = ["nfc-backend-libnfc", "nfc-backend-pcsc"] }
# 0.6.1 fails to build with non-vendored library.
# https://github.com/alexrsagen/rs-nfc1/issues/15
nfc1 = { version = "=0.6.0", default-features = false }
rand = "0.9.2"
Expand Down
21 changes: 12 additions & 9 deletions credentialsd/src/credential_service/hybrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use tokio::sync::mpsc::{self, Sender};
use tracing::{debug, error};

use libwebauthn::transport::cable::channel::{CableUpdate, CableUxUpdate};
use libwebauthn::transport::cable::qr_code_device::{CableQrCodeDevice, QrCodeOperationHint};
use libwebauthn::transport::cable::qr_code_device::{
CableQrCodeDevice, CableTransports, QrCodeOperationHint,
};
use libwebauthn::transport::{Channel, Device};
use libwebauthn::webauthn::{Error as WebAuthnError, WebAuthn};

Expand Down Expand Up @@ -51,13 +53,15 @@ impl HybridHandler for InternalHybridHandler {
QrCodeOperationHint::GetAssertionRequest
}
};
let mut device = match CableQrCodeDevice::new_transient(hint) {
Ok(device) => device,
Err(err) => {
tracing::error!("Failed to create caBLE QR code device: {:?}", err);
return;
}
};
let mut device =
match CableQrCodeDevice::new_transient(hint, CableTransports::CloudAssistedOrLocal)
{
Ok(device) => device,
Err(err) => {
tracing::error!("Failed to create caBLE QR code device: {:?}", err);
return;
}
};
let qr_code = device.qr_code.to_string();
if let Err(err) = tx.send(HybridStateInternal::Init(qr_code)).await {
tracing::error!("Failed to send caBLE update: {:?}", err);
Expand Down Expand Up @@ -351,7 +355,6 @@ pub(super) mod test {
user: None,
credentials_count: Some(1),
user_selected: None,
large_blob_key: None,
unsigned_extensions_output: None,
enterprise_attestation: None,
attestation_statement: None,
Expand Down
4 changes: 1 addition & 3 deletions credentialsd/src/credential_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,13 @@ mod test {
fn create_credential_request() -> CredentialRequest {
let challenge = "Ox0AXQz7WUER7BGQFzvVrQbReTkS3sepVGj26qfUhhrWSarkDbGF4T4NuCY1aAwHYzOzKMJJ2YRSatetl0D9bQ";
let origin = "webauthn.io".to_string();
let is_cross_origin = false;
let challenge_bytes = base64::engine::general_purpose::URL_SAFE_NO_PAD
.decode(challenge)
.expect("valid base64url challenge");
let make_request = MakeCredentialRequest {
challenge: challenge_bytes,
origin: origin.clone(),
cross_origin: Some(is_cross_origin),
top_origin: None,
relying_party: Ctap2PublicKeyCredentialRpEntity {
id: "webauthn.io".to_string(),
name: Some("webauthn.io".to_string()),
Expand Down Expand Up @@ -435,7 +434,6 @@ mod test {
user: None,
credentials_count: Some(1),
user_selected: None,
large_blob_key: None,
unsigned_extensions_output: None,
enterprise_attestation: None,
attestation_statement: None,
Expand Down
Loading
Loading