X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=ssh.c;h=c05abe28f7e42233b59cf35da17b22c241b31f28;hb=17af65c78c2e754647f37cf0599b6bced213d7c6;hp=6a653e5e0eedccd020fe288180dfedcef517b1d2;hpb=e40f043ff80f6a00a9021b55d3720414e4ac57ab;p=PuTTY.git diff --git a/ssh.c b/ssh.c index 6a653e5e..c05abe28 100644 --- a/ssh.c +++ b/ssh.c @@ -2831,7 +2831,8 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt) } { - char type, *e; + char type; + static char *e; int n; int sport,dport,sserv,dserv; char sports[256], dports[256], host[256]; @@ -2924,6 +2925,18 @@ static void ssh1_protocol(unsigned char *in, int inlen, int ispkt) PKT_STR, host, PKT_INT, dport, PKT_END); + do { + crReturnV; + } while (!ispkt); + if (pktin.type != SSH1_SMSG_SUCCESS + && pktin.type != SSH1_SMSG_FAILURE) { + bombout(("Protocol confusion")); + crReturnV; + } else if (pktin.type == SSH1_SMSG_FAILURE) { + c_write_str("Server refused port forwarding\r\n"); + ssh_editing = ssh_echoing = 1; + } + logevent("Remote port forwarding enabled"); } } }