www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: Create host key fingerprint like ssh-keygen does

Re: Create host key fingerprint like ssh-keygen does

From: Andreas Sommer <andreas.sommer87_at_googlemail.com>
Date: Tue, 22 Sep 2015 08:37:38 +0200

On 21.09.2015 19:33, Alexander Lamaison wrote:
> On 18 September 2015 at 10:35, Andreas Sommer
> <andreas.sommer87_at_googlemail.com> wrote:
>> Hey,
>> I'm using libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_SHA1) as in
>> the example code [1], creating a fingerprint string like "11:22:...".
>> However this is not the fingerprint I get displayed when connecting with
>> "ssh HOSTNAME" for the first time, or when running "ssh-keygen -lf
>> PUBLICKEYFILE" against the server's public key.
> That hash is normally the MD5 hash, not the SHA1 hash. Try
> Alex

Ah, makes sense. I didn't count the fingerprint size, else I would have
noticed. Got it working with MD5 fingerprints, thank you!

- Andreas
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2015-09-22

the libssh2 team