knownhosts: Take StrictHostKeyChecking option into account

Signed-off-by: Sanne Raymaekers <sraymaek@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Sanne Raymaekers
2018-11-08 13:28:03 +01:00
committed by Andreas Schneider
parent 03c30e9c8a
commit 67f418218b
2 changed files with 41 additions and 0 deletions

View File

@@ -883,6 +883,9 @@ ssh_session_get_known_hosts_entry(ssh_session session,
/* If we did not find any match at all: we report the previous result */
if (rv == SSH_KNOWN_HOSTS_UNKNOWN) {
if (session->opts.StrictHostKeyChecking == 0) {
return SSH_KNOWN_HOSTS_OK;
}
return old_rv;
}