diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | channels.c | 13 | ||||
-rw-r--r-- | packet.c | 13 |
3 files changed, 27 insertions, 4 deletions
@@ -9,6 +9,9 @@ | |||
9 | - deraadt@cvs.openbsd.org 2002/07/04 04:15:33 | 9 | - deraadt@cvs.openbsd.org 2002/07/04 04:15:33 |
10 | [key.c monitor_wrap.c sftp-glob.c ssh-dss.c ssh-rsa.c] | 10 | [key.c monitor_wrap.c sftp-glob.c ssh-dss.c ssh-rsa.c] |
11 | patch memory leaks; grendel@zeitbombe.org | 11 | patch memory leaks; grendel@zeitbombe.org |
12 | - deraadt@cvs.openbsd.org 2002/07/04 08:12:15 | ||
13 | [channels.c packet.c] | ||
14 | blah blah minor nothing as i read and re-read and re-read... | ||
12 | 15 | ||
13 | 20020705 | 16 | 20020705 |
14 | - (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs. | 17 | - (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs. |
@@ -1292,4 +1295,4 @@ | |||
1292 | - (stevesk) entropy.c: typo in debug message | 1295 | - (stevesk) entropy.c: typo in debug message |
1293 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 1296 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
1294 | 1297 | ||
1295 | $Id: ChangeLog,v 1.2342 2002/07/07 22:10:15 mouring Exp $ | 1298 | $Id: ChangeLog,v 1.2343 2002/07/07 22:11:51 mouring Exp $ |
diff --git a/channels.c b/channels.c index 3ab8ed8a7..cf6742ae3 100644 --- a/channels.c +++ b/channels.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: channels.c,v 1.179 2002/06/26 08:55:02 markus Exp $"); | 42 | RCSID("$OpenBSD: channels.c,v 1.180 2002/07/04 08:12:15 deraadt Exp $"); |
43 | 43 | ||
44 | #include "ssh.h" | 44 | #include "ssh.h" |
45 | #include "ssh1.h" | 45 | #include "ssh1.h" |
@@ -572,6 +572,7 @@ void | |||
572 | channel_send_open(int id) | 572 | channel_send_open(int id) |
573 | { | 573 | { |
574 | Channel *c = channel_lookup(id); | 574 | Channel *c = channel_lookup(id); |
575 | |||
575 | if (c == NULL) { | 576 | if (c == NULL) { |
576 | log("channel_send_open: %d: bad id", id); | 577 | log("channel_send_open: %d: bad id", id); |
577 | return; | 578 | return; |
@@ -589,6 +590,7 @@ void | |||
589 | channel_request_start(int local_id, char *service, int wantconfirm) | 590 | channel_request_start(int local_id, char *service, int wantconfirm) |
590 | { | 591 | { |
591 | Channel *c = channel_lookup(local_id); | 592 | Channel *c = channel_lookup(local_id); |
593 | |||
592 | if (c == NULL) { | 594 | if (c == NULL) { |
593 | log("channel_request_start: %d: unknown channel id", local_id); | 595 | log("channel_request_start: %d: unknown channel id", local_id); |
594 | return; | 596 | return; |
@@ -603,6 +605,7 @@ void | |||
603 | channel_register_confirm(int id, channel_callback_fn *fn) | 605 | channel_register_confirm(int id, channel_callback_fn *fn) |
604 | { | 606 | { |
605 | Channel *c = channel_lookup(id); | 607 | Channel *c = channel_lookup(id); |
608 | |||
606 | if (c == NULL) { | 609 | if (c == NULL) { |
607 | log("channel_register_comfirm: %d: bad id", id); | 610 | log("channel_register_comfirm: %d: bad id", id); |
608 | return; | 611 | return; |
@@ -613,6 +616,7 @@ void | |||
613 | channel_register_cleanup(int id, channel_callback_fn *fn) | 616 | channel_register_cleanup(int id, channel_callback_fn *fn) |
614 | { | 617 | { |
615 | Channel *c = channel_lookup(id); | 618 | Channel *c = channel_lookup(id); |
619 | |||
616 | if (c == NULL) { | 620 | if (c == NULL) { |
617 | log("channel_register_cleanup: %d: bad id", id); | 621 | log("channel_register_cleanup: %d: bad id", id); |
618 | return; | 622 | return; |
@@ -623,6 +627,7 @@ void | |||
623 | channel_cancel_cleanup(int id) | 627 | channel_cancel_cleanup(int id) |
624 | { | 628 | { |
625 | Channel *c = channel_lookup(id); | 629 | Channel *c = channel_lookup(id); |
630 | |||
626 | if (c == NULL) { | 631 | if (c == NULL) { |
627 | log("channel_cancel_cleanup: %d: bad id", id); | 632 | log("channel_cancel_cleanup: %d: bad id", id); |
628 | return; | 633 | return; |
@@ -633,6 +638,7 @@ void | |||
633 | channel_register_filter(int id, channel_filter_fn *fn) | 638 | channel_register_filter(int id, channel_filter_fn *fn) |
634 | { | 639 | { |
635 | Channel *c = channel_lookup(id); | 640 | Channel *c = channel_lookup(id); |
641 | |||
636 | if (c == NULL) { | 642 | if (c == NULL) { |
637 | log("channel_register_filter: %d: bad id", id); | 643 | log("channel_register_filter: %d: bad id", id); |
638 | return; | 644 | return; |
@@ -645,6 +651,7 @@ channel_set_fds(int id, int rfd, int wfd, int efd, | |||
645 | int extusage, int nonblock, u_int window_max) | 651 | int extusage, int nonblock, u_int window_max) |
646 | { | 652 | { |
647 | Channel *c = channel_lookup(id); | 653 | Channel *c = channel_lookup(id); |
654 | |||
648 | if (c == NULL || c->type != SSH_CHANNEL_LARVAL) | 655 | if (c == NULL || c->type != SSH_CHANNEL_LARVAL) |
649 | fatal("channel_activate for non-larval channel %d.", id); | 656 | fatal("channel_activate for non-larval channel %d.", id); |
650 | channel_register_fds(c, rfd, wfd, efd, extusage, nonblock); | 657 | channel_register_fds(c, rfd, wfd, efd, extusage, nonblock); |
@@ -815,6 +822,7 @@ static void | |||
815 | channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset) | 822 | channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset) |
816 | { | 823 | { |
817 | int ret = x11_open_helper(&c->output); | 824 | int ret = x11_open_helper(&c->output); |
825 | |||
818 | if (ret == 1) { | 826 | if (ret == 1) { |
819 | /* Start normal processing for the channel. */ | 827 | /* Start normal processing for the channel. */ |
820 | c->type = SSH_CHANNEL_OPEN; | 828 | c->type = SSH_CHANNEL_OPEN; |
@@ -1400,6 +1408,7 @@ static void | |||
1400 | channel_post_output_drain_13(Channel *c, fd_set * readset, fd_set * writeset) | 1408 | channel_post_output_drain_13(Channel *c, fd_set * readset, fd_set * writeset) |
1401 | { | 1409 | { |
1402 | int len; | 1410 | int len; |
1411 | |||
1403 | /* Send buffered output data to the socket. */ | 1412 | /* Send buffered output data to the socket. */ |
1404 | if (FD_ISSET(c->sock, writeset) && buffer_len(&c->output) > 0) { | 1413 | if (FD_ISSET(c->sock, writeset) && buffer_len(&c->output) > 0) { |
1405 | len = write(c->sock, buffer_ptr(&c->output), | 1414 | len = write(c->sock, buffer_ptr(&c->output), |
@@ -1477,6 +1486,7 @@ static void | |||
1477 | channel_handler_init(void) | 1486 | channel_handler_init(void) |
1478 | { | 1487 | { |
1479 | int i; | 1488 | int i; |
1489 | |||
1480 | for (i = 0; i < SSH_CHANNEL_MAX_TYPE; i++) { | 1490 | for (i = 0; i < SSH_CHANNEL_MAX_TYPE; i++) { |
1481 | channel_pre[i] = NULL; | 1491 | channel_pre[i] = NULL; |
1482 | channel_post[i] = NULL; | 1492 | channel_post[i] = NULL; |
@@ -2610,6 +2620,7 @@ void | |||
2610 | deny_input_open(int type, u_int32_t seq, void *ctxt) | 2620 | deny_input_open(int type, u_int32_t seq, void *ctxt) |
2611 | { | 2621 | { |
2612 | int rchan = packet_get_int(); | 2622 | int rchan = packet_get_int(); |
2623 | |||
2613 | switch (type) { | 2624 | switch (type) { |
2614 | case SSH_SMSG_AGENT_OPEN: | 2625 | case SSH_SMSG_AGENT_OPEN: |
2615 | error("Warning: ssh server tried agent forwarding."); | 2626 | error("Warning: ssh server tried agent forwarding."); |
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include "includes.h" | 39 | #include "includes.h" |
40 | RCSID("$OpenBSD: packet.c,v 1.96 2002/06/23 21:10:02 deraadt Exp $"); | 40 | RCSID("$OpenBSD: packet.c,v 1.97 2002/07/04 08:12:15 deraadt Exp $"); |
41 | 41 | ||
42 | #include "xmalloc.h" | 42 | #include "xmalloc.h" |
43 | #include "buffer.h" | 43 | #include "buffer.h" |
@@ -134,6 +134,7 @@ void | |||
134 | packet_set_connection(int fd_in, int fd_out) | 134 | packet_set_connection(int fd_in, int fd_out) |
135 | { | 135 | { |
136 | Cipher *none = cipher_by_name("none"); | 136 | Cipher *none = cipher_by_name("none"); |
137 | |||
137 | if (none == NULL) | 138 | if (none == NULL) |
138 | fatal("packet_set_connection: cannot load cipher 'none'"); | 139 | fatal("packet_set_connection: cannot load cipher 'none'"); |
139 | connection_in = fd_in; | 140 | connection_in = fd_in; |
@@ -402,6 +403,7 @@ packet_set_encryption_key(const u_char *key, u_int keylen, | |||
402 | int number) | 403 | int number) |
403 | { | 404 | { |
404 | Cipher *cipher = cipher_by_number(number); | 405 | Cipher *cipher = cipher_by_number(number); |
406 | |||
405 | if (cipher == NULL) | 407 | if (cipher == NULL) |
406 | fatal("packet_set_encryption_key: unknown cipher number %d", number); | 408 | fatal("packet_set_encryption_key: unknown cipher number %d", number); |
407 | if (keylen < 20) | 409 | if (keylen < 20) |
@@ -443,6 +445,7 @@ void | |||
443 | packet_put_char(int value) | 445 | packet_put_char(int value) |
444 | { | 446 | { |
445 | char ch = value; | 447 | char ch = value; |
448 | |||
446 | buffer_append(&outgoing_packet, &ch, 1); | 449 | buffer_append(&outgoing_packet, &ch, 1); |
447 | } | 450 | } |
448 | void | 451 | void |
@@ -994,7 +997,8 @@ packet_read_poll2(u_int32_t *seqnr_p) | |||
994 | buffer_clear(&incoming_packet); | 997 | buffer_clear(&incoming_packet); |
995 | buffer_append(&incoming_packet, buffer_ptr(&compression_buffer), | 998 | buffer_append(&incoming_packet, buffer_ptr(&compression_buffer), |
996 | buffer_len(&compression_buffer)); | 999 | buffer_len(&compression_buffer)); |
997 | DBG(debug("input: len after de-compress %d", buffer_len(&incoming_packet))); | 1000 | DBG(debug("input: len after de-compress %d", |
1001 | buffer_len(&incoming_packet))); | ||
998 | } | 1002 | } |
999 | /* | 1003 | /* |
1000 | * get packet type, implies consume. | 1004 | * get packet type, implies consume. |
@@ -1102,6 +1106,7 @@ u_int | |||
1102 | packet_get_char(void) | 1106 | packet_get_char(void) |
1103 | { | 1107 | { |
1104 | char ch; | 1108 | char ch; |
1109 | |||
1105 | buffer_get(&incoming_packet, &ch, 1); | 1110 | buffer_get(&incoming_packet, &ch, 1); |
1106 | return (u_char) ch; | 1111 | return (u_char) ch; |
1107 | } | 1112 | } |
@@ -1135,6 +1140,7 @@ void * | |||
1135 | packet_get_raw(int *length_ptr) | 1140 | packet_get_raw(int *length_ptr) |
1136 | { | 1141 | { |
1137 | int bytes = buffer_len(&incoming_packet); | 1142 | int bytes = buffer_len(&incoming_packet); |
1143 | |||
1138 | if (length_ptr != NULL) | 1144 | if (length_ptr != NULL) |
1139 | *length_ptr = bytes; | 1145 | *length_ptr = bytes; |
1140 | return buffer_ptr(&incoming_packet); | 1146 | return buffer_ptr(&incoming_packet); |
@@ -1207,6 +1213,7 @@ packet_disconnect(const char *fmt,...) | |||
1207 | char buf[1024]; | 1213 | char buf[1024]; |
1208 | va_list args; | 1214 | va_list args; |
1209 | static int disconnecting = 0; | 1215 | static int disconnecting = 0; |
1216 | |||
1210 | if (disconnecting) /* Guard against recursive invocations. */ | 1217 | if (disconnecting) /* Guard against recursive invocations. */ |
1211 | fatal("packet_disconnect called recursively."); | 1218 | fatal("packet_disconnect called recursively."); |
1212 | disconnecting = 1; | 1219 | disconnecting = 1; |
@@ -1249,6 +1256,7 @@ void | |||
1249 | packet_write_poll(void) | 1256 | packet_write_poll(void) |
1250 | { | 1257 | { |
1251 | int len = buffer_len(&output); | 1258 | int len = buffer_len(&output); |
1259 | |||
1252 | if (len > 0) { | 1260 | if (len > 0) { |
1253 | len = write(connection_out, buffer_ptr(&output), len); | 1261 | len = write(connection_out, buffer_ptr(&output), len); |
1254 | if (len <= 0) { | 1262 | if (len <= 0) { |
@@ -1368,6 +1376,7 @@ int | |||
1368 | packet_set_maxsize(int s) | 1376 | packet_set_maxsize(int s) |
1369 | { | 1377 | { |
1370 | static int called = 0; | 1378 | static int called = 0; |
1379 | |||
1371 | if (called) { | 1380 | if (called) { |
1372 | log("packet_set_maxsize: called twice: old %d new %d", | 1381 | log("packet_set_maxsize: called twice: old %d new %d", |
1373 | max_packet_size, s); | 1382 | max_packet_size, s); |