Fix server-side authentication with FIDO/U2F sk-* keys#809
Merged
Conversation
The public keys the server receives on the wire do not have any flags that may be defined in authorized_keys. Therefore the AuthorizedKeyEntriesPublickeyAuthenticator must not include the flags in the keys used for the comparison.
Server-side, authorized_keys may define flags that are relevant for signature verification of sk-* FIDO/U2F keys: no-touch-required and verify-require. UserAuthPublicKey must therefore use the key from the authenticator, which includes these flags, and not the key received on the wire, which doesn't have them. Also be more strict about trailing garbage after the signature.
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.
Respect server-side attributes that may be set in an
authorized_keysfile:no-touch-requiredandverify-required. These flags exist only server-side; the public keys received in an SSH_MSG_USERAUTH packet do not have them.authorized_keysfile.AuthorizedKeyEntry) so that we can properly check the flags in the signature.Also throw an exception if there is bogus trailing data after the signature in the packet.