From 8331aa1378416977a4053cdbc79a8442f47c596e Mon Sep 17 00:00:00 2001 From: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com> Date: Mon, 28 Mar 2022 14:29:32 +0200 Subject: [PATCH] allows Make before Reset (#449) --- src/ctap/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ctap/mod.rs b/src/ctap/mod.rs index 903449f..1586a9c 100644 --- a/src/ctap/mod.rs +++ b/src/ctap/mod.rs @@ -307,7 +307,7 @@ impl StatefulPermission { // However, interleaving (stateless) commands could delete credentials or change the PIN, // which chould make invalidate our access. Some read-only commands should be okay to run, // but (A) is the safest and easiest solution. - if let Some(c) = self.channel.as_ref() { + if let Some(c) = &self.channel { if c != channel { self.clear(); } @@ -554,6 +554,8 @@ impl CtapState { | (Command::AuthenticatorGetInfo, Ok(StatefulCommand::Reset)) // AuthenticatorSelection still allows Reset. | (Command::AuthenticatorSelection, Ok(StatefulCommand::Reset)) + // AuthenticatorMakeCredential is used like AuthenticatorSelection in 2.0. + | (Command::AuthenticatorMakeCredential(_), Ok(StatefulCommand::Reset)) // AuthenticatorCredentialManagement handles its subcommands later. | ( Command::AuthenticatorCredentialManagement(_),