Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-636: Handle unknown key types in known_hosts #638

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

tomaswolf
Copy link
Member

Harden the parser so that it can parse known_host and authorized_key lines with unknown key types. Introduce a new UnsupportedSshPublicKey class to be able to deal with such entries later on when the server host key is compared. (An alternative would have been not to create PublicKeys from known_host lines at all but to serialize the given server key into string form and then just compare against the string from the known_host line. But that is not possible without breaking API...)

Such an UnsupportedSshPublicKey supports getting its key type, its raw key data, its fingerprint, and it can be written into a Buffer.

Fixes #636.

Harden the parser so that it can parse known_host and authorized_key
lines with unknown key types. Introduce a new UnsupportedSshPublicKey
class to be able to deal with such entries later on when the server
host key is compared. (An alternative would have been not to create
PublicKeys from known_host lines at all but to serialize the given
server key into string form and then just compare against the string
from the known_host line. But that is not possible without breaking
API...)

Such an UnsupportedSshPublicKey supports getting its key type, its raw
key data, its fingerprint, and it can be written into a Buffer.
@tomaswolf tomaswolf merged commit 7cc9c49 into apache:master Nov 27, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported public key type in KnowHostEntry is invalidating all the host entries
2 participants