summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-30 13:44:51 +1000
committerDamien Miller <djm@mindrot.org>2000-05-30 13:44:51 +1000
commitb1715dc0cf5ea91707b437310f63b17bed2dc7a6 (patch)
treef7fe557697d12b37c6be6a97c6ce083d23fd07de /sshd.c
parent9448c002db7427058ecca76760f3a75e379bf0a1 (diff)
- OpenBSD CVS updates:
- markus@cvs.openbsd.org [session.c] make x11-fwd work w/ localhost (xauth add host/unix:11) [cipher.c compat.c readconf.c servconf.c] check strtok() != NULL; ok niels@ [key.c] fix key_read() for uuencoded keys w/o '=' [serverloop.c] group ssh1 vs. ssh2 in serverloop [kex.c kex.h myproposal.h sshconnect2.c sshd.c] split kexinit/kexdh, factor out common code [readconf.c ssh.1 ssh.c] forwardagent defaults to no, add ssh -A - theo@cvs.openbsd.org [session.c] just some line shortening
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c47
1 files changed, 7 insertions, 40 deletions
diff --git a/sshd.c b/sshd.c
index 39fbcba4..ec860024 100644
--- a/sshd.c
+++ b/sshd.c
@@ -14,7 +14,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.117 2000/05/18 13:27:36 djm Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.118 2000/05/25 20:45:20 markus Exp $");
#include "xmalloc.h"
#include "rsa.h"
@@ -1159,7 +1159,6 @@ do_ssh2_kex()
int payload_len, dlen;
int slen;
unsigned int klen, kout;
- char *ptr;
unsigned char *signature = NULL;
unsigned char *server_host_key_blob = NULL;
unsigned int sbloblen;
@@ -1171,7 +1170,6 @@ do_ssh2_kex()
unsigned char *hash;
Kex *kex;
char *cprop[PROPOSAL_MAX];
- char *sprop[PROPOSAL_MAX];
/* KEXINIT */
@@ -1179,46 +1177,15 @@ do_ssh2_kex()
myproposal[PROPOSAL_ENC_ALGS_CTOS] =
myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers;
}
-
- debug("Sending KEX init.");
-
- for (i = 0; i < PROPOSAL_MAX; i++)
- sprop[i] = xstrdup(myproposal[i]);
- server_kexinit = kex_init(sprop);
- packet_start(SSH2_MSG_KEXINIT);
- packet_put_raw(buffer_ptr(server_kexinit), buffer_len(server_kexinit));
- packet_send();
- packet_write_wait();
-
- debug("done");
-
- packet_read_expect(&payload_len, SSH2_MSG_KEXINIT);
-
- /*
- * save raw KEXINIT payload in buffer. this is used during
- * computation of the session_id and the session keys.
- */
+ server_kexinit = kex_init(myproposal);
client_kexinit = xmalloc(sizeof(*client_kexinit));
buffer_init(client_kexinit);
- ptr = packet_get_raw(&payload_len);
- buffer_append(client_kexinit, ptr, payload_len);
- /* skip cookie */
- for (i = 0; i < 16; i++)
- (void) packet_get_char();
- /* save kex init proposal strings */
- for (i = 0; i < PROPOSAL_MAX; i++) {
- cprop[i] = packet_get_string(NULL);
- debug("got kexinit string: %s", cprop[i]);
- }
-
- i = (int) packet_get_char();
- debug("first kex follow == %d", i);
- i = packet_get_int();
- debug("reserved == %d", i);
-
- debug("done read kexinit");
- kex = kex_choose_conf(cprop, sprop, 1);
+ /* algorithm negotiation */
+ kex_exchange_kexinit(server_kexinit, client_kexinit, cprop);
+ kex = kex_choose_conf(cprop, myproposal, 1);
+ for (i = 0; i < PROPOSAL_MAX; i++)
+ xfree(cprop[i]);
/* KEXDH */