mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
Added return code SSH_SERVER_FILE_NOT_FOUND
This error is returned by ssh_is_server_known when known_hosts file does not exist and gives more action to the developer.
This commit is contained in:
@@ -134,6 +134,7 @@ typedef int socket_t;
|
|||||||
#define SSH_SERVER_KNOWN_OK 1
|
#define SSH_SERVER_KNOWN_OK 1
|
||||||
#define SSH_SERVER_KNOWN_CHANGED 2
|
#define SSH_SERVER_KNOWN_CHANGED 2
|
||||||
#define SSH_SERVER_FOUND_OTHER 3
|
#define SSH_SERVER_FOUND_OTHER 3
|
||||||
|
#define SSH_SERVER_FILE_NOT_FOUND 4
|
||||||
|
|
||||||
#ifndef MD5_DIGEST_LEN
|
#ifndef MD5_DIGEST_LEN
|
||||||
#define MD5_DIGEST_LEN 16
|
#define MD5_DIGEST_LEN 16
|
||||||
|
|||||||
@@ -1361,10 +1361,10 @@ int ssh_is_server_known(SSH_SESSION *session) {
|
|||||||
enter_function();
|
enter_function();
|
||||||
|
|
||||||
if (ssh_options_default_known_hosts_file(session->options) < 0) {
|
if (ssh_options_default_known_hosts_file(session->options) < 0) {
|
||||||
ssh_set_error(session, SSH_FATAL,
|
ssh_set_error(session, SSH_REQUEST_DENIED,
|
||||||
"Can't find a known_hosts file");
|
"Can't find a known_hosts file");
|
||||||
leave_function();
|
leave_function();
|
||||||
return SSH_SERVER_ERROR;
|
return SSH_SERVER_FILE_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session->options->host == NULL) {
|
if (session->options->host == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user