Implement this year's consensus on CHANNEL_FAILURE vs CHANNEL_CLOSE.

We now expect that after the server has sent us CHANNEL_CLOSE, we
should not expect to see any replies to our outstanding channel
requests, and conversely after we have sent CHANNEL_CLOSE we avoid
sending any reply to channel requests from the server. This was the
consensus among implementors discussing the problem on ietf-ssh in
April 2014.

To cope with current OpenSSH's (and perhaps other servers we don't
know about yet) willingness to send request replies after
CHANNEL_CLOSE, I introduce a bug-compatibility flag which is detected
for every OpenSSH version up to and including the current 6.6 - but
not beyond, since https://bugzilla.mindrot.org/show_bug.cgi?id=1818
promises that 6.7 will also implement the new consensus behaviour.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10200 cda61777-01e9-0310-a592-d414129be87e
Fix automatic version numbering in the Unix tarball.

Manfred Schwarb points out that when I moved the autoconf machinery up
from the unix subdirectory to the top level, in r10141, I missed a
couple of lingering $(srcdir)/.. in the make rule for version.o, as a
result of which the automatic checking of the manifest wasn't doing
its thing and tools built from a standard .tar.gz were reporting as
'Unidentified build'.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10201 cda61777-01e9-0310-a592-d414129be87e
Work around a timer leak with GTK 2.4.22 on openSUSE 13.1.

Mihkel Ader reports that on that system, timers apparently aren't
getting auto-destroyed when timer_trigger returns FALSE, so the change
in r10181 has caused GTK PuTTY to gradually allocate more and more
timers and consume more and more CPU as they all keep firing.

As far as I can see, this must surely be a bug in GTK 2 (the docs say
that timers _are_ auto-destroyed when their callback returns false),
and it doesn't seem to happen for me with GTK 2.4.23 on Ubuntu 14.04.
However, I'll try to work around it by _explicitly_ destroying each
old timer before we zero out the variable containing its id.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10202 cda61777-01e9-0310-a592-d414129be87e
Another fix to timer handling.

Robert de Bath points out that failure to remove the timer whose
callback returned FALSE may not have been the cause of runaway timer
explosion; another possibility is that a function called from
timer_trigger()'s call to run_timers() has already set a timer up by
the time run_timers() returns, and then we set another one up on top
of it. Fix that too.


git-svn-id: svn://svn.tartarus.org/sgt/putty@10206 cda61777-01e9-0310-a592-d414129be87e
Check for SURROGATE defines individually.

In mingw32 cross environment on CentOS 6.4 IS_HIGH_SURROGATE is
defined, but not the START and END macros.
Add .gitignore
Add defines and enums for GSS key exchange.
Add support for GSS verify MIC.

For both UNIX and Windows.
Based on Matt Loar's code from https://github.com/mloar/putty
Add ssh_kexes for GSS key exchange.

For both UNIX and Windows.
Based on Matt Loar's code from https://github.com/mloar/putty
Move gsslib to global Ssh struct.

Prepare for GSS key exchange.
Add null host key implementation (RFC 4462, section 5).

When using GSS key exchange the server need not have an RSA or DSS
host key to authenticate itself.
Move gss_srv_name to global Ssh struct.

Prepare for GSS key exchange.
Init gsslibs before key exchange.

Also add can_gssapi to global Ssh struct, and rename locals in
do_ssh2_authconn() to *_gssapi_mic.

Prepare for GSS key exchange.
Break out ssh2_get_nbits().

Prepare for GSS key exchange.
Do GSS import_name before key exchange.

Prepare for GSS key exchange.
Make authentication gss_ctx global.

Prepare for GSS key exchange.
Add support for GSS-API key exchange.

Includes support for "null" host key algorithm and gssapi-keyex
authentication.

Based on Matt Loar's code from https://github.com/mloar/putty
Use 64-bit MIT Kerberos DLL on 64-bit builds.
Add 64-bit manifest, and use for 64-bit builds.
Make compilation work on MinGW64 < 2.0.2.

MinGW64 defines the PROPERTYKEY since at least version 1.0, but didn't
define PROPERTYKEY_DEFINED until version 2.0.2.