summaryrefslogtreecommitdiff
path: root/kexdhc.c
diff options
context:
space:
mode:
authordjm <djm>2004-06-15 00:30:09 +0000
committerdjm <djm>2004-06-15 00:30:09 +0000
commit9de117ac3a8750788277dfd8585b7da80098a7b3 (patch)
treed99de7efcd7e3839ff3f2c4ed626a05bc245b982 /kexdhc.c
parent17aefec43669727e9e74b0383dd034430811e22e (diff)
downloadopenssh-9de117ac3a8750788277dfd8585b7da80098a7b3.tar.gz
- 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 'kexdhc.c')
-rw-r--r--kexdhc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kexdhc.c b/kexdhc.c
index fe6dc53f..f48bd467 100644
--- a/kexdhc.c
+++ b/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);