From 5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa Mon Sep 17 00:00:00 2001 From: Ruben Garcia Azuara Date: Tue, 6 Apr 2010 20:07:01 +0200 Subject: 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 Signed-off-by: Andreas Schneider --- libssh/keyfiles.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libssh/keyfiles.c') diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index e09de67..3e36989 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -1648,6 +1648,11 @@ int ssh_is_server_known(ssh_session session) { } } while (1); + if ( (ret == SSH_SERVER_NOT_KNOWN) && (session->StrictHostKeyChecking == 0) ) { + ssh_write_knownhost(session); + ret = SSH_SERVER_KNOWN_OK; + } + SAFE_FREE(host); if (file != NULL) { fclose(file); -- cgit