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 39fbcba40..ec860024b 100644
--- a/sshd.c
+++ b/sshd.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: sshd.c,v 1.117 2000/05/18 13:27:36 djm Exp $"); 17RCSID("$OpenBSD: sshd.c,v 1.118 2000/05/25 20:45:20 markus Exp $");
18 18
19#include "xmalloc.h" 19#include "xmalloc.h"
20#include "rsa.h" 20#include "rsa.h"
@@ -1159,7 +1159,6 @@ do_ssh2_kex()
1159 int payload_len, dlen; 1159 int payload_len, dlen;
1160 int slen; 1160 int slen;
1161 unsigned int klen, kout; 1161 unsigned int klen, kout;
1162 char *ptr;
1163 unsigned char *signature = NULL; 1162 unsigned char *signature = NULL;
1164 unsigned char *server_host_key_blob = NULL; 1163 unsigned char *server_host_key_blob = NULL;
1165 unsigned int sbloblen; 1164 unsigned int sbloblen;
@@ -1171,7 +1170,6 @@ do_ssh2_kex()
1171 unsigned char *hash; 1170 unsigned char *hash;
1172 Kex *kex; 1171 Kex *kex;
1173 char *cprop[PROPOSAL_MAX]; 1172 char *cprop[PROPOSAL_MAX];
1174 char *sprop[PROPOSAL_MAX];
1175 1173
1176/* KEXINIT */ 1174/* KEXINIT */
1177 1175
@@ -1179,46 +1177,15 @@ do_ssh2_kex()
1179 myproposal[PROPOSAL_ENC_ALGS_CTOS] = 1177 myproposal[PROPOSAL_ENC_ALGS_CTOS] =
1180 myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers; 1178 myproposal[PROPOSAL_ENC_ALGS_STOC] = options.ciphers;
1181 } 1179 }
1182 1180 server_kexinit = kex_init(myproposal);
1183 debug("Sending KEX init.");
1184
1185 for (i = 0; i < PROPOSAL_MAX; i++)
1186 sprop[i] = xstrdup(myproposal[i]);
1187 server_kexinit = kex_init(sprop);
1188 packet_start(SSH2_MSG_KEXINIT);
1189 packet_put_raw(buffer_ptr(server_kexinit), buffer_len(server_kexinit));
1190 packet_send();
1191 packet_write_wait();
1192
1193 debug("done");
1194
1195 packet_read_expect(&payload_len, SSH2_MSG_KEXINIT);
1196
1197 /*
1198 * save raw KEXINIT payload in buffer. this is used during
1199 * computation of the session_id and the session keys.
1200 */
1201 client_kexinit = xmalloc(sizeof(*client_kexinit)); 1181 client_kexinit = xmalloc(sizeof(*client_kexinit));
1202 buffer_init(client_kexinit); 1182 buffer_init(client_kexinit);
1203 ptr = packet_get_raw(&payload_len);
1204 buffer_append(client_kexinit, ptr, payload_len);
1205 1183
1206 /* skip cookie */ 1184 /* algorithm negotiation */
1207 for (i = 0; i < 16; i++) 1185 kex_exchange_kexinit(server_kexinit, client_kexinit, cprop);
1208 (void) packet_get_char(); 1186 kex = kex_choose_conf(cprop, myproposal, 1);
1209 /* save kex init proposal strings */ 1187 for (i = 0; i < PROPOSAL_MAX; i++)
1210 for (i = 0; i < PROPOSAL_MAX; i++) { 1188 xfree(cprop[i]);
1211 cprop[i] = packet_get_string(NULL);
1212 debug("got kexinit string: %s", cprop[i]);
1213 }
1214
1215 i = (int) packet_get_char();
1216 debug("first kex follow == %d", i);
1217 i = packet_get_int();
1218 debug("reserved == %d", i);
1219
1220 debug("done read kexinit");
1221 kex = kex_choose_conf(cprop, sprop, 1);
1222 1189
1223/* KEXDH */ 1190/* KEXDH */
1224 1191