Skip to content

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

Merged
tomaswolf merged 1 commit into
apache:masterfrom
tomaswolf:gh-636
Nov 27, 2024
Merged

GH-636: Handle unknown key types in known_hosts#638
tomaswolf merged 1 commit into
apache:masterfrom
tomaswolf:gh-636

Conversation

@tomaswolf
Copy link
Copy Markdown
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
@tomaswolf tomaswolf deleted the gh-636 branch April 25, 2025 15:34
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