fix: Assert credentials individually on U2F devices#45289
fix: Assert credentials individually on U2F devices#45289codingllama merged 5 commits intomasterfrom
Conversation
|
Tested manually in various scenarios: login with multiple keys, registration with multiple keys, registration with device registered/not registered, login as single key, etc. A few logs added below. login with multiple keys: tsh mfa add (adding another key): tsh mfa add (already registered): login (only authenticator): |
|
@ravicious, would you mind cloning this branch and running a final local test to make sure the fix is solid? |
|
Re backports: I've no plans to backport this as of now. I don't like changing this logic much, so I would rather only do that after v17 testplans (or if someone else raises the issue). |
|
Friendly ping @gzdunek @ravicious ? |
ravicious
left a comment
There was a problem hiding this comment.
I tested this locally and these changes let me log in with the old key.
|
Thanks everyone! |
|
FYI, I've moved the |
* Simulate "internal error" on multiple credentials * fix: Assert credentials individually on U2F devices * Use bytes.Repeat * Comment on U2F and libfido2.ErrUserPresenceRequired * Move errorOnUnknownCredential failure after the "tap"
* Simulate "internal error" on multiple credentials * fix: Assert credentials individually on U2F devices * Use bytes.Repeat * Comment on U2F and libfido2.ErrUserPresenceRequired * Move errorOnUnknownCredential failure after the "tap"
* Simulate "internal error" on multiple credentials * fix: Assert credentials individually on U2F devices * Use bytes.Repeat * Comment on U2F and libfido2.ErrUserPresenceRequired * Move errorOnUnknownCredential failure after the "tap"
* Simulate "internal error" on multiple credentials * fix: Assert credentials individually on U2F devices * Use bytes.Repeat * Comment on U2F and libfido2.ErrUserPresenceRequired * Move errorOnUnknownCredential failure after the "tap"
Fix a somewhat rare error in older authenticator models (reproduced with a FIDO U2F Security Key firmware 4.1.8).
The error is as follows: if certain key handles unknown to the authenticator exist in the allowed credentials set, the authenticator fails the assertion with an "internal error". This PR changes assertions in this specific scenario (U2F key, >1 allowed credential) to run sequentially through each key handle looking for a known credential to use.
#44912
Changelog: Fixes a rare "internal error" on older U2F authenticators when using tsh