sk-usbhid: preserve UV requirement for resident keys - #701
Open
savely-krasovsky wants to merge 1 commit into
Open
sk-usbhid: preserve UV requirement for resident keys#701savely-krasovsky wants to merge 1 commit into
savely-krasovsky wants to merge 1 commit into
Conversation
When loading resident credentials, derive SSH_SK_USER_VERIFICATION_REQD directly from the credential's credProtect policy. The previous code only preserved the flag when the authenticator did not report the uv capability. As a result, UV_REQUIRED credentials downloaded from authenticators with built-in UV were saved with flags 0x21 instead of 0x25. Do not make preservation of the credential policy depend on the authenticator's current UV capability. Keep compatibility with libfido2 versions without fido_cred_prot().
savely-krasovsky
marked this pull request as ready for review
July 25, 2026 18:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Derive
SSH_SK_USER_VERIFICATION_REQDdirectly from a resident credential'scredProtectpolicy when loading it from an authenticator.Why
Resident credentials created with
verify-requiredstoreFIDO_CRED_PROT_UV_REQUIREDon the authenticator.During
ssh-keygen -Kandssh-add -K,read_rks()currently propagates this asSSH_SK_USER_VERIFICATION_REQDonly when the authenticator does not report itsuvcapability. Authenticators with built-in UV therefore produce downloaded key files with flags0x21instead of
0x25.The credential policy should be preserved independently of the authenticator's current UV capability. The compatibility guard ensures that builds using libfido2 versions without
fido_cred_prot()retaintheir existing behavior.
Validation
--with-security-key-builtinandlibfido2 1.16.
UV_OPTIONAL_WITH_ID(0x02) downloaded with OpenSSH flags0x21.UV_REQUIRED(0x03) downloaded with OpenSSH flags0x25.0x25.