summaryrefslogtreecommitdiffstats
path: root/libssh/keyfiles.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/keyfiles.c')
-rw-r--r--libssh/keyfiles.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index 03782799..9512de0a 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -1615,6 +1615,12 @@ int ssh_is_server_known(ssh_session session) {
return SSH_SERVER_ERROR;
}
+ if (session->current_crypto == NULL){
+ ssh_set_error(session, SSH_FATAL,
+ "ssh_is_host_known called without cryptographic context");
+ leave_function();
+ return SSH_SERVER_ERROR;
+ }
host = ssh_lowercase(session->host);
hostport = ssh_hostport(host,session->port);
if (host == NULL || hostport == NULL) {