summaryrefslogtreecommitdiffstats
path: root/libssh/options.c
diff options
context:
space:
mode:
authorRuben Garcia Azuara <rubenga@tid.es>2010-04-06 20:07:01 +0200
committerAndreas Schneider <mail@cynapses.org>2010-04-07 11:29:47 +0200
commit5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa (patch)
treeda155233397d23cd1f8d0f76b0108570c61079e7 /libssh/options.c
parent14eb593af3c41ea439f01d34aaae497d8420f316 (diff)
downloadlibssh-5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa.tar.gz
libssh-5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa.tar.xz
libssh-5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa.zip
Added support for StrictHostKeyChecking and UserKnownHostsFile parameters.
Added OpenSSH parameters to libssh: - StrictHostKeyChecking - UserKnownHostsFile This parameters are useful to avoid checking the fingerprint. Eg: ~/.ssh/config: Host 192.10.20.30 StrictHostKeyChecking no UserKnownHostsFile /dev/null Signed-off-by: Ruben Garcia Azuara <rubenga@tid.es> Signed-off-by: Andreas Schneider <mail@cynapses.org>
Diffstat (limited to 'libssh/options.c')
-rw-r--r--libssh/options.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libssh/options.c b/libssh/options.c
index 17e6857..2b3276a 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -362,6 +362,10 @@ char *dir_expand_dup(ssh_session session, const char *value, int allowsshdir) {
* Set the compression to use for server to client
* communication (string, "none" or "zlib").
*
+ * - SSH_OPTIONS_HOSTKEYCHECK:
+ * Set the parameter StrictHostKeyChecking to avoid
+ * asking about a fingerprint
+ *
* @param value The value to set. This is a generic pointer and the
* datatype which is used should be set according to the
* type set.
@@ -612,6 +616,14 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
return -1;
}
break;
+ case SSH_OPTIONS_HOSTKEYCHECK:
+ if (value == NULL) {
+ ssh_set_error_invalid(session, __FUNCTION__);
+ return -1;
+ } else {
+ session->StrictHostKeyChecking = *(int*)value;
+ }
+ break;
default:
ssh_set_error(session, SSH_REQUEST_DENIED, "Unknown ssh option %d", type);
return -1;