allows Make before Reset (#449)

This commit is contained in:
kaczmarczyck
2022-03-28 14:29:32 +02:00
committed by GitHub
parent 0f073f8f54
commit 8331aa1378

View File

@@ -307,7 +307,7 @@ impl StatefulPermission {
// However, interleaving (stateless) commands could delete credentials or change the PIN, // 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, // which chould make invalidate our access. Some read-only commands should be okay to run,
// but (A) is the safest and easiest solution. // 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 { if c != channel {
self.clear(); self.clear();
} }
@@ -554,6 +554,8 @@ impl CtapState {
| (Command::AuthenticatorGetInfo, Ok(StatefulCommand::Reset)) | (Command::AuthenticatorGetInfo, Ok(StatefulCommand::Reset))
// AuthenticatorSelection still allows Reset. // AuthenticatorSelection still allows Reset.
| (Command::AuthenticatorSelection, Ok(StatefulCommand::Reset)) | (Command::AuthenticatorSelection, Ok(StatefulCommand::Reset))
// AuthenticatorMakeCredential is used like AuthenticatorSelection in 2.0.
| (Command::AuthenticatorMakeCredential(_), Ok(StatefulCommand::Reset))
// AuthenticatorCredentialManagement handles its subcommands later. // AuthenticatorCredentialManagement handles its subcommands later.
| ( | (
Command::AuthenticatorCredentialManagement(_), Command::AuthenticatorCredentialManagement(_),