diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2004-06-13 12:53:25 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2004-06-13 12:53:25 +0000 |
commit | 455e6209d3559a2ee5d7b59c649c0805540a3591 (patch) | |
tree | 08941dbdb41c6b48f7bc4b05c505af786c148904 /usr.bin/ssh/kexdhc.c | |
parent | 0fbac0108c25d248520ed15ba6befac349f0a689 (diff) |
implement diffie-hellman-group14-sha1 kex method (trivial extension to
existing diffie-hellman-group1-sha1); ok markus@
Diffstat (limited to 'usr.bin/ssh/kexdhc.c')
-rw-r--r-- | usr.bin/ssh/kexdhc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/ssh/kexdhc.c b/usr.bin/ssh/kexdhc.c index fe6dc53f859..f48bd46785b 100644 --- a/usr.bin/ssh/kexdhc.c +++ b/usr.bin/ssh/kexdhc.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: kexdhc.c,v 1.1 2003/02/16 17:09:57 markus Exp $"); +RCSID("$OpenBSD: kexdhc.c,v 1.2 2004/06/13 12:53:24 djm Exp $"); #include "xmalloc.h" #include "key.h" @@ -44,7 +44,16 @@ kexdh_client(Kex *kex) u_int klen, kout, slen, sbloblen; /* generate and send 'e', client DH public key */ - dh = dh_new_group1(); + switch (kex->kex_type) { + case KEX_DH_GRP1_SHA1: + dh = dh_new_group1(); + break; + case KEX_DH_GRP14_SHA1: + dh = dh_new_group14(); + break; + default: + fatal("%s: Unexpected KEX type %d", __func__, kex->kex_type); + } dh_gen_key(dh, kex->we_need * 8); packet_start(SSH2_MSG_KEXDH_INIT); packet_put_bignum2(dh->pub_key); |