Subject: Re: known_hosts support (first take)

Re: known_hosts support (first take)

From: J.T. Conklin <jtc_at_acorntoolworks.com>
Date: Mon, 04 May 2009 11:03:57 -0700

Daniel Stenberg <daniel_at_haxx.se> writes:
> My idea is to write/offer functions for libssh2 that can:
>
> A read the known_hosts file(s) and keep a set of hosts/key pair in memory
> B compare a host/key with the known set to see if it exists and if so if it
> matches the key
> C add/replace a host key/key in the in-memory set
> D write the in-memory set to a file
> E extract an (OpenSSH-compatible) key for key checking - from a connected
> session
>
> That patch I link to above doesn't seem to offer D and E, but does
> at least parts of A, B and C.
>
> I'm open for feedback and comments on this. I've not yet figured out
> the (E) part so I'm perhaps most interested on that... How does
> libssh2_hostkey_hash() relate to all this?

I'm not currently using libssh2 (I subscribed to the list when I was
working at another company which used it), so feel free to take this
with a grain of salt.

But it seems to me, a general purpose library like libssh2 should
support fetching and storing known host entries, keys, etc. with a
layer of indirection, with replaceable function pointer hooks. In
this way, these elements can be retrieved from/stored to the file-
system like openssh (assuming the default implementation does this),
but could also be retrieved from/stored to a database, the windows
registry, etc.

This would have been useful for my previous project. Our appliance
config was stored in a DB, which was replicated across all nodes in
a HA/FT domain. If there was a way to get libssh2 to access config
"files" through the DB things would "just work", without an agent to
synchronize changes from the filesystem and DB and vice versa.

Unfortunately, my current project doesn't use libssh2, and I don't
have time to contribute such changes myself.

    --jtc

-- 
J.T. Conklin
------------------------------------------------------------------------------
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