client UPDATE set known_hosts file/mode
Added two new API calls, one of them sets the path to the known_hosts
file and the other sets the behaviour of host key checking. Now the
client's host key checking functionality is similar to the one described
in man ssh_config under StrictHostKeyChecking.
diff --git a/src/session.h b/src/session.h
index a533477..55f4a0d 100644
--- a/src/session.h
+++ b/src/session.h
@@ -34,6 +34,17 @@
NC_SSH_AUTH_INTERACTIVE = 0x04 /**< interactive SSH authentication */
} NC_SSH_AUTH_TYPE;
+/**
+ * @brief Enumeration of host key checking and known_hosts entry adding modes
+ */
+typedef enum {
+ NC_SSH_KNOWNHOSTS_ASK = 0, /**< add a known_hosts entry, but with a prompt */
+ NC_SSH_KNOWNHOSTS_STRICT, /**< do not add a known_hosts entry and the server's host key must be present in the configured known_hosts file */
+ NC_SSH_KNOWNHOSTS_ACCEPT_NEW, /**< add a known_hosts entry without a prompt */
+ NC_SSH_KNOWNHOSTS_ACCEPT, /**< add a known_hosts entry without a prompt and allow connections to servers which changed their host key */
+ NC_SSH_KNOWNHOSTS_SKIP /**< do not add a known_hosts entry and skip all host key checks */
+} NC_SSH_KNOWNHOSTS_MODE;
+
#endif /* NC_ENABLED_SSH */
#ifdef NC_ENABLED_TLS