1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-07 08:02:56 +03:00

libssh2_knownhost_add() got an additional argument: 'store' so that an

application can get a pointer back to the internal representation of the host
it just added. Useful for example when the app wants to add a host, and then
convert that exact same host to a line for storing in a known host file.
'store' can also be set to NULL to simple not care.
This commit is contained in:
Daniel Stenberg
2009-05-29 18:40:29 +02:00
parent 517909d37a
commit e52a1057fd
3 changed files with 45 additions and 33 deletions

View File

@@ -670,6 +670,14 @@ LIBSSH2_API
const char *libssh2_version(int req_version_num);
struct libssh2_knownhost {
unsigned int magic; /* magic stored by the library */
void *node; /* handle to the internal representation of this host */
char *name; /* this is NULL if no plain text host name exists */
char *key; /* key in base64/printable format */
int typemask;
};
/*
* libssh2_knownhost_init
*
@@ -721,7 +729,8 @@ LIBSSH2_API int
libssh2_knownhost_add(LIBSSH2_KNOWNHOSTS *hosts,
const char *host,
const char *salt,
const char *key, size_t keylen, int typemask);
const char *key, size_t keylen, int typemask,
struct libssh2_knownhost **store);
/*
* libssh2_knownhost_check
@@ -741,13 +750,6 @@ libssh2_knownhost_add(LIBSSH2_KNOWNHOSTS *hosts,
* LIBSSH2_KNOWNHOST_CHECK_* values, see below
*
*/
struct libssh2_knownhost {
unsigned int magic; /* magic stored by the library */
void *node; /* handle to the internal representation of this host */
char *name; /* this is NULL if no plain text host name exists */
char *key; /* key in base64/printable format */
int typemask;
};
#define LIBSSH2_KNOWNHOST_CHECK_MATCH 0
#define LIBSSH2_KNOWNHOST_CHECK_MISMATCH 1