From 1e063bbc78e950f14f2c83636f4cfa333d91e81b Mon Sep 17 00:00:00 2001 From: Jishnu Kaiwar Date: Wed, 22 Oct 2025 11:53:43 +0530 Subject: [PATCH 1/3] Logging None returns causing Errors in bio_enrollment --- libwebauthn/src/management/bio_enrollment.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libwebauthn/src/management/bio_enrollment.rs b/libwebauthn/src/management/bio_enrollment.rs index 62ebfd1..4586f4a 100644 --- a/libwebauthn/src/management/bio_enrollment.rs +++ b/libwebauthn/src/management/bio_enrollment.rs @@ -81,7 +81,13 @@ where let req = Ctap2BioEnrollmentRequest::new_get_modality(); // No UV needed let resp = self.ctap2_bio_enrollment(&req, timeout).await?; - resp.modality.ok_or(Error::Ctap(CtapError::Other)) + match resp.modality { + Some(modality) => Ok(modality), + None => { + info!("Channel did not return modality."); + Err(Error::Ctap(CtapError::Other)) + } + } } async fn get_fingerprint_sensor_info( @@ -91,8 +97,12 @@ where let req = Ctap2BioEnrollmentRequest::new_fingerprint_sensor_info(); // No UV needed let resp = self.ctap2_bio_enrollment(&req, timeout).await?; + let Some(fingerprint_kind) = resp.fingerprint_kind else { + info!("Channel did not return fingerprint_kind Sensor Info"); + return Err(Error::Ctap(CtapError::Other)) + }; Ok(Ctap2BioEnrollmentFingerprintSensorInfo { - fingerprint_kind: resp.fingerprint_kind.ok_or(Error::Ctap(CtapError::Other))?, + fingerprint_kind, max_capture_samples_required_for_enroll: resp .max_capture_samples_required_for_enroll .clone(), From 13ab747471babc00a88cf01265e405c4e4959f0a Mon Sep 17 00:00:00 2001 From: Jishnu Kaiwar Date: Wed, 22 Oct 2025 16:09:30 +0530 Subject: [PATCH 2/3] message changed for style --- libwebauthn/src/management/bio_enrollment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libwebauthn/src/management/bio_enrollment.rs b/libwebauthn/src/management/bio_enrollment.rs index 4586f4a..95feb3a 100644 --- a/libwebauthn/src/management/bio_enrollment.rs +++ b/libwebauthn/src/management/bio_enrollment.rs @@ -98,7 +98,7 @@ where // No UV needed let resp = self.ctap2_bio_enrollment(&req, timeout).await?; let Some(fingerprint_kind) = resp.fingerprint_kind else { - info!("Channel did not return fingerprint_kind Sensor Info"); + info!("Channel did not return fingerprint_kind in sensor info."); return Err(Error::Ctap(CtapError::Other)) }; Ok(Ctap2BioEnrollmentFingerprintSensorInfo { From 733c9efeb4a6e3c78db748ca7dd3ae139c6d1d54 Mon Sep 17 00:00:00 2001 From: Jishnu Kaiwar Date: Fri, 31 Oct 2025 19:22:04 +0530 Subject: [PATCH 3/3] changed log levels info -> warn --- libwebauthn/src/management/bio_enrollment.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libwebauthn/src/management/bio_enrollment.rs b/libwebauthn/src/management/bio_enrollment.rs index 95feb3a..c3710de 100644 --- a/libwebauthn/src/management/bio_enrollment.rs +++ b/libwebauthn/src/management/bio_enrollment.rs @@ -20,7 +20,7 @@ use crate::{ use async_trait::async_trait; use serde_bytes::ByteBuf; use std::time::Duration; -use tracing::info; +use tracing::{info, warn}; #[async_trait] pub trait BioEnrollment { @@ -84,7 +84,7 @@ where match resp.modality { Some(modality) => Ok(modality), None => { - info!("Channel did not return modality."); + warn!("Channel did not return modality."); Err(Error::Ctap(CtapError::Other)) } } @@ -98,7 +98,7 @@ where // No UV needed let resp = self.ctap2_bio_enrollment(&req, timeout).await?; let Some(fingerprint_kind) = resp.fingerprint_kind else { - info!("Channel did not return fingerprint_kind in sensor info."); + warn!("Channel did not return fingerprint_kind in sensor info."); return Err(Error::Ctap(CtapError::Other)) }; Ok(Ctap2BioEnrollmentFingerprintSensorInfo {