diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -40,7 +40,7 @@ | |||
40 | */ | 40 | */ |
41 | 41 | ||
42 | #include "includes.h" | 42 | #include "includes.h" |
43 | RCSID("$OpenBSD: sshd.c,v 1.137 2000/12/12 21:45:21 markus Exp $"); | 43 | RCSID("$OpenBSD: sshd.c,v 1.139 2000/12/15 17:30:14 provos Exp $"); |
44 | 44 | ||
45 | #include "xmalloc.h" | 45 | #include "xmalloc.h" |
46 | #include "rsa.h" | 46 | #include "rsa.h" |
@@ -1452,6 +1452,10 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) | |||
1452 | fatal("Unsupported hostkey type %d", kex->hostkey_type); | 1452 | fatal("Unsupported hostkey type %d", kex->hostkey_type); |
1453 | 1453 | ||
1454 | /* KEXDH */ | 1454 | /* KEXDH */ |
1455 | /* generate DH key */ | ||
1456 | dh = dh_new_group1(); /* XXX depends on 'kex' */ | ||
1457 | dh_gen_key(dh); | ||
1458 | |||
1455 | debug("Wait SSH2_MSG_KEXDH_INIT."); | 1459 | debug("Wait SSH2_MSG_KEXDH_INIT."); |
1456 | packet_read_expect(&payload_len, SSH2_MSG_KEXDH_INIT); | 1460 | packet_read_expect(&payload_len, SSH2_MSG_KEXDH_INIT); |
1457 | 1461 | ||
@@ -1468,9 +1472,6 @@ ssh_dh1_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) | |||
1468 | debug("bits %d", BN_num_bits(dh_client_pub)); | 1472 | debug("bits %d", BN_num_bits(dh_client_pub)); |
1469 | #endif | 1473 | #endif |
1470 | 1474 | ||
1471 | /* generate DH key */ | ||
1472 | dh = dh_new_group1(); /* XXX depends on 'kex' */ | ||
1473 | |||
1474 | #ifdef DEBUG_KEXDH | 1475 | #ifdef DEBUG_KEXDH |
1475 | fprintf(stderr, "\np= "); | 1476 | fprintf(stderr, "\np= "); |
1476 | BN_print_fp(stderr, dh->p); | 1477 | BN_print_fp(stderr, dh->p); |
@@ -1592,6 +1593,10 @@ ssh_dhgex_server(Kex *kex, Buffer *client_kexinit, Buffer *server_kexinit) | |||
1592 | packet_send(); | 1593 | packet_send(); |
1593 | packet_write_wait(); | 1594 | packet_write_wait(); |
1594 | 1595 | ||
1596 | /* Compute our exchange value in parallel with the client */ | ||
1597 | |||
1598 | dh_gen_key(dh); | ||
1599 | |||
1595 | debug("Wait SSH2_MSG_KEX_DH_GEX_INIT."); | 1600 | debug("Wait SSH2_MSG_KEX_DH_GEX_INIT."); |
1596 | packet_read_expect(&payload_len, SSH2_MSG_KEX_DH_GEX_INIT); | 1601 | packet_read_expect(&payload_len, SSH2_MSG_KEX_DH_GEX_INIT); |
1597 | 1602 | ||