aboutsummaryrefslogtreecommitdiff
path: root/src/kex.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2018-09-10 14:56:07 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-09-19 12:17:02 +0200
commitd9d3b65df27e2a2e5c5b36d67ff91852cfde5156 (patch)
treeea59e615244fe245363384a2cb3562294fa70f9d /src/kex.c
parent97cb302c0ea43788a78853f8fd4a8bfa066191a3 (diff)
downloadlibssh-d9d3b65df27e2a2e5c5b36d67ff91852cfde5156.tar.gz
libssh-d9d3b65df27e2a2e5c5b36d67ff91852cfde5156.tar.xz
libssh-d9d3b65df27e2a2e5c5b36d67ff91852cfde5156.zip
dh: Add diffie-hellman-group16-sha512 support
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/kex.c')
-rw-r--r--src/kex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/kex.c b/src/kex.c
index 04119907..25793ef6 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -98,7 +98,7 @@
#define CHACHA20 "chacha20-poly1305@openssh.com,"
-#define KEY_EXCHANGE CURVE25519 ECDH "diffie-hellman-group14-sha1,diffie-hellman-group1-sha1"
+#define KEY_EXCHANGE CURVE25519 ECDH "diffie-hellman-group16-sha512,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1"
#define KEX_METHODS_SIZE 10
/* RFC 8308 */
@@ -755,6 +755,8 @@ int ssh_kex_select_methods (ssh_session session){
session->next_crypto->kex_type=SSH_KEX_DH_GROUP1_SHA1;
} else if(strcmp(session->next_crypto->kex_methods[SSH_KEX], "diffie-hellman-group14-sha1") == 0){
session->next_crypto->kex_type=SSH_KEX_DH_GROUP14_SHA1;
+ } else if(strcmp(session->next_crypto->kex_methods[SSH_KEX], "diffie-hellman-group16-sha512") == 0){
+ session->next_crypto->kex_type=SSH_KEX_DH_GROUP16_SHA512;
} else if(strcmp(session->next_crypto->kex_methods[SSH_KEX], "ecdh-sha2-nistp256") == 0){
session->next_crypto->kex_type=SSH_KEX_ECDH_SHA2_NISTP256;
} else if(strcmp(session->next_crypto->kex_methods[SSH_KEX], "ecdh-sha2-nistp384") == 0){