From f0e87ee813bc1b904b6d307ee9c88a099c11a13b Mon Sep 17 00:00:00 2001 From: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com> Date: Tue, 13 Jun 2023 15:31:54 +0200 Subject: [PATCH] resolves old TODO unlocked by new compiler and spec (#634) --- libraries/opensk/src/ctap/credential_management.rs | 6 ++---- libraries/opensk/src/ctap/mod.rs | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/opensk/src/ctap/credential_management.rs b/libraries/opensk/src/ctap/credential_management.rs index f23522a0..d546b049 100644 --- a/libraries/opensk/src/ctap/credential_management.rs +++ b/libraries/opensk/src/ctap/credential_management.rs @@ -138,16 +138,14 @@ fn process_enumerate_rps_begin( stateful_command_permission: &mut StatefulPermission, channel: Channel, ) -> Result { - 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::(rp_id, Some(total_rps as u64)) } diff --git a/libraries/opensk/src/ctap/mod.rs b/libraries/opensk/src/ctap/mod.rs index 66bb8e22..77285108 100644 --- a/libraries/opensk/src/ctap/mod.rs +++ b/libraries/opensk/src/ctap/mod.rs @@ -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;