aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2017-02-05 20:30:04 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-06-04 11:20:28 +0200
commit702e9e8ad56491e3dda7fc215c8e2f4f139e2d2e (patch)
treeeda56b6a0137b269d0c7ab9a1e6c1e64036860dd /include
parent250bf37a28ab3e320db1c9fc93971ddfc9a5e88c (diff)
downloadlibssh-702e9e8ad56491e3dda7fc215c8e2f4f139e2d2e.tar.gz
libssh-702e9e8ad56491e3dda7fc215c8e2f4f139e2d2e.tar.xz
libssh-702e9e8ad56491e3dda7fc215c8e2f4f139e2d2e.zip
knownhosts: Introduce new known hosts managing functions
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include')
-rw-r--r--include/libssh/libssh.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index 0f509aea..ac5daaab 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -267,6 +267,16 @@ enum ssh_keycmp_e {
SSH_KEY_CMP_PRIVATE
};
+#define SSH_ADDRSTRLEN 46
+
+struct ssh_knownhosts_entry {
+ char *hostname;
+ char *unparsed;
+ ssh_key publickey;
+ char *comment;
+};
+
+
/* Error return codes */
#define SSH_OK 0 /* No error */
#define SSH_ERROR -1 /* Error of some kind */
@@ -505,6 +515,19 @@ LIBSSH_API int ssh_is_blocking(ssh_session session);
LIBSSH_API int ssh_is_connected(ssh_session session);
LIBSSH_API int ssh_is_server_known(ssh_session session);
+/* KNOWN HOSTS */
+LIBSSH_API void ssh_knownhosts_entry_free(struct ssh_knownhosts_entry *entry);
+#define SSH_KNOWNHOSTS_ENTRY_FREE(e) do { \
+ if ((e) != NULL) { \
+ ssh_knownhosts_entry_free(e); \
+ e = NULL; \
+ } \
+} while(0)
+
+LIBSSH_API int ssh_known_hosts_parse_line(const char *host,
+ const char *line,
+ struct ssh_knownhosts_entry **entry);
+
/* LOGGING */
LIBSSH_API int ssh_set_log_level(int level);
LIBSSH_API int ssh_get_log_level(void);