mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-21 22:28:37 -05:00
SSH back end should now be tolerant of garbage appearing in the data
stream after the actual SSH connection is finished. Some firewalls add this for no good reason. [originally from svn r1271]
This commit is contained in:
parent
3d3ef9b8a4
commit
2e4480d6b6
21
ssh.c
21
ssh.c
@ -607,12 +607,6 @@ static int ssh1_rdpkt(unsigned char **data, int *datalen)
|
|||||||
(*data)++, (*datalen)--;
|
(*data)++, (*datalen)--;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FWHACK
|
|
||||||
if (st->len == 0x52656d6f) { /* "Remo"te server has closed ... */
|
|
||||||
st->len = 0x300; /* big enough to carry to end */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
st->pad = 8 - (st->len % 8);
|
st->pad = 8 - (st->len % 8);
|
||||||
st->biglen = st->len + st->pad;
|
st->biglen = st->len + st->pad;
|
||||||
pktin.length = st->len - 5;
|
pktin.length = st->len - 5;
|
||||||
@ -770,11 +764,7 @@ static int ssh2_rdpkt(unsigned char **data, int *datalen)
|
|||||||
pktin.data[st->i] = *(*data)++;
|
pktin.data[st->i] = *(*data)++;
|
||||||
(*datalen)--;
|
(*datalen)--;
|
||||||
}
|
}
|
||||||
#ifdef FWHACK
|
|
||||||
if (!memcmp(pktin.data, "Remo", 4)) { /* "Remo"te server has closed ... */
|
|
||||||
/* FIXME */
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (sccipher)
|
if (sccipher)
|
||||||
sccipher->decrypt(pktin.data, st->cipherblk);
|
sccipher->decrypt(pktin.data, st->cipherblk);
|
||||||
|
|
||||||
@ -3005,6 +2995,15 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt)
|
|||||||
* if no pty is available or in other odd cases. Ignore */
|
* if no pty is available or in other odd cases. Ignore */
|
||||||
} else if (pktin.type == SSH1_SMSG_EXIT_STATUS) {
|
} else if (pktin.type == SSH1_SMSG_EXIT_STATUS) {
|
||||||
send_packet(SSH1_CMSG_EXIT_CONFIRMATION, PKT_END);
|
send_packet(SSH1_CMSG_EXIT_CONFIRMATION, PKT_END);
|
||||||
|
/*
|
||||||
|
* In case `helpful' firewalls or proxies tack
|
||||||
|
* extra human-readable text on the end of the
|
||||||
|
* session which we might mistake for another
|
||||||
|
* encrypted packet, we close the session once
|
||||||
|
* we've sent EXIT_CONFIRMATION.
|
||||||
|
*/
|
||||||
|
ssh_state = SSH_STATE_CLOSED;
|
||||||
|
crReturnV;
|
||||||
} else {
|
} else {
|
||||||
bombout(("Strange packet received: type %d", pktin.type));
|
bombout(("Strange packet received: type %d", pktin.type));
|
||||||
crReturnV;
|
crReturnV;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user