summaryrefslogtreecommitdiff
path: root/kex.c
diff options
context:
space:
mode:
authordjm <djm>2006-03-15 01:08:28 +0000
committerdjm <djm>2006-03-15 01:08:28 +0000
commit36da4b3feb159bafcd05d6c4c583eada8e1d55c4 (patch)
treef9c2c1ef035605841e133f5cd67d05c47a007fef /kex.c
parentcb53f20a3555727dc983dd05a266d0de7b030b06 (diff)
downloadopenssh-36da4b3feb159bafcd05d6c4c583eada8e1d55c4.tar.gz
- djm@cvs.openbsd.org 2006/03/07 09:07:40
[kex.c kex.h monitor.c myproposal.h ssh-keyscan.c sshconnect2.c sshd.c] Implement the diffie-hellman-group-exchange-sha256 key exchange method using the SHA256 code in libc (and wrapper to make it into an OpenSSL EVP), interop tested against CVS PuTTY NB. no portability bits committed yet
Diffstat (limited to 'kex.c')
-rw-r--r--kex.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kex.c b/kex.c
index cd71be9c..175613b4 100644
--- a/kex.c
+++ b/kex.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: kex.c,v 1.65 2005/11/04 05:15:59 djm Exp $");
+RCSID("$OpenBSD: kex.c,v 1.66 2006/03/07 09:07:40 djm Exp $");
#include <openssl/crypto.h>
@@ -44,6 +44,8 @@ RCSID("$OpenBSD: kex.c,v 1.65 2005/11/04 05:15:59 djm Exp $");
#define KEX_COOKIE_LEN 16
+extern const EVP_MD *evp_ssh_sha256(void);
+
/* prototype */
static void kex_kexinit_finish(Kex *);
static void kex_choose_conf(Kex *);
@@ -301,6 +303,9 @@ choose_kex(Kex *k, char *client, char *server)
} else if (strcmp(k->name, KEX_DHGEX_SHA1) == 0) {
k->kex_type = KEX_DH_GEX_SHA1;
k->evp_md = EVP_sha1();
+ } else if (strcmp(k->name, KEX_DHGEX_SHA256) == 0) {
+ k->kex_type = KEX_DH_GEX_SHA256;
+ k->evp_md = evp_ssh_sha256();
} else
fatal("bad kex alg %s", k->name);
}