Skip to content

Commit 648ecdf

Browse files
author
roman
committed
session server ssh UPDATE transport algs both dirs
Fixes #523
1 parent 2954396 commit 648ecdf

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/session_server_ssh.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,17 +1946,29 @@ nc_accept_ssh_session(struct nc_session *session, struct nc_server_ssh_opts *opt
19461946
rc = -1;
19471947
goto cleanup;
19481948
}
1949-
if (opts->encryption_algs && ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_CIPHERS_S_C, opts->encryption_algs)) {
1950-
rc = -1;
1951-
goto cleanup;
1949+
if (opts->encryption_algs) {
1950+
if (ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_CIPHERS_S_C, opts->encryption_algs)) {
1951+
rc = -1;
1952+
goto cleanup;
1953+
}
1954+
if (ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_CIPHERS_C_S, opts->encryption_algs)) {
1955+
rc = -1;
1956+
goto cleanup;
1957+
}
19521958
}
19531959
if (opts->kex_algs && ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_KEY_EXCHANGE, opts->kex_algs)) {
19541960
rc = -1;
19551961
goto cleanup;
19561962
}
1957-
if (opts->mac_algs && ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_HMAC_S_C, opts->mac_algs)) {
1958-
rc = -1;
1959-
goto cleanup;
1963+
if (opts->mac_algs) {
1964+
if (ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_HMAC_S_C, opts->mac_algs)) {
1965+
rc = -1;
1966+
goto cleanup;
1967+
}
1968+
if (ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_HMAC_C_S, opts->mac_algs)) {
1969+
rc = -1;
1970+
goto cleanup;
1971+
}
19601972
}
19611973

19621974
/* configure the ssh banner */

0 commit comments

Comments
 (0)