]> andersk Git - openssh.git/blobdiff - channels.c
- djm@cvs.openbsd.org 2001/03/13 22:42:54
[openssh.git] / channels.c
index f10427c17827de3c86f2f151a75c7f337ce442c0..bb872dc94723ee48b23b3b27203693cf10d3a0b4 100644 (file)
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.93 2001/02/28 08:54:55 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.98 2001/03/04 17:42:28 millert Exp $");
 
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
@@ -195,10 +195,10 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
 
        /* XXX ugly hack: nonblock is only set by the server */
        if (nonblock && isatty(c->rfd)) {
-               debug("channel: %d: rfd %d isatty", c->self, c->rfd);
+               debug("channel %d: rfd %d isatty", c->self, c->rfd);
                c->isatty = 1;
                if (!isatty(c->wfd)) {
-                       error("channel: %d: wfd %d is not a tty?",
+                       error("channel %d: wfd %d is not a tty?",
                            c->self, c->wfd);
                }
        } else {
@@ -521,7 +521,7 @@ channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset)
                 * We have received an X11 connection that has bad
                 * authentication information.
                 */
-               log("X11 connection rejected because of wrong authentication.\r\n");
+               log("X11 connection rejected because of wrong authentication.");
                buffer_clear(&c->input);
                buffer_clear(&c->output);
                close(c->sock);
@@ -768,6 +768,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
 int
 channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
 {
+       struct termios tio;
        int len;
 
        /* Send buffered output data to the socket. */
@@ -789,16 +790,15 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
                        return -1;
                }
                if (compat20 && c->isatty) {
-                       struct termios tio;
                        if (tcgetattr(c->wfd, &tio) == 0 &&
                            !(tio.c_lflag & ECHO) && (tio.c_lflag & ICANON)) {
                                /*
                                 * Simulate echo to reduce the impact of
-                                * traffic analysis.
+                                * traffic analysis. We need to match the
+                                * size of a SSH2_MSG_CHANNEL_DATA message
+                                * (4 byte channel id + data)
                                 */
-                               packet_start(SSH2_MSG_IGNORE);
-                               memset(buffer_ptr(&c->output), 0, len);
-                               packet_put_string(buffer_ptr(&c->output), len);
+                               packet_send_ignore(4 + len);
                                packet_send();
                        }
                }
@@ -1069,7 +1069,7 @@ channel_output_poll()
                if (compat20 &&
                    (c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD))) {
                        /* XXX is this true? */
-                       debug("channel: %d: no data after CLOSE", c->self);
+                       debug2("channel %d: no data after CLOSE", c->self);
                        continue;
                }
 
@@ -1424,7 +1424,7 @@ channel_input_channel_request(int type, int plen, void *ctxt)
                debug2("callback done");
        } else {
                char *service = packet_get_string(NULL);
-               debug("channel: %d rcvd request for %s", c->self, service);
+               debug("channel %d: rcvd request for %s", c->self, service);
                debug("cb_fn %p cb_event %d", c->cb_fn , c->cb_event);
                xfree(service);
        }
This page took 0.039673 seconds and 4 git commands to generate.