diff options
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 47 |
1 files changed, 7 insertions, 40 deletions
@@ -14,7 +14,7 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$OpenBSD: sshd.c,v 1.117 2000/05/18 13:27:36 djm Exp $"); | 17 | RCSID("$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 | ||