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

[Bug] Registration fails when device is full and discoverable credentials is only preferred. #335

Open gbdlin opened 6 months ago

gbdlin commented 6 months ago

Issue description

Right now, the registration process fails when the device cannot create any more discoverable credentials, because is full, when discoverable credential is set as "preferred" and not as "required. The expected outcome should be to fall back to non-discoverable credential as if the device wouldn't support discoverable credentials at all.

Steps to reproduce

  1. use hardware with limited storage for discoverable credentials (for example yubikey 5 series)
  2. Fill the device with dummy credentials
  3. Try to register new credential using the library, with discoverable/resident credential setting set as "preferred"
  4. Observe result

Expected result

Library should fall back into registering non-discoverable credential

Actual result

Registration fails.