diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | kex.c | 19 |
2 files changed, 16 insertions, 8 deletions
@@ -4,6 +4,9 @@ | |||
4 | [sshd.c] | 4 | [sshd.c] |
5 | zap double include; from p_nowaczyk AT o2.pl | 5 | zap double include; from p_nowaczyk AT o2.pl |
6 | (not required in -portable, Id sync only) | 6 | (not required in -portable, Id sync only) |
7 | - djm@cvs.openbsd.org 2007/05/30 05:58:13 | ||
8 | [kex.c] | ||
9 | tidy: KNF, ARGSUSED and u_int | ||
7 | 10 | ||
8 | 20070520 | 11 | 20070520 |
9 | - (dtucker) OpenBSD CVS Sync | 12 | - (dtucker) OpenBSD CVS Sync |
@@ -2947,4 +2950,4 @@ | |||
2947 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 2950 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
2948 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 2951 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
2949 | 2952 | ||
2950 | $Id: ChangeLog,v 1.4671 2007/06/05 08:22:32 dtucker Exp $ | 2953 | $Id: ChangeLog,v 1.4672 2007/06/05 08:23:28 dtucker Exp $ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: kex.c,v 1.77 2007/01/21 01:41:54 stevesk Exp $ */ | 1 | /* $OpenBSD: kex.c,v 1.78 2007/05/30 05:58:13 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -87,7 +87,7 @@ static char ** | |||
87 | kex_buf2prop(Buffer *raw, int *first_kex_follows) | 87 | kex_buf2prop(Buffer *raw, int *first_kex_follows) |
88 | { | 88 | { |
89 | Buffer b; | 89 | Buffer b; |
90 | int i; | 90 | u_int i; |
91 | char **proposal; | 91 | char **proposal; |
92 | 92 | ||
93 | proposal = xcalloc(PROPOSAL_MAX, sizeof(char *)); | 93 | proposal = xcalloc(PROPOSAL_MAX, sizeof(char *)); |
@@ -108,7 +108,7 @@ kex_buf2prop(Buffer *raw, int *first_kex_follows) | |||
108 | *first_kex_follows = i; | 108 | *first_kex_follows = i; |
109 | debug2("kex_parse_kexinit: first_kex_follows %d ", i); | 109 | debug2("kex_parse_kexinit: first_kex_follows %d ", i); |
110 | i = buffer_get_int(&b); | 110 | i = buffer_get_int(&b); |
111 | debug2("kex_parse_kexinit: reserved %d ", i); | 111 | debug2("kex_parse_kexinit: reserved %u ", i); |
112 | buffer_free(&b); | 112 | buffer_free(&b); |
113 | return proposal; | 113 | return proposal; |
114 | } | 114 | } |
@@ -123,6 +123,7 @@ kex_prop_free(char **proposal) | |||
123 | xfree(proposal); | 123 | xfree(proposal); |
124 | } | 124 | } |
125 | 125 | ||
126 | /* ARGSUSED */ | ||
126 | static void | 127 | static void |
127 | kex_protocol_error(int type, u_int32_t seq, void *ctxt) | 128 | kex_protocol_error(int type, u_int32_t seq, void *ctxt) |
128 | { | 129 | { |
@@ -194,6 +195,7 @@ kex_send_kexinit(Kex *kex) | |||
194 | kex->flags |= KEX_INIT_SENT; | 195 | kex->flags |= KEX_INIT_SENT; |
195 | } | 196 | } |
196 | 197 | ||
198 | /* ARGSUSED */ | ||
197 | void | 199 | void |
198 | kex_input_kexinit(int type, u_int32_t seq, void *ctxt) | 200 | kex_input_kexinit(int type, u_int32_t seq, void *ctxt) |
199 | { | 201 | { |
@@ -258,7 +260,8 @@ choose_enc(Enc *enc, char *client, char *server) | |||
258 | { | 260 | { |
259 | char *name = match_list(client, server, NULL); | 261 | char *name = match_list(client, server, NULL); |
260 | if (name == NULL) | 262 | if (name == NULL) |
261 | fatal("no matching cipher found: client %s server %s", client, server); | 263 | fatal("no matching cipher found: client %s server %s", |
264 | client, server); | ||
262 | if ((enc->cipher = cipher_by_name(name)) == NULL) | 265 | if ((enc->cipher = cipher_by_name(name)) == NULL) |
263 | fatal("matching cipher is not supported: %s", name); | 266 | fatal("matching cipher is not supported: %s", name); |
264 | enc->name = name; | 267 | enc->name = name; |
@@ -274,7 +277,8 @@ choose_mac(Mac *mac, char *client, char *server) | |||
274 | { | 277 | { |
275 | char *name = match_list(client, server, NULL); | 278 | char *name = match_list(client, server, NULL); |
276 | if (name == NULL) | 279 | if (name == NULL) |
277 | fatal("no matching mac found: client %s server %s", client, server); | 280 | fatal("no matching mac found: client %s server %s", |
281 | client, server); | ||
278 | if (mac_init(mac, name) < 0) | 282 | if (mac_init(mac, name) < 0) |
279 | fatal("unsupported mac %s", name); | 283 | fatal("unsupported mac %s", name); |
280 | /* truncate the key */ | 284 | /* truncate the key */ |
@@ -308,7 +312,7 @@ choose_kex(Kex *k, char *client, char *server) | |||
308 | { | 312 | { |
309 | k->name = match_list(client, server, NULL); | 313 | k->name = match_list(client, server, NULL); |
310 | if (k->name == NULL) | 314 | if (k->name == NULL) |
311 | fatal("no kex alg"); | 315 | fatal("Unable to negotiate a key exchange method"); |
312 | if (strcmp(k->name, KEX_DH1) == 0) { | 316 | if (strcmp(k->name, KEX_DH1) == 0) { |
313 | k->kex_type = KEX_DH_GRP1_SHA1; | 317 | k->kex_type = KEX_DH_GRP1_SHA1; |
314 | k->evp_md = EVP_sha1(); | 318 | k->evp_md = EVP_sha1(); |
@@ -388,7 +392,8 @@ kex_choose_conf(Kex *kex) | |||
388 | for (mode = 0; mode < MODE_MAX; mode++) { | 392 | for (mode = 0; mode < MODE_MAX; mode++) { |
389 | newkeys = xcalloc(1, sizeof(*newkeys)); | 393 | newkeys = xcalloc(1, sizeof(*newkeys)); |
390 | kex->newkeys[mode] = newkeys; | 394 | kex->newkeys[mode] = newkeys; |
391 | ctos = (!kex->server && mode == MODE_OUT) || (kex->server && mode == MODE_IN); | 395 | ctos = (!kex->server && mode == MODE_OUT) || |
396 | (kex->server && mode == MODE_IN); | ||
392 | nenc = ctos ? PROPOSAL_ENC_ALGS_CTOS : PROPOSAL_ENC_ALGS_STOC; | 397 | nenc = ctos ? PROPOSAL_ENC_ALGS_CTOS : PROPOSAL_ENC_ALGS_STOC; |
393 | nmac = ctos ? PROPOSAL_MAC_ALGS_CTOS : PROPOSAL_MAC_ALGS_STOC; | 398 | nmac = ctos ? PROPOSAL_MAC_ALGS_CTOS : PROPOSAL_MAC_ALGS_STOC; |
394 | ncomp = ctos ? PROPOSAL_COMP_ALGS_CTOS : PROPOSAL_COMP_ALGS_STOC; | 399 | ncomp = ctos ? PROPOSAL_COMP_ALGS_CTOS : PROPOSAL_COMP_ALGS_STOC; |