u/mdw/putty
18 years agoSHA-256 implementation, for use in future KEX algorithms, in particular
ben [Wed, 31 Aug 2005 21:48:22 +0000 (21:48 +0000)]
SHA-256 implementation, for use in future KEX algorithms, in particular
diffie-hellman-group-exchange-sha256, which the last DHGEX draft defined.
Code lifted from Simon's "crypto" directory, with changes to make it look
more like sshsh512.c.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6252 cda61777-01e9-0310-a592-d414129be87e

18 years agoAdd infrastructure for supporting multiple hashes in key exchange.
ben [Wed, 31 Aug 2005 20:43:06 +0000 (20:43 +0000)]
Add infrastructure for supporting multiple hashes in key exchange.
Nothing very surprising here.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6251 cda61777-01e9-0310-a592-d414129be87e

18 years agoRename ssh_md5 and ssh_sha1 to ssh_hmac_md5 and ssh_hmac_sha1 respectively.
ben [Wed, 31 Aug 2005 19:11:19 +0000 (19:11 +0000)]
Rename ssh_md5 and ssh_sha1 to ssh_hmac_md5 and ssh_hmac_sha1 respectively.
This is to make room for a hash abstraction that's likely to want to use
ssh_sha1, at least.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6249 cda61777-01e9-0310-a592-d414129be87e

18 years agoExplicitly note that "remote command" semantics typically involve the server
jacob [Wed, 31 Aug 2005 16:14:21 +0000 (16:14 +0000)]
Explicitly note that "remote command" semantics typically involve the server
closing the connection after the command has executed.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6246 cda61777-01e9-0310-a592-d414129be87e

18 years agoFurther progress in the direction of variable exchange hashes -- stash the
ben [Tue, 30 Aug 2005 22:39:35 +0000 (22:39 +0000)]
Further progress in the direction of variable exchange hashes -- stash the
outgoing KEXINIT, and only start generating the exchange hash once we know
which KEX method we're using.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6242 cda61777-01e9-0310-a592-d414129be87e

18 years agoBeginnings of support for multiple exchange hashes in SSH-2: rather than
ben [Tue, 30 Aug 2005 20:38:57 +0000 (20:38 +0000)]
Beginnings of support for multiple exchange hashes in SSH-2: rather than
storing a SHA-1 hash of the client and server version strings, store the
strings themselves so we can feed them through the appropriate hash when
we know what it is.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6241 cda61777-01e9-0310-a592-d414129be87e

