Subject: Re: known_hosts support (first take)

Re: known_hosts support (first take)

From: Mikhail Gusarov <dottedmag_at_dottedmag.net>
Date: Mon, 04 May 2009 18:42:02 +0700

Twas brillig at 13:38:44 04.05.2009 UTC+02 when daniel_at_haxx.se did gyre and gimble:

 DS> In my initial take I'll focus on OpenSSH complience, but I figure
 DS> it could be useful to see what it takes to support putty's file
 DS> format too. Anyone knows any details?

Erm... What?

LIBSSH2_API const char *
libssh2_hostkey_hash(LIBSSH2_SESSION * session, int hash_type)
{
    switch (hash_type) {
#if LIBSSH2_MD5
    case LIBSSH2_HOSTKEY_HASH_MD5:
        return (char *) session->server_hostkey_md5;
        break;
#endif /* LIBSSH2_MD5 */
    case LIBSSH2_HOSTKEY_HASH_SHA1:
        return (char *) session->server_hostkey_sha1;
        break;
    default:
        return NULL;
    }
}

You just need a function returning
session->{server_hostkey,server_hostkey_len} as a const char* / int
correspondingly.

-- 

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf

_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Received on 2009-05-04