Skip to content

Commit

Permalink
resolves old TODO unlocked by new compiler and spec (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczmarczyck committed Jun 13, 2023
1 parent 3813cac commit f0e87ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions libraries/opensk/src/ctap/credential_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,14 @@ fn process_enumerate_rps_begin<E: Env>(
stateful_command_permission: &mut StatefulPermission<E>,
channel: Channel,
) -> Result<AuthenticatorCredentialManagementResponse, Ctap2StatusCode> {
let rp_set = get_stored_rp_ids(env)?;
let mut rp_set = get_stored_rp_ids(env)?;
let total_rps = rp_set.len();

if total_rps > 1 {
stateful_command_permission.set_command(env, StatefulCommand::EnumerateRps(1), channel);
}
// TODO https://github.com/rust-lang/rust/issues/62924 replace with pop_first()
let rp_id = rp_set
.into_iter()
.next()
.pop_first()
.ok_or(Ctap2StatusCode::CTAP2_ERR_NO_CREDENTIALS)?;
enumerate_rps_response::<E>(rp_id, Some(total_rps as u64))
}
Expand Down
1 change: 0 additions & 1 deletion libraries/opensk/src/ctap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ const MAX_CBOR_NESTING_DEPTH: i8 = 4;

pub const KEEPALIVE_DELAY_MS: usize = 100;
pub const TOUCH_TIMEOUT_MS: usize = 30000;
// TODO(kaczmarczyck) 2.1 allows Reset after Reset and 15 seconds?
const RESET_TIMEOUT_DURATION_MS: usize = 10000;
const STATEFUL_COMMAND_TIMEOUT_DURATION_MS: usize = 30000;

Expand Down

0 comments on commit f0e87ee

Please sign in to comment.