Skip to content

Silently ignore invalid keys in HostKeys.load() - #500

Closed
martintopholm wants to merge 1 commit into
paramiko:masterfrom
martintopholm:fix/issue490
Closed

martintopholm wants to merge 1 commit into
paramiko:masterfrom
martintopholm:fix/issue490

Conversation

@martintopholm

Copy link
Copy Markdown
Contributor

When broken entries exists in known_hosts, paramiko raises SSHException
with "Invalid key". This patch catches the exception during
HostKeys.load() and continues to next line.

This should fix #490.

When broken entries exists in known_hosts, paramiko raises SSHException
with "Invalid key". This patch catches the exception during
HostKeys.load() and continues to next line.

This should fix #490.
@bitprophet

Copy link
Copy Markdown
Member

Thanks, added the parent ticket to bugfix milestone :) also triple checked that yes, openssh is silent about its skipping of malformed keys.

Fizzadar added a commit to Fizzadar/paramiko that referenced this pull request Feb 16, 2022
Similar to paramiko#500 but covers the extra exception that may be raised.
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.

Handling broken entries in known_hosts

2 participants