18 years agoMore versions of WeOnlyDo have the rekey bug (but they've fixed it now).
jacob [Mon, 29 Aug 2005 00:34:03 +0000 (00:34 +0000)]
More versions of WeOnlyDo have the rekey bug (but they've fixed it now).

git-svn-id: svn://svn.tartarus.org/sgt/putty@6233 cda61777-01e9-0310-a592-d414129be87e

18 years agoI think this should fix various problems with queued incoming data not being
jacob [Fri, 26 Aug 2005 21:17:49 +0000 (21:17 +0000)]
I think this should fix various problems with queued incoming data not being
processed and incoming data being processed out of order, which I suspect is
the cause of `ssh1-fwd-trouble' as noted by Gevan Dutton. I'm not able to
test the failure case, but it doesn't seem to have obviously broken anything
in the cases I have tested, anyway.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6221 cda61777-01e9-0310-a592-d414129be87e

18 years agoAdd support for generating project files for use with Dev-C++, contributed
ben [Mon, 22 Aug 2005 20:37:13 +0000 (20:37 +0000)]
Add support for generating project files for use with Dev-C++, contributed
by Florian Gaab.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6201 cda61777-01e9-0310-a592-d414129be87e

18 years agoFlorian Gaab reports that freeSSHd 1.0.7, which claims a "softwareversion"
ben [Mon, 22 Aug 2005 20:07:46 +0000 (20:07 +0000)]
Florian Gaab reports that freeSSHd 1.0.7, which claims a "softwareversion"
of "WeOnlyDo-1.2.6", mishandles repeat key exchange.  Add it to the list.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6200 cda61777-01e9-0310-a592-d414129be87e

18 years agoBen Rudiak-Gould points out that we should be using WM_APP as the base for
jacob [Wed, 10 Aug 2005 18:31:24 +0000 (18:31 +0000)]
Ben Rudiak-Gould points out that we should be using WM_APP as the base for
our app-private window messages, which is considerably higher than the
WM_XUSER we arbitrarily chose. (This isn't known to be causing any actual
problems. The fix seems not to have obviously broken anything.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@6183 cda61777-01e9-0310-a592-d414129be87e

18 years agodraft-ietf-secsh-transport-24 says that only "SSH-" at the start of a line
ben [Sun, 24 Jul 2005 13:46:14 +0000 (13:46 +0000)]
draft-ietf-secsh-transport-24 says that only "SSH-" at the start of a line
marks a version string.  It's a bit vague about the definition of a line,
but I think it's reasonable to assume that they'll end with LF.  Change
do_ssh_init() to ignore "SSH-" anywhere else.  This makes the existing state
machine overkill, so replace it with something a little more readable.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6138 cda61777-01e9-0310-a592-d414129be87e

18 years agoThis is getting silly; nearly 25% of our mirrors are now in the US.
jacob [Sun, 17 Jul 2005 13:37:58 +0000 (13:37 +0000)]
This is getting silly; nearly 25% of our mirrors are now in the US.
Discourage more strongly mirrors in well-served areas in the Feedback section.
Also, duplicate that text on the Mirrors page, along with a request to tell us
the country (since lots of people still don't).

git-svn-id: svn://svn.tartarus.org/sgt/putty@6109 cda61777-01e9-0310-a592-d414129be87e

18 years agoPatch from Colin Watson: we were sometimes passing stack storage to putenv(),
jacob [Fri, 15 Jul 2005 11:47:28 +0000 (11:47 +0000)]
Patch from Colin Watson: we were sometimes passing stack storage to putenv(),
which is Bad (in his case, it caused TERM to end up unset). Use malloc()'d
storage instead.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6095 cda61777-01e9-0310-a592-d414129be87e

18 years agoMissing argument in MALLOC_LOG version of snrealloc() macro.
jacob [Wed, 6 Jul 2005 18:26:41 +0000 (18:26 +0000)]
Missing argument in MALLOC_LOG version of snrealloc() macro.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6075 cda61777-01e9-0310-a592-d414129be87e

18 years agoPiers Finlayson reports that "DigiSSH_2.0" chokes (in a new and exciting
ben [Tue, 5 Jul 2005 21:15:23 +0000 (21:15 +0000)]
Piers Finlayson reports that "DigiSSH_2.0" chokes (in a new and exciting
manner) on rekeys.  Add it to the list.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6067 cda61777-01e9-0310-a592-d414129be87e

18 years agoTry to make it slightly clearer that TIS/CryptoCard are generic, since
jacob [Wed, 29 Jun 2005 18:20:17 +0000 (18:20 +0000)]
Try to make it slightly clearer that TIS/CryptoCard are generic, since
SSH:TDGv2 seems to think that TIS is only relevant to its original
application (whose name eludes me at the moment).

git-svn-id: svn://svn.tartarus.org/sgt/putty@6038 cda61777-01e9-0310-a592-d414129be87e

18 years agoIn local-to-remote copies, abort if fxp_init() fails, rather than ploughing
ben [Sat, 25 Jun 2005 21:43:09 +0000 (21:43 +0000)]
In local-to-remote copies, abort if fxp_init() fails, rather than ploughing
on and trying to transfer files, which caused a null-pointer deference.

Thanks to Fernando Najera for reporting the bug.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6021 cda61777-01e9-0310-a592-d414129be87e

18 years agoQuote session name in command line example for robustness.
ben [Sat, 25 Jun 2005 19:22:13 +0000 (19:22 +0000)]
Quote session name in command line example for robustness.

git-svn-id: svn://svn.tartarus.org/sgt/putty@6020 cda61777-01e9-0310-a592-d414129be87e

18 years agoImprove IPA representation of "PuTTY", as suggested by John Lunney. My
ben [Wed, 22 Jun 2005 10:00:09 +0000 (10:00 +0000)]
Improve IPA representation of "PuTTY", as suggested by John Lunney.  My
rationale (as mailed to him):

I think you're right.  I got the pronunciation there from the second edition
of the OED and my Collins dictionary at home, both of which believe that
"pretty" is pronounced /'prItI/, but, at least to me, those two vowels are
different.  Both of them think that /i/ doesn't occur in English words, the
vowel in "beat" being /i:/.  The third edition of the OED, though, adds /i/
as an English vowel in its pronunciation guide, with "happy" as an example
of its use.  I'll update the FAQ following your suggestion.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5989 cda61777-01e9-0310-a592-d414129be87e

18 years agoFix an apparently-harmless error spotted by Ben Rudiak-Gould:
jacob [Tue, 21 Jun 2005 20:13:48 +0000 (20:13 +0000)]
Fix an apparently-harmless error spotted by Ben Rudiak-Gould:
do_ssh2_transport() was returning the wrong value for rekeys after the first.
This apparent error was introduced in r4901, but we can't see any reason for
the change to have been made. If it turns out to be a mistake to revert it,
I'm sure we'll find out.

Here for posterity is Simon's analysis:

| A lot of the return values from do_ssh2_transport appear to be vestigial: it
| used to be that a zero return from do_ssh2_transport meant it had handled the
| packet internally, and a 1 return meant the packet wasn't a transport-layer
| one and needed to pass on to do_ssh2_authconn. Since r4901, however, the
| layer discrimination is done based on the message type ranges, and the only
| remaining dependency on the return value from do_ssh2_transport is a special
| case in ssh2_protocol which detects the first 1 return and makes the
| initialisation call to do_ssh2_authconn.
|
| Therefore, the gratuitous 1 return on every key exchange as a result of the
| confusing if statement is simply ignored in ssh2_protocol (because
| ssh->protocol_initial_phase_done is already TRUE). So the remaining question
| was, why does the _lack_ of that 1 return not cause a problem, if the if's
| sense is indeed reversed?
|
| The answer is that 1 is still returned, just not by the crReturn inside the
| if statement. It's returned by the next crReturn, just after
| wait_for_rekey(). Which suggests that in fact, the if statement has the
| correct sense, but the crReturn inside it has the wrong value - it should be
| returning _zero_, to indicate that every NEWKEYS after the first one is
| uninteresting to the authconn code, and on the very first run through that
| doesn't happen and the NEWKEYS gets all the way to the crReturn(1) later on.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5986 cda61777-01e9-0310-a592-d414129be87e

18 years agoMake the sanity-checks on the size of incoming packets much stricter. We now
ben [Mon, 20 Jun 2005 13:56:30 +0000 (13:56 +0000)]
Make the sanity-checks on the size of incoming packets much stricter.  We now
enforce the following:

* Packet must have at least one byte of payload and four bytes of padding.
* Total packet length must not exceed 35000 bytes compressed.
* Total packet length including length field must be a multiple of cipher
  block size (or eight bytes).

The feebleness of our old checks was noticed by Ben Rudiak-Gould.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5981 cda61777-01e9-0310-a592-d414129be87e

18 years agoA major purpose of PuTTY's memory-allocation functions is to succeed or die
ben [Sun, 19 Jun 2005 14:17:24 +0000 (14:17 +0000)]
A major purpose of PuTTY's memory-allocation functions is to succeed or die
trying, so there's no need to check their return values for NULL.  Spotted
by Ben Rudiak-Gould.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5978 cda61777-01e9-0310-a592-d414129be87e

18 years agoMove comment about ECHO and LINE input modes to a more sensible position.
ben [Sun, 19 Jun 2005 13:57:50 +0000 (13:57 +0000)]
Move comment about ECHO and LINE input modes to a more sensible position.
Spotted by Ben Rudiak-Gould.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5976 cda61777-01e9-0310-a592-d414129be87e

18 years agoDetection of "auth-agent@openssh.com" was too liberal. Spotted by
jacob [Tue, 14 Jun 2005 23:20:42 +0000 (23:20 +0000)]
Detection of "auth-agent@openssh.com" was too liberal. Spotted by
Ben Rudiak-Gould.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5962 cda61777-01e9-0310-a592-d414129be87e

18 years agoWe should wait until the Rlogin server indicates that it's happy to receive
jacob [Tue, 14 Jun 2005 14:48:17 +0000 (14:48 +0000)]
We should wait until the Rlogin server indicates that it's happy to receive
window-size notifications before we send them.
This clears up a problem where the first password entry always failed.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5960 cda61777-01e9-0310-a592-d414129be87e

18 years ago"SanskritFritz" points out that digits at the start of RTF pastes were being
jacob [Thu, 9 Jun 2005 10:05:29 +0000 (10:05 +0000)]
"SanskritFritz" points out that digits at the start of RTF pastes were being
eaten by the trailing "\f0" on the RTF preamble. The RTF spec (1.0 and 1.6)
suggests that adding a space should defuse this situation and be otherwise
harmless, and it works for me (Win98).

git-svn-id: svn://svn.tartarus.org/sgt/putty@5931 cda61777-01e9-0310-a592-d414129be87e

18 years agoDouble-free on mkdir error, spotted by Brian Hartsock.
jacob [Wed, 8 Jun 2005 15:14:47 +0000 (15:14 +0000)]
Double-free on mkdir error, spotted by Brian Hartsock.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5929 cda61777-01e9-0310-a592-d414129be87e

18 years agoRemove a couple of mistaken references to Telnet in comments.
jacob [Sat, 28 May 2005 13:46:04 +0000 (13:46 +0000)]
Remove a couple of mistaken references to Telnet in comments.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5853 cda61777-01e9-0310-a592-d414129be87e

18 years agoMiscellaneous updates:
jacob [Mon, 23 May 2005 12:41:21 +0000 (12:41 +0000)]
Miscellaneous updates:
 - note Visual Foo version requirements
 - note which things are done for you in our source snapshots
 - other tweaks

git-svn-id: svn://svn.tartarus.org/sgt/putty@5839 cda61777-01e9-0310-a592-d414129be87e

18 years agoFactor out all local SSH disconnections into a new function ssh_disconnect(),
jacob [Sat, 21 May 2005 16:49:27 +0000 (16:49 +0000)]
Factor out all local SSH disconnections into a new function ssh_disconnect(),
and add the ability to treat a local disconnection as "unclean" -- notably, if
we can't agree any authentication methods to even try; someone was complaining
that the PuTTY window by default just disappears for no apparent reason in this
circumstance.

Also, use appropriate disconnect codes for those SSH2_MSG_DISCONNECT messages
that we do send.

I don't think I've seriously broken any user-visible behaviour, but the way
that connection-close distinctions are transmitted to the front-end is shaky
(or so it seems to me), so there may be non-ideal changes on some platforms.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5824 cda61777-01e9-0310-a592-d414129be87e

18 years agoFix documentation of NO_MANIFESTS (oops).
jacob [Sat, 21 May 2005 15:09:36 +0000 (15:09 +0000)]
Fix documentation of NO_MANIFESTS (oops).

git-svn-id: svn://svn.tartarus.org/sgt/putty@5821 cda61777-01e9-0310-a592-d414129be87e

18 years agoAdd NO_MANIFESTS option to Windows build, as the manifests apparently cause
jacob [Sat, 21 May 2005 14:35:21 +0000 (14:35 +0000)]
Add NO_MANIFESTS option to Windows build, as the manifests apparently cause
trouble for 64-bit Windows builds.
Also flag the build flags that only apply to Windows.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5820 cda61777-01e9-0310-a592-d414129be87e

18 years agoUse {Get,Set}WindowLongPtr() instead of {Get,Set}WindowLong() for compatibility
jacob [Sat, 21 May 2005 14:16:43 +0000 (14:16 +0000)]
Use {Get,Set}WindowLongPtr() instead of {Get,Set}WindowLong() for compatibility
with 64-bit Windows. Untested on 64-bit, but it doesn't appear to have broken
anything on 32-bit.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5819 cda61777-01e9-0310-a592-d414129be87e

18 years agoMinor memory leak spotted by Mikhail Kruk.
jacob [Fri, 20 May 2005 21:52:07 +0000 (21:52 +0000)]
Minor memory leak spotted by Mikhail Kruk.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5815 cda61777-01e9-0310-a592-d414129be87e

18 years agoconnection_fatal() should be called after ssh_closing() and other accesses to
jacob [Mon, 16 May 2005 14:41:08 +0000 (14:41 +0000)]
connection_fatal() should be called after ssh_closing() and other accesses to
`ssh', since it potentially frees it and potentially doesn't return.
Only affected a couple of rare circumstances.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5787 cda61777-01e9-0310-a592-d414129be87e

18 years agoDon't try and set up reconfigured port-forwardings if the connection isn't yet
jacob [Mon, 16 May 2005 08:31:05 +0000 (08:31 +0000)]
Don't try and set up reconfigured port-forwardings if the connection isn't yet
ready for them. Spotted by Martin Dushkov.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5786 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd experimental support for detecting BREAK on input and propagating it as
ben [Sat, 14 May 2005 22:01:10 +0000 (22:01 +0000)]
Add experimental support for detecting BREAK on input and propagating it as
TS_BRK on output.  This is tested to the extent that other data survive the
escaping performed by PARMRK, at least on my system.  Actual passing on
of BREAK is as-yet untested.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5779 cda61777-01e9-0310-a592-d414129be87e

19 years agoUse the packet dispatch table to handle USERAUTH_BANNER messages, which should
jacob [Thu, 12 May 2005 15:09:35 +0000 (15:09 +0000)]
Use the packet dispatch table to handle USERAUTH_BANNER messages, which should
hopefully solve `drop-banner'. I haven't been able to test the failure case,
but the behaviour with OpenSSH appears no worse.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5772 cda61777-01e9-0310-a592-d414129be87e

19 years agos/public/private/ spotted by Walter Cleverly.
jacob [Mon, 9 May 2005 21:01:11 +0000 (21:01 +0000)]
s/public/private/ spotted by Walter Cleverly.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5765 cda61777-01e9-0310-a592-d414129be87e

19 years agoMake Makefile.gtk build again on Linux (assume <utmpx.h>).
jacob [Mon, 9 May 2005 13:27:51 +0000 (13:27 +0000)]
Make Makefile.gtk build again on Linux (assume <utmpx.h>).

git-svn-id: svn://svn.tartarus.org/sgt/putty@5764 cda61777-01e9-0310-a592-d414129be87e

19 years agoFix what looks like a cut-and-paste error which was stopping Unix
simon [Sun, 8 May 2005 11:47:59 +0000 (11:47 +0000)]
Fix what looks like a cut-and-paste error which was stopping Unix
Plink building on MacOS X.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5762 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd `install-sh' to svn:ignore
jacob [Fri, 6 May 2005 10:19:34 +0000 (10:19 +0000)]
Add `install-sh' to svn:ignore

git-svn-id: svn://svn.tartarus.org/sgt/putty@5752 cda61777-01e9-0310-a592-d414129be87e

19 years agoCorrect apparent misspelling of `SIOCATMARK'.
jacob [Thu, 5 May 2005 22:47:30 +0000 (22:47 +0000)]
Correct apparent misspelling of `SIOCATMARK'.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5749 cda61777-01e9-0310-a592-d414129be87e

19 years agoImplement `bypass-ssh2-userauth', since from correspondence it sounds like
jacob [Thu, 5 May 2005 22:37:54 +0000 (22:37 +0000)]
Implement `bypass-ssh2-userauth', since from correspondence it sounds like
there are servers which could in principle operate in this mode, although I
don't know if any do in practice. (Hence, I haven't been able to test it.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5748 cda61777-01e9-0310-a592-d414129be87e

19 years agoAlso blank X authentication data when using SSH-1, and add a comment explaining
ben [Sat, 30 Apr 2005 17:08:48 +0000 (17:08 +0000)]
Also blank X authentication data when using SSH-1, and add a comment explaining
why this may not be sufficient to hide it.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5720 cda61777-01e9-0310-a592-d414129be87e

19 years agoX11 authentication data are generally sensitive, so blank them from packet
ben [Sat, 30 Apr 2005 16:13:11 +0000 (16:13 +0000)]
X11 authentication data are generally sensitive, so blank them from packet
logs by default.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5719 cda61777-01e9-0310-a592-d414129be87e

19 years agoUnlike the AES and Blowfish code, our implementations of the various DES
ben [Sat, 30 Apr 2005 14:30:07 +0000 (14:30 +0000)]
Unlike the AES and Blowfish code, our implementations of the various DES
modes of operation all took separate source and destination pointers.  They
were never called with those pointers different, though, so reduce them to
a single pointer like everything else uses.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5716 cda61777-01e9-0310-a592-d414129be87e

19 years agoFix stupid typo that probably utterly broke SSH-1 support, and caused compiles
ben [Sat, 30 Apr 2005 14:26:46 +0000 (14:26 +0000)]
Fix stupid typo that probably utterly broke SSH-1 support, and caused compiles
with GCC to fail.  Not sure how it survived long enough to test, really.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5715 cda61777-01e9-0310-a592-d414129be87e

19 years agoMinimally document 3des-ctr and blowfish-ctr.
ben [Thu, 28 Apr 2005 09:03:16 +0000 (09:03 +0000)]
Minimally document 3des-ctr and blowfish-ctr.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5703 cda61777-01e9-0310-a592-d414129be87e

19 years agoRemove comment explaining why 3des-ctr is disabled, since it isn't.
ben [Thu, 28 Apr 2005 09:00:50 +0000 (09:00 +0000)]
Remove comment explaining why 3des-ctr is disabled, since it isn't.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5702 cda61777-01e9-0310-a592-d414129be87e

19 years agoEnable blowfish-ctr by default. It's been tested and found working.
ben [Thu, 28 Apr 2005 08:56:03 +0000 (08:56 +0000)]
Enable blowfish-ctr by default.  It's been tested and found working.
Thanks to der Mouse for help with the testing.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5701 cda61777-01e9-0310-a592-d414129be87e

19 years agoIn blowfish-ctr mode, increment the counter in the correct order. Thanks to
ben [Thu, 28 Apr 2005 08:24:46 +0000 (08:24 +0000)]
In blowfish-ctr mode, increment the counter in the correct order.  Thanks to
der Mouse for spotting the same error in my 3des-ctr implementation.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5700 cda61777-01e9-0310-a592-d414129be87e

19 years agoFix two more stupid bugs in 3des-ctr:
ben [Thu, 28 Apr 2005 08:21:04 +0000 (08:21 +0000)]
Fix two more stupid bugs in 3des-ctr:
 - We were using the first word of each block of keystream block twice and the
   second not at all.
 - We were incrementing the high-order word of the counter after every block
   rather than the low-order one.

With those fixed, our 3des-ctr implementation interoperates with the one in
Moussh.  Thanks to der Mouse for his help with the testing.

3des-ctr is now enabled by default.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5699 cda61777-01e9-0310-a592-d414129be87e

19 years agoOn monochrome displays, display the cursor in reverse video so that it's
ben [Wed, 27 Apr 2005 21:42:51 +0000 (21:42 +0000)]
On monochrome displays, display the cursor in reverse video so that it's
visible on reversed out text.  This only applies to active block cursors for
now.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5698 cda61777-01e9-0310-a592-d414129be87e

19 years agoTiny manual CSE of previous commit.
ben [Wed, 27 Apr 2005 21:22:40 +0000 (21:22 +0000)]
Tiny manual CSE of previous commit.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5697 cda61777-01e9-0310-a592-d414129be87e

19 years agoOn 1bpp displays, ignore colour attributes. This makes pterm minimally useful
ben [Wed, 27 Apr 2005 21:09:45 +0000 (21:09 +0000)]
On 1bpp displays, ignore colour attributes.  This makes pterm minimally useful
there, though (e.g.) switching to using reverse video for the cursor would
probably also help.  Displays with other silly depths (e.g. 2bpp) aren't
catered for, but I suspect they're rare in the X world.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5696 cda61777-01e9-0310-a592-d414129be87e

19 years agoMake palette changes use "best match" colours too.
ben [Wed, 27 Apr 2005 20:30:47 +0000 (20:30 +0000)]
Make palette changes use "best match" colours too.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5695 cda61777-01e9-0310-a592-d414129be87e

19 years agoRather than checking for <sys/sockio.h>, just include it if our other
ben [Wed, 27 Apr 2005 15:42:10 +0000 (15:42 +0000)]
Rather than checking for <sys/sockio.h>, just include it if our other
attempts at finding SIOCATMARK have failed.  This removes one of our
Autoconf tests, which is always nice.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5690 cda61777-01e9-0310-a592-d414129be87e

19 years agoUse the correct key order for 3des-ctr.
ben [Wed, 27 Apr 2005 12:39:52 +0000 (12:39 +0000)]
Use the correct key order for 3des-ctr.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5687 cda61777-01e9-0310-a592-d414129be87e

19 years agoIn SSH-2 mode, PuTTY wasn't sending KEXINIT until it had received one from the
ben [Wed, 27 Apr 2005 11:10:54 +0000 (11:10 +0000)]
In SSH-2 mode, PuTTY wasn't sending KEXINIT until it had received one from the
server, which led to stalemate if the server did the same.  PuTTY now sends
KEXINIT proactively as soon as it's worked out that it's talking SSH-2.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5685 cda61777-01e9-0310-a592-d414129be87e

19 years agomkunxarc.sh is supposed to be silent, so I'm having it discard the
simon [Wed, 27 Apr 2005 08:09:32 +0000 (08:09 +0000)]
mkunxarc.sh is supposed to be silent, so I'm having it discard the
stderr output from mkauto.sh. (I debated discarding it within
mkauto.sh itself, but decided against it.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5684 cda61777-01e9-0310-a592-d414129be87e

19 years agoAccording to the termio(7I) on Solaris, OLCUC is overridden by OPOST, so we
ben [Tue, 26 Apr 2005 00:03:50 +0000 (00:03 +0000)]
According to the termio(7I) on Solaris, OLCUC is overridden by OPOST, so we
should send it with the SSH terminal modes too.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5680 cda61777-01e9-0310-a592-d414129be87e

19 years agoSquash OPOST locally when we're not in line-editing mode, and propagate
ben [Mon, 25 Apr 2005 23:57:45 +0000 (23:57 +0000)]
Squash OPOST locally when we're not in line-editing mode, and propagate
the other output flags with SSH.  This means that when I log into a remote
system using Plink and then run "stty -onlcr" I get the expected
stair-stepping.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5679 cda61777-01e9-0310-a592-d414129be87e

19 years agoUse pututxline() in place of pututline(), since the former is standardised by
ben [Mon, 25 Apr 2005 23:28:25 +0000 (23:28 +0000)]
Use pututxline() in place of pututline(), since the former is standardised by
X/Open and actually seems to be more common (NetBSD has it).  Also use
updwtmpx() rather than directly writing to the wtmpx file, though more for
reasons of aesthetics than anything practical.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5678 cda61777-01e9-0310-a592-d414129be87e

19 years agoAsk GDK to give us reasonable approximations if it can't get precisely the
ben [Mon, 25 Apr 2005 22:46:08 +0000 (22:46 +0000)]
Ask GDK to give us reasonable approximations if it can't get precisely the
colours we asked it for.  This means that I can run pterm on an 8-bit
PseudoColor display even if I have another program running.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5677 cda61777-01e9-0310-a592-d414129be87e

19 years agoCheck for <sys/sockio.h> and include it in uxnet.c if we find it. It's
ben [Mon, 25 Apr 2005 18:51:15 +0000 (18:51 +0000)]
Check for <sys/sockio.h> and include it in uxnet.c if we find it.  It's
necessary on Solaris if we want to use SIOCATMARK.  Using sockatmark() might
be preferable, but despite being notionally standard it's missing on
Solaris 9 and Mac OS X 10.3.9, whereas everyone seems to have SIOCATMARK
somewhere.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5676 cda61777-01e9-0310-a592-d414129be87e

19 years agouxpty.c uses non-X/Open facilities (notably strsignal()), so don't define
ben [Mon, 25 Apr 2005 17:21:08 +0000 (17:21 +0000)]
uxpty.c uses non-X/Open facilities (notably strsignal()), so don't define
_XOPEN_SOURCE.  We do still need _GNU_SOURCE in order to get grantpt()
on GNU systems.  This allows uxpty.c to compile on NetBSD.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5675 cda61777-01e9-0310-a592-d414129be87e

19 years agoMove generation of the "configure" script into its own script so that
ben [Mon, 25 Apr 2005 16:36:43 +0000 (16:36 +0000)]
Move generation of the "configure" script into its own script so that
people who check the code out of Subversion can get it to go.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5674 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd a mechanism for using autoconf to detect the quirks of Unix systems
ben [Mon, 25 Apr 2005 15:55:06 +0000 (15:55 +0000)]
Add a mechanism for using autoconf to detect the quirks of Unix systems
rather than relying on the user to edit the Makefile.  Makefile.gtk
still works as well as it ever did, but now we get a Makefile.in alongside
it.  mkunxarc.sh now relies on autoconf and friends to build the configure
script for the Unix source distribution.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5673 cda61777-01e9-0310-a592-d414129be87e

19 years agoOn some systems (NetBSD 1.6 and Solaris 9, at least), GCC doesn't understand
ben [Sun, 24 Apr 2005 14:43:00 +0000 (14:43 +0000)]
On some systems (NetBSD 1.6 and Solaris 9, at least), GCC doesn't understand
the semantics of assert(0) and believes it can return.  Add a gratuitous
exit(1) to convince it that this won't happen, and hence quell a couple of
warnings about variables' being used uninitialised.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5669 cda61777-01e9-0310-a592-d414129be87e

19 years agoNow that we've got at least some SDCTR modes working (and aes256-ctr is our
ben [Sat, 23 Apr 2005 16:22:51 +0000 (16:22 +0000)]
Now that we've got at least some SDCTR modes working (and aes256-ctr is our
default preferred cipher), add code to inject SSH_MSG_IGNOREs to randomise
the IV when using CBC-mode ciphers.  Each cipher has a flag to indicate
whether it needs this workaround, and the SSH packet output maze has gained
some extra complexity to implement it.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5659 cda61777-01e9-0310-a592-d414129be87e

19 years agoStir in process ID at start.
jacob [Fri, 22 Apr 2005 15:47:28 +0000 (15:47 +0000)]
Stir in process ID at start.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5655 cda61777-01e9-0310-a592-d414129be87e

19 years agoChange proxy-dns `Auto' default for SOCKS5 from local DNS to remote DNS.
jacob [Fri, 22 Apr 2005 00:00:49 +0000 (00:00 +0000)]
Change proxy-dns `Auto' default for SOCKS5 from local DNS to remote DNS.
SOCKS5 should always be able to do this, and I suspect our not doing so
dates from when the SOCKS proxy types were under a single configuration
option (pre-r3168).

git-svn-id: svn://svn.tartarus.org/sgt/putty@5654 cda61777-01e9-0310-a592-d414129be87e

19 years agoFirst crack at `terminal-modes' in SSH. PuTTY now sends ERASE by default,
jacob [Thu, 21 Apr 2005 13:57:08 +0000 (13:57 +0000)]
First crack at `terminal-modes' in SSH. PuTTY now sends ERASE by default,
Unix Plink sends everything sensible it can find, and it's fully configurable
from the GUI.

I'm not entirely sure about the precise set of modes that Unix Plink should
look at; informed tweaks are welcome.

Also the Mac bits are guesses (but trivial).

git-svn-id: svn://svn.tartarus.org/sgt/putty@5653 cda61777-01e9-0310-a592-d414129be87e

19 years agoIfdef out the actual code supporting 3des-ctr and blowfish-ctr, since GCC
ben [Wed, 20 Apr 2005 22:52:54 +0000 (22:52 +0000)]
Ifdef out the actual code supporting 3des-ctr and blowfish-ctr, since GCC
now notices that it isn't used.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5652 cda61777-01e9-0310-a592-d414129be87e

19 years agoSimon (accidentally, I think) enabled 3des-ctr and blowfish-ctr. Turn them
ben [Wed, 20 Apr 2005 22:47:29 +0000 (22:47 +0000)]
Simon (accidentally, I think) enabled 3des-ctr and blowfish-ctr.  Turn them
back off again since they're still untested.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5651 cda61777-01e9-0310-a592-d414129be87e

19 years agoMinimally document our support of aes*-ctr.
ben [Wed, 20 Apr 2005 21:29:57 +0000 (21:29 +0000)]
Minimally document our support of aes*-ctr.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5650 cda61777-01e9-0310-a592-d414129be87e

19 years agoEnable arcfour256-draft-00@putty.projects.tartarus.org, since I've now tested
ben [Wed, 20 Apr 2005 20:57:00 +0000 (20:57 +0000)]
Enable arcfour256-draft-00@putty.projects.tartarus.org, since I've now tested
it against an independent implementation.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5649 cda61777-01e9-0310-a592-d414129be87e

19 years agoInvent a way of specifying control characters numerically in ctrlparse():
jacob [Tue, 19 Apr 2005 19:18:14 +0000 (19:18 +0000)]
Invent a way of specifying control characters numerically in ctrlparse():
^<27>, ^<0x1B>, ^<033>. (This doesn't tread on any syntax that already had a
non-null behaviour.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5647 cda61777-01e9-0310-a592-d414129be87e

19 years agoPull out parsing of ^C style strings from the terminal answerback code to
jacob [Tue, 19 Apr 2005 18:58:29 +0000 (18:58 +0000)]
Pull out parsing of ^C style strings from the terminal answerback code to
its own function, since I'll be wanting it for `terminal-modes'.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5646 cda61777-01e9-0310-a592-d414129be87e

19 years agoRemove "none" from the MACs we offer to support in SSH-2. (It was at the
jacob [Tue, 19 Apr 2005 13:27:21 +0000 (13:27 +0000)]
Remove "none" from the MACs we offer to support in SSH-2. (It was at the
end, after the REQUIRED "hmac-sha1".) This has been present since SSH-2
support was introduced (r569).

git-svn-id: svn://svn.tartarus.org/sgt/putty@5643 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd ability to construct SSH-1 packets incrementally (not used yet).
jacob [Mon, 18 Apr 2005 21:09:58 +0000 (21:09 +0000)]
Add ability to construct SSH-1 packets incrementally (not used yet).
I've added this to support `terminal-modes', but since this unifies some
SSH-1 and SSH-2 packet construction code, it saves a few hundred bytes.
Bonus.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5642 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd a comment describing `dummyitem' in prefslist and associated problems.
jacob [Mon, 18 Apr 2005 12:21:53 +0000 (12:21 +0000)]
Add a comment describing `dummyitem' in prefslist and associated problems.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5641 cda61777-01e9-0310-a592-d414129be87e

19 years agoRecent CTR mode changes stopped OS X PuTTY from compiling, because
simon [Mon, 18 Apr 2005 10:01:57 +0000 (10:01 +0000)]
Recent CTR mode changes stopped OS X PuTTY from compiling, because
-Werror objects at various static data items being defined but not
used. Ifdef some things out to restore warning-free compilability.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5640 cda61777-01e9-0310-a592-d414129be87e

19 years agoIndex "Event Log", "system menu", and "context menu" better.
ben [Fri, 15 Apr 2005 13:11:27 +0000 (13:11 +0000)]
Index "Event Log", "system menu", and "context menu" better.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5636 cda61777-01e9-0310-a592-d414129be87e

19 years agoImplement my experimental arcfour modes. The 256-bit version is disabled
ben [Thu, 14 Apr 2005 22:58:29 +0000 (22:58 +0000)]
Implement my experimental arcfour modes.  The 256-bit version is disabled
until I can test it against someone else's implementation.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5633 cda61777-01e9-0310-a592-d414129be87e

19 years agoUnify GET_32BIT()/PUT_32BIT() et al from numerous source files into misc.h.
jacob [Tue, 12 Apr 2005 20:04:56 +0000 (20:04 +0000)]
Unify GET_32BIT()/PUT_32BIT() et al from numerous source files into misc.h.
I've done a bit of testing (not exhaustive), and I don't _think_ I've broken
anything...

git-svn-id: svn://svn.tartarus.org/sgt/putty@5632 cda61777-01e9-0310-a592-d414129be87e

19 years agoComment: change "window.c" to "the front end"
jacob [Mon, 11 Apr 2005 17:37:02 +0000 (17:37 +0000)]
Comment: change "window.c" to "the front end"

git-svn-id: svn://svn.tartarus.org/sgt/putty@5628 cda61777-01e9-0310-a592-d414129be87e

19 years agoFactor out the code to read and write the Environment and PortForwardings
jacob [Mon, 11 Apr 2005 16:24:58 +0000 (16:24 +0000)]
Factor out the code to read and write the Environment and PortForwardings
mappings into two new functions.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5627 cda61777-01e9-0310-a592-d414129be87e

19 years agoRetire winctrls.c:multiedit() in favour of a new simpler function for a
jacob [Mon, 11 Apr 2005 16:23:35 +0000 (16:23 +0000)]
Retire winctrls.c:multiedit() in favour of a new simpler function for a
single full-width edit box. multiedit()'s extra functionality has been
superseded by the "columns" mechanism, and it didn't allow an edit box to
be created with no label.

Also add no-label capability to a couple of other controls.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5626 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd WS_VSCROLL style to drop-down non-combo boxes, to add a scroll bar
jacob [Sat, 9 Apr 2005 23:02:55 +0000 (23:02 +0000)]
Add WS_VSCROLL style to drop-down non-combo boxes, to add a scroll bar
if needed. (Doesn't affect the appearance of any existing controls.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5621 cda61777-01e9-0310-a592-d414129be87e

19 years agoTone down canonical-name resolution when using getaddrinfo(). Previously
jacob [Thu, 7 Apr 2005 22:33:42 +0000 (22:33 +0000)]
Tone down canonical-name resolution when using getaddrinfo(). Previously
we were doing a forward+reverse lookup, which seems above and beyond the
call of duty, especially given that getaddrinfo() can be persuaded to
return a canonical name (this is what unix/uxnet.c does).

Unfortunately, I'm unable to test this at all as Win98 doesn't have
getaddrinfo(); hopefully I'll be able to find a mug with a modern version
of Windows to check it's not completely broken.

I think the effects of this are mostly cosmetic -- the canonical name is
used for window titles (and some people have been annoyed at the new
behaviour), other displays, and probably also for proxy exclusions.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5614 cda61777-01e9-0310-a592-d414129be87e

19 years agoI always get a lot of personal mail about PuTTY when I send out a
simon [Thu, 7 Apr 2005 12:38:17 +0000 (12:38 +0000)]
I always get a lot of personal mail about PuTTY when I send out a
release announcement, because people reply directly to the
putty-announce mail. I should remember to set a Reply-To header next
time.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5613 cda61777-01e9-0310-a592-d414129be87e

19 years agoOops, forgot to credit Ahmad Khalifa of arabeyes.org for the bidi/shaping work.
jacob [Thu, 7 Apr 2005 12:00:01 +0000 (12:00 +0000)]
Oops, forgot to credit Ahmad Khalifa of arabeyes.org for the bidi/shaping work.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5612 cda61777-01e9-0310-a592-d414129be87e

19 years agoAdd keyboard accelerators for IPv4/IPv6 selections options.
jacob [Thu, 7 Apr 2005 01:42:36 +0000 (01:42 +0000)]
Add keyboard accelerators for IPv4/IPv6 selections options.
(Also for `window_border'.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5610 cda61777-01e9-0310-a592-d414129be87e

19 years agoIf a new session was saved from Change Settings, a side-effect on Windows was
jacob [Thu, 7 Apr 2005 01:36:28 +0000 (01:36 +0000)]
If a new session was saved from Change Settings, a side-effect on Windows was
that the global `sesslist' got out of sync with the saved-sessions submenu,
causing the latter to launch the wrong sessions.

Also, Change Settings wasn't getting a fresh session list, so if the set of
sessions had changed since session startup it wouldn't reflect that (at least
until a session was saved). Fixed (on all platforms).

Therefore, since the global sesslist didn't seem to be useful, I've got rid
of it; config.c creates one as needed, as do the frontends. (Not tried
compiling Mac changes.)

Also, we now build the saved-sessions submenu on demand on Windows and Unix.
(This should probably also be done on the Mac.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5609 cda61777-01e9-0310-a592-d414129be87e

19 years agoIn get_sesslist(), when freeing, set freed members to NULL on general
jacob [Thu, 7 Apr 2005 01:32:41 +0000 (01:32 +0000)]
In get_sesslist(), when freeing, set freed members to NULL on general
principles.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5608 cda61777-01e9-0310-a592-d414129be87e

19 years agoRemove support for the "rijndael256-cbc", "rijndael192-cbc", and
ben [Wed, 6 Apr 2005 23:40:30 +0000 (23:40 +0000)]
Remove support for the "rijndael256-cbc", "rijndael192-cbc", and
"rijndael128-cbc" names for AES.  These are in the IANA namespace, but
never appeared in any secsh-transport draft, and no version of OpenSSH
has supported them without also supporting the aes*-cbc names.

"rijndael-cbc@lysator.liu.se" gets to live because it's in the private
namespace.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5607 cda61777-01e9-0310-a592-d414129be87e

19 years agoImplement SDCTR modes, as defined in the newmodes draft. This adds
ben [Wed, 6 Apr 2005 23:27:08 +0000 (23:27 +0000)]
Implement SDCTR modes, as defined in the newmodes draft.  This adds
aes128-ctr, aes192-ctr, and aes256-ctr.  blowfish-ctr and 3des-ctr are
present but disabled, since I haven't tested them yet.

In addition, change the user-visible names of ciphers (as displayed in the
Event Log) to include the mode name and, in Blowfish's case, the key size.

git-svn-id: svn://svn.tartarus.org/sgt/putty@5605 cda61777-01e9-0310-a592-d414129be87e