diff --git a/src/ctap2.rs b/src/ctap2.rs index d70760a..5804a99 100644 --- a/src/ctap2.rs +++ b/src/ctap2.rs @@ -814,6 +814,7 @@ impl Authenticator for crate::Authenti ).ok_or(Error::NoCredentials)?; info_now!("found {:?} applicable credentials", num_credentials); + info_now!("{:?}", &credential); // 6. process any options present @@ -900,6 +901,7 @@ impl crate::Authenticator self.state.runtime.active_get_assertion = None; if let Some(allow_list) = allow_list { + debug_now!("Allowlist passed, filtering"); // we will have at most one credential, and an empty cache. for credential_id in allow_list { @@ -917,12 +919,13 @@ impl crate::Authenticator return None; } else { // we are only dealing with discoverable credentials. + debug_now!("Allowlist not passed, fetching RKs"); let mut maybe_path = syscall!(self.trussed.read_dir_first( Location::Internal, rp_rk_dir(&rp_id_hash), None, - )).entry.map(|entry| PathBuf::try_from(entry.file_name()).unwrap()); + )).entry.map(|entry| PathBuf::try_from(entry.path()).unwrap()); use core::str::FromStr; use crate::state::CachedCredential; @@ -943,7 +946,7 @@ impl crate::Authenticator } maybe_path = syscall!(self.trussed.read_dir_next()) - .entry.map(|entry| PathBuf::try_from(entry.file_name()).unwrap()); + .entry.map(|entry| PathBuf::try_from(entry.path()).unwrap()); } let num_credentials = self.state.runtime.remaining_credentials(); diff --git a/src/dispatch.rs b/src/dispatch.rs index 2b80cad..7cbf454 100644 --- a/src/dispatch.rs +++ b/src/dispatch.rs @@ -27,7 +27,7 @@ where UP: UserPresence, { debug_now!("handle CTAP1: remaining stack: {} bytes", msp() - 0x2000_0000); - debug_now!("1A SP: {:X}", msp()); + // debug_now!("1A SP: {:X}", msp()); match try_handle_ctap1(authenticator, data, response) { Ok(()) => { debug!("U2F response {} bytes", response.len()); @@ -41,7 +41,7 @@ where response.extend_from_slice(&code).ok(); }, } - debug_now!("1B SP: {:X}", msp()); + // debug_now!("1B SP: {:X}", msp()); debug_now!("end handle CTAP1"); } @@ -53,12 +53,12 @@ where UP: UserPresence, { debug_now!("handle CTAP2: remaining stack: {} bytes", msp() - 0x2000_0000); - debug_now!("2A SP: {:X}", msp()); + // debug_now!("2A SP: {:X}", msp()); if let Err(error) = try_handle_ctap2(authenticator, data, response) { debug_now!("CTAP2 error: {})", error); response.push(error).ok(); } - debug_now!("2B SP: {:X}", msp()); + // debug_now!("2B SP: {:X}", msp()); debug_now!("end handle CTAP2"); } @@ -83,13 +83,13 @@ where let ctap_request = { let command = apdu_dispatch::Command::try_from(data) .map_err(|_| Status::IncorrectDataParameter)?; - debug_now!("1a SP: {:X}", msp()); + // debug_now!("1a SP: {:X}", msp()); ctap1::Request::try_from(&command) .map_err(|_| Status::IncorrectDataParameter)? }; ctap1::Authenticator::call_ctap1(authenticator, &ctap_request)? }; - debug_now!("1b SP: {:X}", msp()); + // debug_now!("1b SP: {:X}", msp()); ctap_response.serialize(response).ok(); Ok(()) @@ -129,7 +129,6 @@ where authenticator.state.persistent.load_if_not_initialised(&mut authenticator.trussed); debug_now!("try_get CTAP2: remaining stack: {} bytes", msp() - 0x2000_0000); - debug_now!("size(Request): {} bytes", core::mem::size_of::()); // Goal of these nested scopes is to keep stack small. let ctap_request = ctap2::Request::deserialize(data)