Subject: Re: [PATCH] add support for unknown key types in libssh2_knownhost_*

Re: [PATCH] add support for unknown key types in libssh2_knownhost_*

From: Salvador Fandiņo <>
Date: Sat, 05 Oct 2013 23:35:59 +0200

On 10/05/2013 11:08 PM, Daniel Stenberg wrote:
> On Wed, 2 Oct 2013, Salvador Fandino wrote:
> Okay, I removed some warnings and shortened a few lines and ammended the
> patch then looks like this one.

I attached two extra patches yesterday to the Trac ticket but I think
they are still waiting for moderation.

They solve the issues you had pointed in your previous mail (using
strlen and using goto inappropriately).

> I don't have any good test case setup to verify this patch so I'll
> appreciate an extra set of eyes on this patch if possible!
> Salvador, I assume you successfully use this functionality?

Yes, it is a bit convoluted, as I am using that feature from my Perl
module Net::SSH::Any that builds on top of Net::SSH2 which also needs
patching. But I am able to parse my known_hosts files which contain lots
of keys in formats not supported by libssh2 and write them back. I have
also checked that OpenSSH can then use the files modified by libssh2.

In any case, it is easy to test with any application based on libssh2
that uses the knownhost functionality. Just fake a new key type and see
how libssh2 is able to read the known_hosts file and write it back complete.

Received on 2013-10-05