1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-10-31 23:30:25 +03:00

My knownhost work as of right now. It works at least partly. More tests and

tweaks will come.
This commit is contained in:
Daniel Stenberg
2009-05-07 13:09:48 +00:00
parent 4bc1b8a1d7
commit 4b991b232d
11 changed files with 994 additions and 35 deletions

View File

@@ -922,7 +922,44 @@ struct _LIBSSH2_SESSION
#define LIBSSH2_SOCKET_RECV_FLAGS(session) 0
#endif
/* libssh2 extensible ssh api, ultimately I'd like to allow loading additional methods via .so/.dll */
/* -------- */
/* First take towards a generic linked list handling code for libssh2
internals */
struct list_head {
struct list_node *last;
struct list_node *first;
};
struct list_node {
struct list_node *next;
struct list_node *prev;
struct list_head *head;
};
/* --------- */
struct known_host {
struct list_node node;
char *name; /* points to the name or the hash (allocated) */
size_t name_len; /* needed for hashed data */
int typemask; /* plain, sha1, custom, ... */
char *salt; /* points to binary salt (allocated) */
size_t salt_len; /* size of salt */
char *key; /* the (allocated) associated key. This is kept base64
encoded in memory. */
};
struct _LIBSSH2_KNOWNHOSTS
{
LIBSSH2_SESSION *session; /* the session this "belongs to" */
struct list_head head;
};
/* libssh2 extensible ssh api, ultimately I'd like to allow loading additional
methods via .so/.dll */
struct _LIBSSH2_KEX_METHOD
{