Skip to content

Commit

Permalink
Ignore errors in preflight
Browse files Browse the repository at this point in the history
  • Loading branch information
jschanck committed Aug 24, 2023
1 parent 7da65ec commit 3a9279a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/ctap2/preflight.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::client_data::ClientDataHash;
use super::commands::get_assertion::{GetAssertion, GetAssertionOptions};
use super::commands::{CommandError, PinUvAuthCommand, RequestCtap1, Retryable, StatusCode};
use super::commands::{PinUvAuthCommand, RequestCtap1, Retryable};
use crate::authenticatorservice::GetAssertionExtensions;
use crate::consts::{PARAMETER_SIZE, U2F_AUTHENTICATE, U2F_CHECK_IS_REGISTERED};
use crate::crypto::PinUvAuthToken;
Expand Down Expand Up @@ -171,8 +171,7 @@ pub(crate) fn do_credential_list_filtering_ctap2<Dev: FidoDevice>(
None,
);
silent_assert.set_pin_uv_auth_param(pin_uv_auth_token.clone())?;
let res = dev.send_msg(&silent_assert);
match res {
match dev.send_msg(&silent_assert) {
Ok(response) => {
// This chunk contains a key_handle that is already known to the device.
// Filter out all credentials the device returned. Those are valid.
Expand All @@ -185,12 +184,11 @@ pub(crate) fn do_credential_list_filtering_ctap2<Dev: FidoDevice>(
final_list = credential_ids;
break;
}
Err(HIDError::Command(CommandError::StatusCode(StatusCode::NoCredentials, _))) => {
Err(_) => {
// No-op: Go to next chunk.
}
Err(e) => {
// Some unexpected error
return Err(e.into());
// NOTE: while we expect a StatusCode::NoCredentials error here, some tokens return
// other values.
continue;
}
}
}
Expand Down

0 comments on commit 3a9279a

Please sign in to comment.