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

Control characters are now allowed as part of the password, if

they're not special control characters processed by the line input
routines.

[originally from svn r1116]
This commit is contained in:
Simon Tatham 2001-05-13 11:44:57 +00:00
parent c0d65a351e
commit 839353ad3a

14
ssh.c
View File

@ -1783,7 +1783,8 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
break; break;
default: default:
if (((c >= ' ' && c <= '~') || if (((c >= ' ' && c <= '~') ||
((unsigned char) c >= 160)) && pos < 40) { ((unsigned char) c >= 160))
&& pos < sizeof(username)-1) {
username[pos++] = c; username[pos++] = c;
c_write(&c, 1); c_write(&c, 1);
} }
@ -2053,9 +2054,7 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt)
exit(0); exit(0);
break; break;
default: default:
if (((c >= ' ' && c <= '~') || if (pos < sizeof(password)-1)
((unsigned char) c >= 160))
&& pos < sizeof(password))
password[pos++] = c; password[pos++] = c;
break; break;
} }
@ -3197,7 +3196,8 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
break; break;
default: default:
if (((c >= ' ' && c <= '~') || if (((c >= ' ' && c <= '~') ||
((unsigned char) c >= 160)) && pos < 40) { ((unsigned char) c >= 160))
&& pos < sizeof(username)-1) {
username[pos++] = c; username[pos++] = c;
c_write(&c, 1); c_write(&c, 1);
} }
@ -3582,9 +3582,7 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt)
exit(0); exit(0);
break; break;
default: default:
if (((c >= ' ' && c <= '~') || if (pos < sizeof(password)-1)
((unsigned char) c >= 160))
&& pos < 40)
password[pos++] = c; password[pos++] = c;
break; break;
} }