1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-05 21:42:47 -05:00

Add a new bug-compatibility mode that limits the window size we'll

advertise so that the server can't exceed our maximum packet size.
Enable it for "1.36_sshlib GlobalSCAPE" which apparently sends oversize
packets otherwise.

[originally from svn r7804]
This commit is contained in:
Ben Harris
2007-12-05 00:02:06 +00:00
parent 020c481dd4
commit 1940b37ff0
5 changed files with 42 additions and 1 deletions

20
ssh.c
View File

@ -183,6 +183,7 @@ static const char *const ssh2_disconnect_reasons[] = {
#define BUG_SSH2_DERIVEKEY 32
#define BUG_SSH2_REKEY 64
#define BUG_SSH2_PK_SESSIONID 128
#define BUG_SSH2_MAXPKT 256
/*
* Codes for terminal modes.
@ -2391,6 +2392,16 @@ static void ssh_detect_bugs(Ssh ssh, char *vstring)
ssh->remote_bugs |= BUG_SSH2_REKEY;
logevent("We believe remote version has SSH-2 rekey bug");
}
if (ssh->cfg.sshbug_maxpkt2 == FORCE_ON ||
(ssh->cfg.sshbug_maxpkt2 == AUTO &&
(wc_match("1.36_sshlib GlobalSCAPE", imp)))) {
/*
* This version ignores our makpkt and needs to be throttled.
*/
ssh->remote_bugs |= BUG_SSH2_MAXPKT;
logevent("We believe remote version ignores SSH-2 maximum packet size");
}
}
/*
@ -6235,6 +6246,15 @@ static void ssh2_set_window(struct ssh_channel *c, int newwin)
if (c->closes != 0)
return;
/*
* If the remote end has a habit of ignoring maxpkt, limit the
* window so that it has no choice (assuming it doesn't ignore the
* window as well).
*/
if ((ssh->remote_bugs & BUG_SSH2_MAXPKT) && newwin > OUR_V2_MAXPKT)
newwin = OUR_V2_MAXPKT;
/*
* Only send a WINDOW_ADJUST if there's significantly more window
* available than the other end thinks there is. This saves us