X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/231ee168f3732ad79bdc8772ab91393f109b8f53..b723338c7d5a7f5929ef742c4b002e65ed5dc5ed:/ssh.c diff --git a/ssh.c b/ssh.c index d9981ed1..2410d145 100644 --- a/ssh.c +++ b/ssh.c @@ -1722,6 +1722,12 @@ static int do_ssh_init(unsigned char c) sprintf(vlog, "We claim version: %s", verstring); logevent(vlog); strcat(verstring, "\n"); + + if (cfg.sshprot == 3) { + bombout(("SSH protocol version 2 required by user but not provided by server")); + crReturn(0); + } + logevent("Using SSH protocol version 1"); sk_write(s, verstring, strlen(verstring)); ssh_protocol = ssh1_protocol; @@ -2733,7 +2739,7 @@ void sshfwd_close(struct ssh_channel *c) * on it now, and then when the server acks the channel * open, we can close it then. */ - if (c->remoteid != -1) { + if (((int)c->remoteid) != -1) { if (ssh_version == 1) { send_packet(SSH1_MSG_CHANNEL_CLOSE, PKT_INT, c->remoteid, PKT_END);