Skip to content

pam-u2f should avoid requesting PINs multiple times for the same device #379

@fergus-dall

Description

@fergus-dall

I've discovered that when using resident keys the pam module skips trying to match keys with authenticator devices and just tries every key against every device, asking for a PIN each time, until one matches. I assume this is because listing resident keys requires a PIN anyway, but it's not a great experience, especially when using a GUI login interface where it is hard to tell if a message is repeated.

(I'm not sure why matching non-resident keys doesn't require a PIN and touch though)

At a minimum, we could cache the PIN for each device and avoid needing to query it again. Going a bit further, we could use the credential management API to determine if any resident keys match without needing the user to touch the authenticator for each key checked, for authenticators that support this.

Assuming I understand this right, I think the best order to search is:

  • All non-resident keys against all authenticators (can be checked for presence without user interaction)
  • Check each FIDO2 device that supports credential management, one device at a time against all resident keys
  • Finally, check all resident keys against all remaining FIDO2 devices

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions