*/
#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>
/* 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 {
* 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);
int
channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
{
+ struct termios tio;
int len;
/* Send buffered output data to the socket. */
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();
}
}
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;
}
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);
}