summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--channels.c22
-rw-r--r--fatal.c1
-rw-r--r--kex.c6
-rw-r--r--packet.c8
-rw-r--r--serverloop.c1
6 files changed, 27 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index eea43e7c0..4dd368151 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -98,6 +98,9 @@
98 - deraadt@cvs.openbsd.org 2006/03/20 18:42:27 98 - deraadt@cvs.openbsd.org 2006/03/20 18:42:27
99 [canohost.c match.c ssh.c sshconnect.c] 99 [canohost.c match.c ssh.c sshconnect.c]
100 be strict with tolower() casting 100 be strict with tolower() casting
101 - deraadt@cvs.openbsd.org 2006/03/20 18:48:34
102 [channels.c fatal.c kex.c packet.c serverloop.c]
103 spacing
101 104
10220060325 10520060325
103 - OpenBSD CVS Sync 106 - OpenBSD CVS Sync
@@ -4355,4 +4358,4 @@
4355 - (djm) Trim deprecated options from INSTALL. Mention UsePAM 4358 - (djm) Trim deprecated options from INSTALL. Mention UsePAM
4356 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu 4359 - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
4357 4360
4358$Id: ChangeLog,v 1.4270 2006/03/26 03:09:54 djm Exp $ 4361$Id: ChangeLog,v 1.4271 2006/03/26 03:10:14 djm Exp $
diff --git a/channels.c b/channels.c
index 239da8e9b..1ff7152a8 100644
--- a/channels.c
+++ b/channels.c
@@ -192,7 +192,6 @@ channel_lookup(int id)
192 * Register filedescriptors for a channel, used when allocating a channel or 192 * Register filedescriptors for a channel, used when allocating a channel or
193 * when the channel consumer/producer is ready, e.g. shell exec'd 193 * when the channel consumer/producer is ready, e.g. shell exec'd
194 */ 194 */
195
196static void 195static void
197channel_register_fds(Channel *c, int rfd, int wfd, int efd, 196channel_register_fds(Channel *c, int rfd, int wfd, int efd,
198 int extusage, int nonblock) 197 int extusage, int nonblock)
@@ -239,7 +238,6 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
239 * Allocate a new channel object and set its type and socket. This will cause 238 * Allocate a new channel object and set its type and socket. This will cause
240 * remote_name to be freed. 239 * remote_name to be freed.
241 */ 240 */
242
243Channel * 241Channel *
244channel_new(char *ctype, int type, int rfd, int wfd, int efd, 242channel_new(char *ctype, int type, int rfd, int wfd, int efd,
245 u_int window, u_int maxpack, int extusage, char *remote_name, int nonblock) 243 u_int window, u_int maxpack, int extusage, char *remote_name, int nonblock)
@@ -341,7 +339,6 @@ channel_close_fd(int *fdp)
341} 339}
342 340
343/* Close all channel fd/socket. */ 341/* Close all channel fd/socket. */
344
345static void 342static void
346channel_close_fds(Channel *c) 343channel_close_fds(Channel *c)
347{ 344{
@@ -356,7 +353,6 @@ channel_close_fds(Channel *c)
356} 353}
357 354
358/* Free the channel and close its fd/socket. */ 355/* Free the channel and close its fd/socket. */
359
360void 356void
361channel_free(Channel *c) 357channel_free(Channel *c)
362{ 358{
@@ -403,7 +399,6 @@ channel_free_all(void)
403 * Closes the sockets/fds of all channels. This is used to close extra file 399 * Closes the sockets/fds of all channels. This is used to close extra file
404 * descriptors after a fork. 400 * descriptors after a fork.
405 */ 401 */
406
407void 402void
408channel_close_all(void) 403channel_close_all(void)
409{ 404{
@@ -417,7 +412,6 @@ channel_close_all(void)
417/* 412/*
418 * Stop listening to channels. 413 * Stop listening to channels.
419 */ 414 */
420
421void 415void
422channel_stop_listening(void) 416channel_stop_listening(void)
423{ 417{
@@ -444,7 +438,6 @@ channel_stop_listening(void)
444 * Returns true if no channel has too much buffered data, and false if one or 438 * Returns true if no channel has too much buffered data, and false if one or
445 * more channel is overfull. 439 * more channel is overfull.
446 */ 440 */
447
448int 441int
449channel_not_very_much_buffered_data(void) 442channel_not_very_much_buffered_data(void)
450{ 443{
@@ -474,7 +467,6 @@ channel_not_very_much_buffered_data(void)
474} 467}
475 468
476/* Returns true if any channel is still open. */ 469/* Returns true if any channel is still open. */
477
478int 470int
479channel_still_open(void) 471channel_still_open(void)
480{ 472{
@@ -517,7 +509,6 @@ channel_still_open(void)
517} 509}
518 510
519/* Returns the id of an open channel suitable for keepaliving */ 511/* Returns the id of an open channel suitable for keepaliving */
520
521int 512int
522channel_find_open(void) 513channel_find_open(void)
523{ 514{
@@ -562,7 +553,6 @@ channel_find_open(void)
562 * suitable for sending to the client. The message contains crlf pairs for 553 * suitable for sending to the client. The message contains crlf pairs for
563 * newlines. 554 * newlines.
564 */ 555 */
565
566char * 556char *
567channel_open_message(void) 557channel_open_message(void)
568{ 558{
@@ -647,6 +637,7 @@ channel_request_start(int id, char *service, int wantconfirm)
647 packet_put_cstring(service); 637 packet_put_cstring(service);
648 packet_put_char(wantconfirm); 638 packet_put_char(wantconfirm);
649} 639}
640
650void 641void
651channel_register_confirm(int id, channel_callback_fn *fn, void *ctx) 642channel_register_confirm(int id, channel_callback_fn *fn, void *ctx)
652{ 643{
@@ -659,6 +650,7 @@ channel_register_confirm(int id, channel_callback_fn *fn, void *ctx)
659 c->confirm = fn; 650 c->confirm = fn;
660 c->confirm_ctx = ctx; 651 c->confirm_ctx = ctx;
661} 652}
653
662void 654void
663channel_register_cleanup(int id, channel_callback_fn *fn, int do_close) 655channel_register_cleanup(int id, channel_callback_fn *fn, int do_close)
664{ 656{
@@ -671,6 +663,7 @@ channel_register_cleanup(int id, channel_callback_fn *fn, int do_close)
671 c->detach_user = fn; 663 c->detach_user = fn;
672 c->detach_close = do_close; 664 c->detach_close = do_close;
673} 665}
666
674void 667void
675channel_cancel_cleanup(int id) 668channel_cancel_cleanup(int id)
676{ 669{
@@ -683,6 +676,7 @@ channel_cancel_cleanup(int id)
683 c->detach_user = NULL; 676 c->detach_user = NULL;
684 c->detach_close = 0; 677 c->detach_close = 0;
685} 678}
679
686void 680void
687channel_register_filter(int id, channel_infilter_fn *ifn, 681channel_register_filter(int id, channel_infilter_fn *ifn,
688 channel_outfilter_fn *ofn) 682 channel_outfilter_fn *ofn)
@@ -1455,6 +1449,7 @@ channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset)
1455 } 1449 }
1456 return 1; 1450 return 1;
1457} 1451}
1452
1458static int 1453static int
1459channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset) 1454channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset)
1460{ 1455{
@@ -1542,6 +1537,7 @@ channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset)
1542 } 1537 }
1543 return 1; 1538 return 1;
1544} 1539}
1540
1545static int 1541static int
1546channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset) 1542channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset)
1547{ 1543{
@@ -1585,6 +1581,7 @@ channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset)
1585 } 1581 }
1586 return 1; 1582 return 1;
1587} 1583}
1584
1588static int 1585static int
1589channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset) 1586channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset)
1590{ 1587{
@@ -1612,6 +1609,7 @@ channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset)
1612 } 1609 }
1613 return 1; 1610 return 1;
1614} 1611}
1612
1615static int 1613static int
1616channel_check_window(Channel *c) 1614channel_check_window(Channel *c)
1617{ 1615{
@@ -1823,7 +1821,6 @@ channel_after_select(fd_set *readset, fd_set *writeset)
1823 1821
1824 1822
1825/* If there is data to send to the connection, enqueue some of it now. */ 1823/* If there is data to send to the connection, enqueue some of it now. */
1826
1827void 1824void
1828channel_output_poll(void) 1825channel_output_poll(void)
1829{ 1826{
@@ -1943,7 +1940,6 @@ channel_output_poll(void)
1943 1940
1944 1941
1945/* -- protocol input */ 1942/* -- protocol input */
1946
1947void 1943void
1948channel_input_data(int type, u_int32_t seq, void *ctxt) 1944channel_input_data(int type, u_int32_t seq, void *ctxt)
1949{ 1945{
@@ -2557,7 +2553,6 @@ channel_request_rforward_cancel(const char *host, u_short port)
2557 * listening for the port, and sends back a success reply (or disconnect 2553 * listening for the port, and sends back a success reply (or disconnect
2558 * message if there was an error). This never returns if there was an error. 2554 * message if there was an error). This never returns if there was an error.
2559 */ 2555 */
2560
2561void 2556void
2562channel_input_port_forward_request(int is_root, int gateway_ports) 2557channel_input_port_forward_request(int is_root, int gateway_ports)
2563{ 2558{
@@ -2628,7 +2623,6 @@ channel_clear_permitted_opens(void)
2628 2623
2629} 2624}
2630 2625
2631
2632/* return socket to remote host, port */ 2626/* return socket to remote host, port */
2633static int 2627static int
2634connect_to(const char *host, u_short port) 2628connect_to(const char *host, u_short port)
diff --git a/fatal.c b/fatal.c
index 8eea85a03..78b51cd8b 100644
--- a/fatal.c
+++ b/fatal.c
@@ -32,6 +32,7 @@ void
32fatal(const char *fmt,...) 32fatal(const char *fmt,...)
33{ 33{
34 va_list args; 34 va_list args;
35
35 va_start(args, fmt); 36 va_start(args, fmt);
36 do_log(SYSLOG_LEVEL_FATAL, fmt, args); 37 do_log(SYSLOG_LEVEL_FATAL, fmt, args);
37 va_end(args); 38 va_end(args);
diff --git a/kex.c b/kex.c
index 930e9cb4d..91081b18e 100644
--- a/kex.c
+++ b/kex.c
@@ -261,6 +261,7 @@ choose_enc(Enc *enc, char *client, char *server)
261 enc->key_len = cipher_keylen(enc->cipher); 261 enc->key_len = cipher_keylen(enc->cipher);
262 enc->block_size = cipher_blocksize(enc->cipher); 262 enc->block_size = cipher_blocksize(enc->cipher);
263} 263}
264
264static void 265static void
265choose_mac(Mac *mac, char *client, char *server) 266choose_mac(Mac *mac, char *client, char *server)
266{ 267{
@@ -276,6 +277,7 @@ choose_mac(Mac *mac, char *client, char *server)
276 mac->key = NULL; 277 mac->key = NULL;
277 mac->enabled = 0; 278 mac->enabled = 0;
278} 279}
280
279static void 281static void
280choose_comp(Comp *comp, char *client, char *server) 282choose_comp(Comp *comp, char *client, char *server)
281{ 283{
@@ -293,6 +295,7 @@ choose_comp(Comp *comp, char *client, char *server)
293 } 295 }
294 comp->name = name; 296 comp->name = name;
295} 297}
298
296static void 299static void
297choose_kex(Kex *k, char *client, char *server) 300choose_kex(Kex *k, char *client, char *server)
298{ 301{
@@ -485,7 +488,8 @@ kex_derive_keys(Kex *kex, u_char *hash, u_int hashlen, BIGNUM *shared_secret)
485 for (mode = 0; mode < MODE_MAX; mode++) { 488 for (mode = 0; mode < MODE_MAX; mode++) {
486 current_keys[mode] = kex->newkeys[mode]; 489 current_keys[mode] = kex->newkeys[mode];
487 kex->newkeys[mode] = NULL; 490 kex->newkeys[mode] = NULL;
488 ctos = (!kex->server && mode == MODE_OUT) || (kex->server && mode == MODE_IN); 491 ctos = (!kex->server && mode == MODE_OUT) ||
492 (kex->server && mode == MODE_IN);
489 current_keys[mode]->enc.iv = keys[ctos ? 0 : 1]; 493 current_keys[mode]->enc.iv = keys[ctos ? 0 : 1];
490 current_keys[mode]->enc.key = keys[ctos ? 2 : 3]; 494 current_keys[mode]->enc.key = keys[ctos ? 2 : 3];
491 current_keys[mode]->mac.key = keys[ctos ? 4 : 5]; 495 current_keys[mode]->mac.key = keys[ctos ? 4 : 5];
diff --git a/packet.c b/packet.c
index 65fb31d2e..ee9369638 100644
--- a/packet.c
+++ b/packet.c
@@ -259,6 +259,7 @@ packet_get_keyiv_len(int mode)
259 259
260 return (cipher_get_keyiv_len(cc)); 260 return (cipher_get_keyiv_len(cc));
261} 261}
262
262void 263void
263packet_set_iv(int mode, u_char *dat) 264packet_set_iv(int mode, u_char *dat)
264{ 265{
@@ -271,6 +272,7 @@ packet_set_iv(int mode, u_char *dat)
271 272
272 cipher_set_keyiv(cc, dat); 273 cipher_set_keyiv(cc, dat);
273} 274}
275
274int 276int
275packet_get_ssh1_cipher(void) 277packet_get_ssh1_cipher(void)
276{ 278{
@@ -472,31 +474,37 @@ packet_put_char(int value)
472 474
473 buffer_append(&outgoing_packet, &ch, 1); 475 buffer_append(&outgoing_packet, &ch, 1);
474} 476}
477
475void 478void
476packet_put_int(u_int value) 479packet_put_int(u_int value)
477{ 480{
478 buffer_put_int(&outgoing_packet, value); 481 buffer_put_int(&outgoing_packet, value);
479} 482}
483
480void 484void
481packet_put_string(const void *buf, u_int len) 485packet_put_string(const void *buf, u_int len)
482{ 486{
483 buffer_put_string(&outgoing_packet, buf, len); 487 buffer_put_string(&outgoing_packet, buf, len);
484} 488}
489
485void 490void
486packet_put_cstring(const char *str) 491packet_put_cstring(const char *str)
487{ 492{
488 buffer_put_cstring(&outgoing_packet, str); 493 buffer_put_cstring(&outgoing_packet, str);
489} 494}
495
490void 496void
491packet_put_raw(const void *buf, u_int len) 497packet_put_raw(const void *buf, u_int len)
492{ 498{
493 buffer_append(&outgoing_packet, buf, len); 499 buffer_append(&outgoing_packet, buf, len);
494} 500}
501
495void 502void
496packet_put_bignum(BIGNUM * value) 503packet_put_bignum(BIGNUM * value)
497{ 504{
498 buffer_put_bignum(&outgoing_packet, value); 505 buffer_put_bignum(&outgoing_packet, value);
499} 506}
507
500void 508void
501packet_put_bignum2(BIGNUM * value) 509packet_put_bignum2(BIGNUM * value)
502{ 510{
diff --git a/serverloop.c b/serverloop.c
index 3bc0c5a76..36c40ec59 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1102,6 +1102,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
1102 } 1102 }
1103 xfree(rtype); 1103 xfree(rtype);
1104} 1104}
1105
1105static void 1106static void
1106server_input_channel_req(int type, u_int32_t seq, void *ctxt) 1107server_input_channel_req(int type, u_int32_t seq, void *ctxt)
1107{ 1108{