1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Add support for SSH2 userauth banners. We currently can't deal with

printing them _before_ the username prompt. This apparently isn't very
serious because OpenSSH doesn't _send_ it before the username prompt,
but only in response to USERAUTH_REQUEST "none". Good job we do that!

[originally from svn r1005]
This commit is contained in:
Simon Tatham 2001-03-15 17:14:31 +00:00
parent dfb9893509
commit 947d33408f

16
ssh.c
View File

@ -347,6 +347,16 @@ static void c_write (char *buf, int len) {
from_backend(1, buf, len);
}
static void c_write_untrusted(char *buf, int len) {
int i;
for (i = 0; i < len; i++) {
if (buf[i] == '\n')
c_write("\r\n", 2);
else if ((buf[i] & 0x60) || (buf[i] == '\r'))
c_write(buf+i, 1);
}
}
static void c_write_str (char *buf) {
c_write(buf, strlen(buf));
}
@ -2946,7 +2956,11 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
if (!gotit)
crWaitUntilV(ispkt);
while (pktin.type == SSH2_MSG_USERAUTH_BANNER) {
/* FIXME: should support this */
char *banner;
int size;
ssh2_pkt_getstring(&banner, &size);
if (banner)
c_write_untrusted(banner, size);
crWaitUntilV(ispkt);
}
if (pktin.type == SSH2_MSG_USERAUTH_SUCCESS) {