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

libssh2 removes unrecognized entries in known_hosts #85

Closed
gnachman opened this issue Feb 21, 2016 · 2 comments
Closed

libssh2 removes unrecognized entries in known_hosts #85

gnachman opened this issue Feb 21, 2016 · 2 comments

Comments

@gnachman
Copy link

I use this code to add an entry to known_hosts:
https://github.com/NMSSH/NMSSH/blob/master/NMSSH/NMSSHSession.m#L710

I received a report that entries using unrecognized algorithms are getting removed:
https://gitlab.com/gnachman/iterm2/issues/4250

I confirmed this by creating a known_hosts file like this (personal data removed):

foo.bar.com ssh-rsa *redacted*
example.com ecdsa-sha2-nistp256 *redacted*

I then added a new host, and the ecdsa-sha2-nistp256 entry was removed. Entries whose algorithm field is ssh-rsa do not get clobbered.

alamaison added a commit to alamaison/swish that referenced this issue Feb 21, 2016
@alamaison
Copy link
Contributor

What version of libssh2 are you linking against? This was a known issue, but it was fixed 3 years ago. The fix first appeared in 1.5.0.

I've added some more test cases based on your specific example, but they all pass.

@gnachman
Copy link
Author

Sorry about that! I will make sure to update to the most recent version.

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

No branches or pull requests

2 participants