summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 15ee05b6642..7e89dd057ba 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -40,7 +40,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.138 2000/12/12 22:30:02 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.139 2000/12/15 17:30:14 provos Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -1428,6 +1428,10 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
fatal("Unsupported hostkey type %d", kex->hostkey_type);
/* KEXDH */
+ /* generate DH key */
+ dh = dh_new_group1(); /* XXX depends on 'kex' */
+ dh_gen_key(dh);
+
debug("Wait SSH2_MSG_KEXDH_INIT.");
packet_read_expect(&payload_len, SSH2_MSG_KEXDH_INIT);
@@ -1444,9 +1448,6 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
debug("bits %d", BN_num_bits(dh_client_pub));
#endif
- /* generate DH key */
- dh = dh_new_group1(); /* XXX depends on 'kex' */
-
#ifdef DEBUG_KEXDH
fprintf(stderr, "\np= ");
BN_print_fp(stderr, dh->p);
@@ -1568,6 +1569,10 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit)
packet_send();
packet_write_wait();
+ /* Compute our exchange value in parallel with the client */
+
+ dh_gen_key(dh);
+
debug("Wait SSH2_MSG_KEX_DH_GEX_INIT.");
packet_read_expect(&payload_len, SSH2_MSG_KEX_DH_GEX_INIT);