summaryrefslogtreecommitdiff
path: root/kexdhs.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2004-06-15 10:30:09 +1000
committerDamien Miller <djm@mindrot.org>2004-06-15 10:30:09 +1000
commitf675fc4948b2ec2c9ff86bcdd58e00947f0e319b (patch)
treebabb42f0a29e7b24284a731cb894454d8f80fc97 /kexdhs.c
parent7cf17eb78c71ba16ec39bb1a6a8640885071a307 (diff)
- djm@cvs.openbsd.org 2004/06/13 12:53:24
[dh.c dh.h kex.c kex.h kexdhc.c kexdhs.c monitor.c myproposal.h] [ssh-keyscan.c sshconnect2.c sshd.c] implement diffie-hellman-group14-sha1 kex method (trivial extension to existing diffie-hellman-group1-sha1); ok markus@
Diffstat (limited to 'kexdhs.c')
-rw-r--r--kexdhs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kexdhs.c b/kexdhs.c
index f04bce82..225e6559 100644
--- a/kexdhs.c
+++ b/kexdhs.c
@@ -23,7 +23,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: kexdhs.c,v 1.1 2003/02/16 17:09:57 markus Exp $");
+RCSID("$OpenBSD: kexdhs.c,v 1.2 2004/06/13 12:53:24 djm Exp $");
#include "xmalloc.h"
#include "key.h"
@@ -45,7 +45,16 @@ kexdh_server(Kex *kex)
u_int slen;
/* generate server 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);
debug("expecting SSH2_MSG_KEXDH_INIT");