mozilla / authenticator-rs

Rust library to interact with Security Keys, used by Firefox
https://crates.io/crates/authenticator
Mozilla Public License 2.0
275 stars 72 forks source link

Return the correct CredentialExcluded error when handling CTAP1 devices #300

Closed jschanck closed 1 year ago

jschanck commented 1 year ago

The CredentialExcluded error is one of the few that are turned into an InvalidState DOM error instead of a NotAllowed DOM error, so consumers of this library need an easy way to recognize it. We have AuthenticatorError::CredentialExcluded for this purpose, but we were returning HIDError::Command(CommandError::StatusCode(StatusCode::CredentialExcluded, None)) when we found an excluded credential on a CTAP1 device.