projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce a sane interface function, from_backend(), for backends to
[u/mdw/putty]
/
ssh.c
diff --git
a/ssh.c
b/ssh.c
index
0095835
..
c065f2f
100644
(file)
--- a/
ssh.c
+++ b/
ssh.c
@@
-322,13
+322,7
@@
static void c_write (char *buf, int len) {
fputc(buf[i], stderr);
return;
}
fputc(buf[i], stderr);
return;
}
- while (len--)
- c_write1(*buf++);
-}
-
-static void c_writedata (char *buf, int len) {
- while (len--)
- c_write1(*buf++);
+ from_backend(1, buf, len);
}
/*
}
/*
@@
-1531,7
+1525,7
@@
static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
static unsigned char buffer[32];
tried_publickey = 1;
static unsigned char buffer[32];
tried_publickey = 1;
- i = loadrsakey(cfg.keyfile, &pubkey, password);
+ i = loadrsakey(cfg.keyfile, &pubkey,
NULL,
password);
if (i == 0) {
c_write("Couldn't load public key from ", 30);
c_write(cfg.keyfile, strlen(cfg.keyfile));
if (i == 0) {
c_write("Couldn't load public key from ", 30);
c_write(cfg.keyfile, strlen(cfg.keyfile));
@@
-1674,7
+1668,8
@@
static void ssh1_protocol(unsigned char *in, int inlen, int ispkt) {
if (pktin.type == SSH1_SMSG_STDOUT_DATA ||
pktin.type == SSH1_SMSG_STDERR_DATA) {
long len = GET_32BIT(pktin.body);
if (pktin.type == SSH1_SMSG_STDOUT_DATA ||
pktin.type == SSH1_SMSG_STDERR_DATA) {
long len = GET_32BIT(pktin.body);
- c_writedata(pktin.body+4, len);
+ from_backend(pktin.type == SSH1_SMSG_STDERR_DATA,
+ pktin.body+4, len);
} else if (pktin.type == SSH1_MSG_DISCONNECT) {
ssh_state = SSH_STATE_CLOSED;
logevent("Received disconnect request");
} else if (pktin.type == SSH1_MSG_DISCONNECT) {
ssh_state = SSH_STATE_CLOSED;
logevent("Received disconnect request");
@@
-2414,7
+2409,8
@@
static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
continue; /* extended but not stderr */
ssh2_pkt_getstring(&data, &length);
if (data) {
continue; /* extended but not stderr */
ssh2_pkt_getstring(&data, &length);
if (data) {
- c_writedata(data, length);
+ from_backend(pktin.type == SSH2_MSG_CHANNEL_EXTENDED_DATA,
+ data, length);
/*
* Enlarge the window again at the remote side,
* just in case it ever runs down and they fail
/*
* Enlarge the window again at the remote side,
* just in case it ever runs down and they fail