1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-12 15:41:16 +03:00

server: Use default methods instead of all

Previously, when no methods were set, the server would enable all
supported methods.  This changes this behaviour by setting only the
default methods.

The server in pkd_daemon.c was changed to set explicitly all the
supported methods to keep the previous behaviour.

Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Anderson Toshiyuki Sasaki
2019-05-22 19:01:18 +02:00
committed by Andreas Schneider
parent 2db2a4e170
commit dc35bbbeb1
2 changed files with 18 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ int server_set_kex(ssh_session session)
if (session->opts.wanted_methods[SSH_HOSTKEYS]) {
allowed = session->opts.wanted_methods[SSH_HOSTKEYS];
} else {
allowed = ssh_kex_get_supported_method(SSH_HOSTKEYS);
allowed = ssh_kex_get_default_methods(SSH_HOSTKEYS);
}
/* It is expected for the list of allowed hostkeys to be ordered by
@@ -164,7 +164,7 @@ int server_set_kex(ssh_session session)
for (i = 0; i < 10; i++) {
if ((wanted = session->opts.wanted_methods[i]) == NULL) {
wanted = ssh_kex_get_supported_method(i);
wanted = ssh_kex_get_default_methods(i);
}
server->methods[i] = strdup(wanted);
if (server->methods[i] == NULL) {