Skip to content

Commit 8fd6fca

Browse files
committed
client session BUGFIX accept all supported public key algorithms
Even for Call Home sessions.
1 parent 5ea84c1 commit 8fd6fca

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/session_client_ssh.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,12 +1831,12 @@ nc_accept_callhome_ssh_sock(int sock, const char *host, uint16_t port, struct ly
18311831
} else {
18321832
ssh_options_set(sess, SSH_OPTIONS_USER, ssh_ch_opts.username);
18331833
}
1834-
if (ssh_options_set(sess, SSH_OPTIONS_HOSTKEYS,
1835-
"ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,"
1836-
"ecdsa-sha2-nistp256,ssh-rsa,ssh-dss,ssh-rsa1")) {
1837-
/* ecdsa is probably not supported... */
1838-
ssh_options_set(sess, SSH_OPTIONS_HOSTKEYS, "ssh-ed25519,ssh-rsa,ssh-dss,ssh-rsa1");
1839-
}
1834+
ssh_options_set(sess, SSH_OPTIONS_HOSTKEYS, "ssh-ed25519,ecdsa-sha2-nistp256,"
1835+
"ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss");
1836+
#ifdef HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES
1837+
ssh_options_set(sess, SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES, "ssh-ed25519,ecdsa-sha2-nistp256,"
1838+
"ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss");
1839+
#endif
18401840

18411841
session = _nc_connect_libssh(sess, ctx, &ssh_ch_opts, timeout);
18421842
if (session) {

0 commit comments

Comments
 (0)