Skip to content

Commit afb1088

Browse files
committed
ssh server CHANGE explicit key exchange and pubkey key types
1 parent 66c36f2 commit afb1088

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/session_server_ssh.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <errno.h>
2525
#include <time.h>
2626

27+
#include "config.h"
2728
#include "session_server.h"
2829
#include "session_server_ch.h"
2930
#include "libnetconf.h"
@@ -1342,6 +1343,13 @@ nc_accept_ssh_session(struct nc_session *session, int sock, int timeout)
13421343
close(sock);
13431344
return -1;
13441345
}
1346+
ssh_options_set(session->ti.libssh.session, SSH_OPTIONS_KEY_EXCHANGE, "curve25519-sha256,ecdh-sha2-nistp256,"
1347+
"diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group-exchange-sha256,"
1348+
"diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1");
1349+
#ifdef HAVE_LIBSSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES
1350+
ssh_options_set(session->ti.libssh.session, SSH_OPTIONS_PUBLICKEY_ACCEPTED_TYPES, "ssh-ed25519,ecdsa-sha2-nistp256,"
1351+
"ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss");
1352+
#endif
13451353

13461354
if (opts->auth_methods & NC_SSH_AUTH_PUBLICKEY) {
13471355
libssh_auth_methods |= SSH_AUTH_METHOD_PUBLICKEY;

0 commit comments

Comments
 (0)