Subject: Re: known hosts API, updated

Re: known hosts API, updated

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 5 Jun 2009 09:05:08 +0200 (CEST)

On Thu, 4 Jun 2009, Ben Kibbey wrote:

> What about generating a new known_hosts entry based on the current
> connection? something like libssh2_knownhosts_current() which can be
> processed before host validation?

I'm not sure I follow the logic for such a use case. If you connect to a host
right now, surely you want that host to already be a known host?

If it isn't, the API will tell you. And you can add this current host to the
internal list of known hosts with libssh2_knownhost_add().

Hm, it just now struck me that the libssh2_session_hostkey() function is still
not documented in a man page (I'll fix right away) but also that it doesn't
report the key type. I think we need to fix this.

Oh, and to top it off. If you want to append the new host to the existing
known_hosts file (like after the user having acked it), you get a pointer back
in libssh2_knownhost_add() which you can use to call
libssh2_knownhost_writeline(). Or you call libssh2_knownhost_writefile() to
produce an entirely new known_hosts file.

-- 
  / daniel.haxx.se
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2009-06-05