aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2014-09-03 09:32:15 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-02-02 14:45:52 +0100
commit01a6004171c6a899192c87dfe5a8ff27c30b1eaf (patch)
treea8b05587075c5b701ac6f393212bacd22e51d0b6
parent4f5660e0813da09b3cbf2f24b301742abcc1e597 (diff)
downloadlibssh-01a6004171c6a899192c87dfe5a8ff27c30b1eaf.tar.gz
libssh-01a6004171c6a899192c87dfe5a8ff27c30b1eaf.tar.xz
libssh-01a6004171c6a899192c87dfe5a8ff27c30b1eaf.zip
kex: Add support for ed25519 on client connections.
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/kex.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/kex.c b/src/kex.c
index 059ef157..f9a12eae 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -75,9 +75,9 @@
#ifdef HAVE_ECDH
#define ECDH "ecdh-sha2-nistp256,"
-#define HOSTKEYS "ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss"
+#define HOSTKEYS "ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss"
#else
-#define HOSTKEYS "ssh-rsa,ssh-dss"
+#define HOSTKEYS "ssh-ed25519,ssh-rsa,ssh-dss"
#define ECDH ""
#endif
@@ -483,8 +483,16 @@ void ssh_list_kex(struct ssh_kex_struct *kex) {
*/
static char *ssh_client_select_hostkeys(ssh_session session){
char methods_buffer[128]={0};
- static const char *preferred_hostkeys[]={"ecdsa-sha2-nistp521","ecdsa-sha2-nistp384",
- "ecdsa-sha2-nistp256", "ssh-rsa", "ssh-dss", "ssh-rsa1", NULL};
+ static const char *preferred_hostkeys[] = {
+ "ssh-ed25519",
+ "ecdsa-sha2-nistp521",
+ "ecdsa-sha2-nistp384",
+ "ecdsa-sha2-nistp256",
+ "ssh-rsa",
+ "ssh-dss",
+ "ssh-rsa1",
+ NULL
+ };
char **methods;
int i,j;
int needcoma=0;