1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00
Commit Graph

300 Commits

Author SHA1 Message Date
Simon Tatham
36d125e1d7 Attempt to ensure that everything passed to connection_fatal() is
also logged to the Event Log, so that it's easy to cut-and-paste the
error message afterwards.

[originally from svn r1599]
2002-03-23 18:04:27 +00:00
Simon Tatham
eabd704d1e Justin Bradford's proxy support patch. Currently supports only HTTP
CONNECT, but contains an extensible framework to allow other
proxies. Apparently SOCKS and ad-hoc-telnet-proxy are already
planned (the GUI mentions them already even though they don't work
yet). GUI includes full configurability and allows definition of
exclusion zones. Rock and roll.

[originally from svn r1598]
2002-03-23 17:47:21 +00:00
Simon Tatham
869989e7e6 Pedantic little patch to ensure blank usernames work vaguely as
expected, in case anyone really wants to use one

[originally from svn r1596]
2002-03-20 22:34:00 +00:00
Simon Tatham
dac0d45699 Ensure our network layer is properly cleaned up before PuTTY exits.
Specifically, we explicitly closesocket() all open sockets, which
appears to be necessary since otherwise Windows sends RST rather
than FIN. I'm _sure_ that's a Windows bug, but there we go.

[originally from svn r1574]
2002-03-06 20:13:22 +00:00
Simon Tatham
ae7c314f33 Set SSH socket variable to NULL if connect() fails. Failure to do
this was causing PSCP to hang indefinitely after reporting
Connection Refused.

[originally from svn r1569]
2002-02-27 22:45:52 +00:00
Simon Tatham
84c3ece865 Cisco routers apparently have yet another bug: they can't handle RSA
auth attempts at all without panicking and bombing out. Workaround
added.

[originally from svn r1568]
2002-02-27 22:41:31 +00:00
Simon Tatham
e6cc16b8b2 Add support for sending SSH2_MSG_UNIMPLEMENTED for unrecognised
messages; also do something with the debugging messages sent as
SSH2_MSG_DEBUG.

[originally from svn r1544]
2002-01-10 19:50:53 +00:00
Simon Tatham
46803abdbe Support SSH2_MSG_GLOBAL_REQUEST (just return failure)
[originally from svn r1542]
2002-01-10 16:42:17 +00:00
Simon Tatham
cf8190f637 Extra safety feature to avoid sending SSH2_MSG_WINDOW_ADJUST on
a nonexistent channel. I don't quite know why this was happening,
but whatever it was this ought to fix it.

[originally from svn r1540]
2002-01-10 13:29:43 +00:00
Simon Tatham
d237773599 Add the CRC32 compensation attack detector that all other SSH
clients have had for ages and I forgot about. Of course I've got the
version with the buffer overflow fixed!

[originally from svn r1535]
2002-01-08 11:57:32 +00:00
Simon Tatham
ccf9a051ca I have no brain at all. The SSH1 auth loop was trying all Pageant
keys before _every_ other authentication; so if you tried a local
pubkey _and_ a password, for example, you'd also try Pageant twice.
Now fixed.

[originally from svn r1524]
2001-12-30 16:27:07 +00:00
Simon Tatham
2ce502eae2 PuTTY can now detect when one of the Pageant keys it tries matches
the private key file given in the config; if it spots this then it
avoids trying it again (and in particular avoids needing to ask for
the passphrase when it knows perfectly well it won't work).

[originally from svn r1523]
2001-12-30 16:20:31 +00:00
Simon Tatham
ef885c78ca Add a new back-end function to return the exit code of the remote
process. This is functional in SSH, and vestigial (just returns 0)
in the other three protocols. Plink's Windows exit code is now
determined by the remote process exit code, which should make it
more usable in scripting applications. Tested in both SSH1 and SSH2.

[originally from svn r1518]
2001-12-29 15:31:42 +00:00
Simon Tatham
88a3baa065 Add the remote counterpart for the `local port forwardings accept
connections from outside localhost' switch. Interestingly OpenSSH
3.0 appears to ignore this (though I know it works because ssh.com
3.0 gets it right, and the SSH packet dump agrees that I'm doing the
right thing).

[originally from svn r1496]
2001-12-15 12:15:24 +00:00
Simon Tatham
3ed0d44f16 Retired the #ifdef DUMP_PACKETS stuff in ssh.c because I'm utterly
sick of recompiling to enable packet dumps. SSH packet dumping is
now provided as a logging option, and dumps to putty.log like all
the other logging options. While I'm at it I cleaned up the format
so that packet types are translated into strings for easy browsing.
POSSIBLE SIDE EFFECT: in the course of this work I had to re-enable
the SSH1 packet length checks which it turns out hadn't actually
been active for some time, so it's possible things might break as a
result. If need be I can always disable those checks for the 0.52
release and think about it more carefully later.

[originally from svn r1493]
2001-12-14 14:57:50 +00:00
Simon Tatham
7983d2dd28 Disable username switching between SSH2 auth attempts, and add a
configurable option so users can re-enable the feature _if_ they
know they have an SSH2 server that isn't going to get shirty about
it. Inspired by a spectacular increase in OpenSSH's shirtiness.

[originally from svn r1474]
2001-12-11 21:00:01 +00:00
Simon Tatham
46f2897cf6 Apparently sending DISCONNECT on a normal SSH2 connection close is
actually _less_ polite than just closing the connection, rather than
more polite as I'd believed. So we now just close.

[originally from svn r1468]
2001-12-10 18:12:51 +00:00
Simon Tatham
994bb17c57 Make the nonstandard "des-cbc" cipher disabled by default
[originally from svn r1429]
2001-11-29 22:26:52 +00:00
Simon Tatham
3270c74f9e Configurable TCP_NODELAY option on network connections
[originally from svn r1428]
2001-11-29 21:47:11 +00:00
Simon Tatham
82e7fd0f23 Make keyboard-interactive authentication configurable off. (This is
a stopgap until we get round to a proper authentications preference
list.)

[originally from svn r1426]
2001-11-29 20:34:06 +00:00
Simon Tatham
64df2cd90f Remember to terminate the prompt string in keyboard-interactive
[originally from svn r1425]
2001-11-29 20:27:20 +00:00
Simon Tatham
b49fde9410 Add single-DES support in SSH2
[originally from svn r1396]
2001-11-21 23:06:10 +00:00
Jacob Nevins
dd4bfacd9a Primitive protection against SSH2 not actually agreeing a cipher in
either direction.

[originally from svn r1394]
2001-11-21 22:48:20 +00:00
Simon Tatham
15517300d8 Send SSH2_MSG_NEWKEYS _before_ expecting to receive it, rather than
after. Shouldn't make a difference for any server that previously
worked, but we should now interoperate sensibly with servers that
wait to receive our NEWKEYS before sending their own. Apparently
Unisphere produce one such.

[originally from svn r1390]
2001-11-21 22:06:53 +00:00
Simon Tatham
7530a9905a Handle incoming SSH2_MSG_CHANNEL_REQUEST (by refusing all requests).
Should have done this ages ago; the OpenSSH 3.0 ClientAliveInterval
mechanism requires it so now it's really necessary.

[originally from svn r1380]
2001-11-13 22:06:37 +00:00
Simon Tatham
818176c66f Oops - one missing set of the ssh1 throttling indicator
[originally from svn r1377]
2001-11-10 17:09:17 +00:00
Simon Tatham
f2319456bc Tidy up the SERIOUS NETWORK ERROR fixes
[originally from svn r1345]
2001-10-30 20:57:22 +00:00
Simon Tatham
d1e305543a Tidy up SSH packet-level debugging
[originally from svn r1344]
2001-10-30 20:35:29 +00:00
Simon Tatham
8493e83d74 Add remaining comments to the last checkin (gah, remember to hit
Save in the editor _before_ running cvs commit).

[originally from svn r1333]
2001-10-27 11:06:11 +00:00
Simon Tatham
6c9cdbe29f Update to password length traffic analysis: one Cisco router can
apparently not deal with SSH1_MSG_IGNORE _or_ padded passwords, so
we must fall back to sending an undefended password.

[originally from svn r1332]
2001-10-27 10:39:54 +00:00
Simon Tatham
28292dbc95 `Server got confused by' error messages now quote a packet type, so
I can start debugging as soon as I get one sent to me.

[originally from svn r1304]
2001-09-26 20:29:03 +00:00
Simon Tatham
39c3f9b8bc Fix pasting of newlines in local line editing mode. Possibly not a
very _good_ fix; something might want doing after the release.

[originally from svn r1277]
2001-09-19 20:07:15 +00:00
Simon Tatham
2e4480d6b6 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]
2001-09-18 18:16:56 +00:00
Simon Tatham
7bb4a9f5f0 Be more careful of bombouts at the s_rdpkt level: if these happen
(for example SSH_MSG_DISCONNECT) we should avoid even calling
ssh_protocol.

[originally from svn r1259]
2001-09-09 14:47:29 +00:00
Simon Tatham
b12f450964 Jacob's TIS / CCard authentication tweaks.
[originally from svn r1253]
2001-09-08 12:50:15 +00:00
Simon Tatham
a3bfa43b0f Fix error message: couldn't load _private_ key, not public.
[originally from svn r1251]
2001-09-08 11:57:00 +00:00
Simon Tatham
2e4cefa420 When we receive SSH_MSG_DISCONNECT, say so in an error box because
it's likely to be more helpful than `Strange packet received' or
whatever.

[originally from svn r1250]
2001-09-08 10:33:56 +00:00
Simon Tatham
f08de20a1e Robert de Bath's asynchronous-connect patch. Helps a lot in port
forwarding; improves Event Log; and causes the PuTTY window to
appear earlier in the setup process.

[originally from svn r1239]
2001-09-07 22:39:01 +00:00
Simon Tatham
47e97ae032 Fix gratuitous assertion failure in Plink (ssh1_throttle_count was
being decremented far too many times).

[originally from svn r1238]
2001-09-07 22:04:44 +00:00
Simon Tatham
d1d2fd7a13 D'oh! Putting keyboard-interactive authentication _before_ publickey
causes password login to occur on a server that supports password-
through-k-i. Of course when we use the new preference list mechanism
for selecting the order of authentications this will all become much
more sane, but for the moment I've put publickey back up to the top
and things seem to be happier.

[originally from svn r1220]
2001-08-28 08:43:33 +00:00
Simon Tatham
ea27f048f9 Fix various small compiler warnings, mostly unused local variables
[originally from svn r1218]
2001-08-28 08:08:43 +00:00
Simon Tatham
5c646f3270 Fix handling of SSH2_MSG_CHANNEL_CLOSE, which was breaking in port
forwarding talking to ssh.com's ssh-3.0.1.

[originally from svn r1216]
2001-08-27 16:58:47 +00:00
Simon Tatham
254f50974e Port forwarding bug fix: we were unable to handle receiving
CHANNEL_OPEN_FAILURE messages, which occur when the remote side is
unable to open a forwarded network connection we have requested. (It
seems they _don't_ show up if you get something mundane like
Connection Refused - the channel is cheerfully opened and
immediately slammed shut - but they do if you try to connect to a
host that doesn't even exist. Try forwarding a port to
frogwibbler:4800 and see what you get.)

[originally from svn r1213]
2001-08-27 15:13:14 +00:00
Simon Tatham
ff9a038cdd PSCP now uses the modern SFTP protocol if it can, and falls back to
scp1 if it can't. Currently not very tested - I checked it in as
soon as it completed a successful recursive copy in both directions.
Also, one known bug: you can't specify a remote wildcard, because by
the nature of SFTP we'll need to implement the wildcard engine on
the client side. I do intend to do this (and use the same wildcard
engine in PSFTP as well) but I haven't got round to it yet.

[originally from svn r1208]
2001-08-26 18:32:28 +00:00
Simon Tatham
44c4ee79e6 Jacob's patch for a drag-list to select SSH ciphers. Heavily hacked
by me to make the drag list behaviour slightly more intuitive.
WARNING: DO NOT LOOK AT pl_itemfrompt() IF YOU ARE SQUEAMISH.

[originally from svn r1199]
2001-08-25 19:33:33 +00:00
Simon Tatham
c87fa98d09 Extensive changes that _should_ fix the socket buffering problems,
by ceasing to listen on input channels if the corresponding output
channel isn't accepting data. Has had basic check-I-didn't-actually-
break-anything-too-badly testing, but hasn't been genuinely tested
in stress conditions (because concocting stress conditions is non-
trivial).

[originally from svn r1198]
2001-08-25 17:09:23 +00:00
Simon Tatham
7ff3999e49 Oops - fix that fix :-/
[originally from svn r1197]
2001-08-22 20:23:49 +00:00
Simon Tatham
96fd4be809 Fix to allow more than one challenge/response pair during
keyboard-interactive authentication. UNTESTED except that I checked
it compiles. Will ask for testing from the user who complained.

[originally from svn r1195]
2001-08-22 19:47:05 +00:00
Simon Tatham
24e97a365d Trivial port forwarding fixes from Jacob
[originally from svn r1185]
2001-08-15 18:23:50 +00:00
Simon Tatham
9cbaacd673 Stop yelling about Access Denied if the server refuses even to
attempt keyboard-interactive authentication. We can yell about it if
we make a creditable attempt and are rejected, but if the server
just refuses to even consider it then the user won't really want to
know (and if they do there's the Event Log).

[originally from svn r1180]
2001-08-09 21:22:38 +00:00
Simon Tatham
54bcab760f Port forwarding now works in SSH 2 as well as SSH 1.
[originally from svn r1179]
2001-08-09 21:17:05 +00:00
Simon Tatham
fa6b9c1896 Keyboard-interactive authentication, thanks to Paul Sokolovsky.
[originally from svn r1178]
2001-08-09 20:13:17 +00:00
Simon Tatham
50766ce729 SSH port forwarding! How cool is that?
Only currently works on SSH1; SSH2 should be doable but it's late
and I have other things to do tonight. The Cool Guy award for this
one goes to Nicolas Barry, for doing most of the work and actually
understanding the code he was adding to.

[originally from svn r1176]
2001-08-08 20:44:35 +00:00
Simon Tatham
4fb01728e1 Fix segfault if the server maliciously sends the wrong type of key
after a different type has been agreed.

[originally from svn r1165]
2001-08-04 12:37:43 +00:00
Simon Tatham
a4c1aad9b2 Yet another possible segfault path in the backends fixed. I don't
_believe_ I'm still finding these. I have no idea what I was
thinking when I wrote this stuff.

[originally from svn r1162]
2001-07-31 14:23:21 +00:00
Simon Tatham
fb473cc16c Placate gcc's `-Wall' warnings.
[originally from svn r1121]
2001-05-13 14:02:28 +00:00
Simon Tatham
839353ad3a Control characters are now allowed as part of the password, if
they're not special control characters processed by the line input
routines.

[originally from svn r1116]
2001-05-13 11:44:57 +00:00
Simon Tatham
e45f75a2be Attempt to report the error condition right when an SCP connection
with a pre-supplied password fails to authenticate.

[originally from svn r1114]
2001-05-13 11:15:16 +00:00
Simon Tatham
c2eb57a034 `realhost', passed back from all the backend init functions, was
scoped within those functions. It's now dynamically allocated.

[originally from svn r1108]
2001-05-09 14:01:15 +00:00
Simon Tatham
3730ada5ce Run entire source base through GNU indent to tidy up the varying
coding styles of the various contributors! Woohoo!

[originally from svn r1098]
2001-05-06 14:35:20 +00:00
Simon Tatham
f30937f737 Debugging improvements. Started using Dave Hinton's dmemdump
function (woohoo!), improved that function so it provides an ASCII
dump as well as hex (whee!), removed all remaining spurious \r in
debug statements (ooh!), and made enabling of packet debugging in
SSH a matter of one ifdef rather than lots (phew!).

[originally from svn r1091]
2001-04-28 17:35:18 +00:00
Simon Tatham
76dfe1cac9 Fix completely stupid agent_exists test. (Hint to self: you have to
actually _call_ a boolean-returning function, not just test its
address for nonzerohood.) Thanks Jacob.

[originally from svn r1082]
2001-04-28 11:25:58 +00:00
Simon Tatham
b7844a20af Add some fflushes to make it easier for piped programs to talk to
plink and pscp

[originally from svn r1078]
2001-04-28 08:42:06 +00:00
Simon Tatham
3abea3d4ea Having now compiled the last few days' changes with MSVC, it's turned
up a bunch of warnings, mostly unused variables. All fixed.

[originally from svn r1058]
2001-04-17 08:24:29 +00:00
Simon Tatham
03c9b6107b Replace PuTTY's 2-3-4 tree implementation with the shiny new counted
one, in preparation for using it to speed up scrollback.

[originally from svn r1053]
2001-04-16 17:18:24 +00:00
Simon Tatham
522f130391 Pageant interface changes. You can now do `pageant -c command' to
spawn another command after starting Pageant. Also, if Pageant is
already running, `pageant keyfile' and `pageant -c command' will do
the Right Thing, that is, add the key to the _first_ Pageant and/or
run a command and then exit. The only time you now get the `Pageant
is already running' error is if you try to start the second copy
with no arguments.
NB the affected files in this checkin are rather wide-ranging
because I renamed the not really SSH1-specific
`ssh1_bignum_bitcount' function to just `bignum_bitcount'.

[originally from svn r1044]
2001-04-16 11:16:58 +00:00
Simon Tatham
fb8745a7d7 Log the text message in SSH_MSG_DISCONNECT (both protocols) so that
when people submit Event Logs for diagnosis it's a little easier to
work out what's up.

[originally from svn r1043]
2001-04-16 09:10:34 +00:00
Simon Tatham
36df70978a After we fall back to 3DES, double-check the server really does
support it, and bomb out with a complaint if not.

[originally from svn r1042]
2001-04-16 07:49:11 +00:00
Simon Tatham
1734a09466 Experimental checkin to see if we can prevent multiple closes ever
being sent on an SSH1 forwarding (or indeed primary) channel.

[originally from svn r1037]
2001-04-11 12:29:35 +00:00
Simon Tatham
ab3443b9e6 Fix the detect_bugs routine, which was failing to find the right bit
of the version string :-)

[originally from svn r1026]
2001-03-29 13:40:03 +00:00
Simon Tatham
6a4294fbac Fix the SSH protocol version exchange, which had a weird stack trash
in it which for some reason didn't show up when built with VC++6 but
blew up the nightlies. Should be OK now.

[originally from svn r1023]
2001-03-23 10:28:36 +00:00
Simon Tatham
4d881300c8 Remove the length limit on protocol version strings. (In principle, I
could have got away with upping it to 256, but I didn't want a repeat
of the chaos when some server accidentally breaks that limit too...)

[originally from svn r1019]
2001-03-22 17:32:40 +00:00
Simon Tatham
0cda163a2d Plink in noninteractive-script mode should not show the `Authenticated
with public key' message in SSH2 (it already doesn't in SSH1). It
shouldn't show the login banner either, since its output is probably
redirected to something which will choke on it.

[originally from svn r1011]
2001-03-19 10:27:59 +00:00
Simon Tatham
4b5cda8aaa Add Norman Brandinger's suggested `-m' option in plink, to read the
remote command from a local file. Advantage: you can have more than
one line in it, so you can remotely run what's effectively a small
script.

[originally from svn r1010]
2001-03-19 10:24:55 +00:00
Simon Tatham
c152034706 SSH2 channel fix: received WINDOW_ADJUSTs were always applied to the
primary (shell session) channel, rather than the one they were aimed
at. This _despite_ me having deliberately gone and looked the channel
ID up in the B-tree - I was ignoring the result by accident :-/

X forwarding should now work in SSH2 even on non-trivial clients (ie
things other than xdpyinfo).

[originally from svn r1007]
2001-03-16 12:09:44 +00:00
Simon Tatham
02f012a66a Correct handling of SSH1 protocol flags, in particular
PROTOFLAG_SCREEN_NUMBER, without which OpenSSH 2.5.1 was objecting to
my gratuitous inclusion of a screen number in the SSH1 X forwarding
request. Ahem.

[originally from svn r1006]
2001-03-16 11:58:54 +00:00
Simon Tatham
947d33408f Add support for SSH2 userauth banners. We currently can't deal with
printing them _before_ the username prompt. This apparently isn't very
serious because OpenSSH doesn't _send_ it before the username prompt,
but only in response to USERAUTH_REQUEST "none". Good job we do that!

[originally from svn r1005]
2001-03-15 17:14:31 +00:00
Simon Tatham
080d59422b At long last: PuTTY will now report its version to the server
sensibly, as a release or a snapshot or a local build. With any luck
this should make bug reporting easier to handle, because anyone who
sends their Event Log should automatically include the version :-)

[originally from svn r1003]
2001-03-15 12:15:02 +00:00
Simon Tatham
4b5a97fbee Fix a few trivial compiler warnings
[originally from svn r1001]
2001-03-15 11:39:17 +00:00
Simon Tatham
31d6765aca Bit more robustness when talking to Pageant
[originally from svn r1000]
2001-03-15 11:38:02 +00:00
Simon Tatham
1a9d213a74 Oops - don't invent an X authorisation when doing agent forwarding!
Overenthusiastic c'n'p breaks the world.

[originally from svn r999]
2001-03-15 11:32:23 +00:00
Simon Tatham
c760ef6f83 Fix a segfault on abrupt X connection shutdown.
[originally from svn r998]
2001-03-15 11:19:59 +00:00
Simon Tatham
7b0e082700 Dave Hinton's modifications to the network layer interface, which
should make it possible to add SSL support later.

[originally from svn r996]
2001-03-13 10:22:45 +00:00
Simon Tatham
55659a959f ssh_get_password has become ssh_get_line, so it can handle usernames
as well. This should fix the multiple-reads-on-stdin bug in plink.

[originally from svn r994]
2001-03-12 15:31:53 +00:00
Simon Tatham
9ee21069b5 Zero length passwords no longer cause an assertion failure :-)
[originally from svn r993]
2001-03-12 15:12:33 +00:00
Simon Tatham
d823077f18 Add support for using Diffie-Hellman with short exponents (sshdh.c
contains a reference to a paper on the subject). Reduces time taken
for DH group exchange to the point where it's viable to enable it
all the time, so I have. :-)

[originally from svn r991]
2001-03-10 11:04:07 +00:00
Simon Tatham
630a9a628f Having introduced a new function into the SSH2 compression structure,
it would help if I implemented it in the dummy no-compression case!

[originally from svn r987]
2001-03-08 10:07:22 +00:00
Simon Tatham
a34ef3df55 Introduce the ability to distinguish remote SSH implementations by
their version strings and enable bug compatibility modes.

[originally from svn r985]
2001-03-06 10:32:28 +00:00
Simon Tatham
48c0729310 Update a couple of messages to be clearer to users who don't have
access to complete documentation (ie all of them at the moment :-)

[originally from svn r984]
2001-03-06 09:29:43 +00:00
Simon Tatham
aaeecbb4ea Make the SSH2 traffic analysis defence robust in the face of Zlib
compression. This involves introducing an option to disable Zlib
compression (that is, continue to work within the Zlib format but
output an uncompressed block) for the duration of a single packet.

[originally from svn r982]
2001-03-05 16:38:42 +00:00
Simon Tatham
a1d5dab580 Further traffic analysis defences
[originally from svn r981]
2001-03-05 10:32:36 +00:00
Simon Tatham
16f4ffe616 Implement OpenSSH's private agent forwarding extension. I believe we
now interoperate with OpenSSH/SSH2 to _exactly_ the same level as we
interoperate with SSH1. Which is pretty cool really.

[originally from svn r980]
2001-03-03 16:38:44 +00:00
Simon Tatham
de1c70a5d4 Remove a spurious \r\n from an Event Log message
[originally from svn r978]
2001-03-03 16:05:52 +00:00
Simon Tatham
245cf9c8c9 SSH2 can now use Pageant to obtain keys from
[originally from svn r977]
2001-03-03 15:56:39 +00:00
Simon Tatham
deccfaa3ef The authentication diagnostics in SSH2 should now be better.
Additionally, the ability to switch usernames if you mistype the
first one has been restored (although it didn't actually work
because OpenSSH didn't feel like playing; patch submitted :-).

[originally from svn r975]
2001-03-03 13:53:44 +00:00
Simon Tatham
28b1fc766c Preliminary support for RSA user authentication in SSH2! Most of the
error messages are currently wrong, and Pageant doesn't yet support
the new key type, and I haven't thoroughly tested that falling back
to password authentication and trying invalid keys etc all work. But
what I have here has successfully performed a public key
authentication, so it's working to at least some extent.

[originally from svn r973]
2001-03-03 11:54:34 +00:00
Simon Tatham
97ace7d80d Added support for RSA host keys (not user keys yet)
[originally from svn r969]
2001-03-02 17:13:36 +00:00
Simon Tatham
b182356f99 Support for selecting AES from the GUI. In the process, I've had to
introduce another layer of abstraction in SSH2 ciphers, such that a
single `logical cipher' (as desired by a user) can equate to more
than one `physical cipher'. This is because AES comes in several key
lengths (PuTTY will pick the highest supported by the remote end)
and several different SSH2-protocol-level names (aes*-cbc,
rijndael*-cbc, and an unofficial one rijndael-cbc@lysator.liu.se).

[originally from svn r967]
2001-03-02 13:55:23 +00:00
Simon Tatham
bf25fd405c Add AES support in SSH2. Not yet complete: there's no way to select
it in the GUI (or even in the registry).

[originally from svn r966]
2001-03-02 11:44:35 +00:00
Simon Tatham
cc9d7ba87e Diffie-Hellman group exchange in SSH2. Currently #ifdeffed out
(change the sense of #ifdef DO_DIFFIE_HELLMAN_GEX in ssh.c) because
it's _far_ too slow. Will be re-enabled once the bignum routines
work a bit faster (or rather a _lot_ faster).

[originally from svn r962]
2001-03-01 17:55:40 +00:00
Simon Tatham
f72b5aa95f Remove the last lingering knowledge, outside sshbn.c, of the
internal structure of the Bignum type. Bignum is now a fully opaque
type unless you're inside sshbn.c.

[originally from svn r960]
2001-03-01 17:41:26 +00:00
Simon Tatham
39cf689fd6 psftp now works as part of the PuTTY suite
[originally from svn r940]
2001-02-24 16:08:56 +00:00
Simon Tatham
5cdfd67cd1 Add a traffic analysis defence to SSH2 password authentication
[originally from svn r936]
2001-02-23 13:15:17 +00:00
Simon Tatham
8a4206e636 Attempt to fix the remaining key re-exchange bug
[originally from svn r934]
2001-02-20 13:55:59 +00:00
Simon Tatham
60585cff9c Yet another attempt at OOB handling in the network abstraction. This
version allows you to specify, per socket, which sockets receive OOB
data in-line (so that you know what was before the mark and what was
after) and which receive it out of line (so it's really a one-byte
out-of-band facility rather than discard-to-mark). This reflects the
fact that rlogin appears to make more sense in the latter mode, and
telnet in the former. This patch makes rlogin work right for me.

[originally from svn r921]
2001-02-01 14:11:04 +00:00
Simon Tatham
362d3deaf1 Prevent duplicate sk_close() calls on the same socket when the
connection dies unexpectedly (CONNABORTED / CONNRESET)

[originally from svn r910]
2001-01-29 14:30:59 +00:00
Simon Tatham
6017418fca Remove a segfault in bombout() macro: don't sk_close() the socket if
it's already NULL. The `Incorrect MAC' problem was causing
ssh2_rdpkt to bombout(), setting s to NULL, and then a secondary
bombout() was happening at the next level up, causing a segfault.

[originally from svn r909]
2001-01-29 13:19:59 +00:00
Simon Tatham
65b47c59c6 Fix the SSH2 key re-exchange bug. Session id != exchange hash,
because the session id is the exchange hash from the _first_ key
exchange, so in subsequent key exchanges they're different.

[originally from svn r901]
2001-01-26 18:50:13 +00:00
Simon Tatham
62a76699ad Ensure all backends _remember_ the connection has closed after
receiving a network error. Should prevent the cascading-error-box
bug.

[originally from svn r900]
2001-01-26 12:22:16 +00:00
Simon Tatham
7a79df8fe6 Rethink the whole line discipline architecture. Instead of having
multiple switchable line disciplines, we now have a single unified
one which changes its behaviour based on option settings. Each
option setting can be suggested by the back end and/or the terminal
handler, and can be forcibly overridden by the configuration. Local
echo and local line editing are separate, independently switchable,
options.

[originally from svn r895]
2001-01-24 14:08:20 +00:00
Simon Tatham
89505459e3 Improve socket error handling so that a socket error isn't an
automatic fatalbox(). Instead, the error is passed to the receiver
routine, which can decide just how fatal the problem really is.

[originally from svn r894]
2001-01-24 10:11:18 +00:00
Simon Tatham
1eb0308ad7 Remove the entirely pointless fourth parameter from x11_init().
[originally from svn r889]
2001-01-23 11:02:02 +00:00
Simon Tatham
83066d174c Bring the SSH2 channel architecture up to scratch, enabling X
forwarding to work under SSH2. Also - surprise! - implement X
forwarding under SSH2.

[originally from svn r882]
2001-01-22 15:36:07 +00:00
Simon Tatham
4a339ef430 Add X11 forwarding, mainly thanks to Andreas Schultz
[originally from svn r878]
2001-01-22 11:34:52 +00:00
Simon Tatham
ca90be26a8 Experimental Rlogin support, thanks to Delian Delchev. Local flow
control is unsupported, and server-to-client comms may fail for want
of working TCP Urgent.

[originally from svn r875]
2001-01-19 10:10:37 +00:00
Simon Tatham
e364010d4f Trivial fix for when the two directions select different encryption
algorithms

[originally from svn r869]
2001-01-17 16:57:15 +00:00
Simon Tatham
43dff68308 Oops - accidentally undid rev 1.82 [r844]
[originally from svn r853]
[r844 == eac718ee1b]
2001-01-09 17:16:43 +00:00
Simon Tatham
609593e119 Ensure ssh specials (EOF and PING) don't occur except in connection
states where they're meaningful. In case Plink misses an EOF by
attempting to send it before reaching SSH_STATE_SESSION, it is
buffered and sent later. PINGs can be sent during any part of the
initialisation phase _except_ before deciding whether to use
protocol 1 or 2.

[originally from svn r850]
2001-01-08 13:57:45 +00:00
Simon Tatham
eac718ee1b Adam D Ligas's segfault: one form of connection closure was failing
to set SSH_STATE_CLOSED, causing subsequent resize events to go foom.

[originally from svn r844]
2001-01-07 17:18:12 +00:00
Simon Tatham
7a580aa4d8 Attempt to get repeated key exchange working in SSH2. Still under
test - might not be 100%. I think it _ought_ to work though.

[originally from svn r826]
2000-12-18 09:20:08 +00:00
Simon Tatham
c34ff1bcbf Fix an intermittent segfault that prevented the new Zlib compression
from being very useful. (Thanks to Minefield for catching it.)

[originally from svn r820]
2000-12-12 11:07:59 +00:00
Simon Tatham
d5240d4157 Make memory management uniform: _everything_ now goes through the
smalloc() macros and thence to the safemalloc() functions in misc.c.
This should allow me to plug in a debugging allocator and track
memory leaks and segfaults and things.

[originally from svn r818]
2000-12-12 10:33:13 +00:00
Simon Tatham
8eca227b92 Improve SSH2 host key abstraction into a generic `signing key'
abstraction, so as to be able to re-use the same abstraction for
user authentication keys and probably in the SSH2 agent (when that
happens) as well.

[originally from svn r815]
2000-12-02 12:48:15 +00:00
Simon Tatham
6bdd92be5f Fix bugtraq 1949: server could open an agent forwarding channel even
if agent forwarding had not been negotiated on, and more
particularly even if it had been deliberately disabled by the user.

[originally from svn r814]
2000-12-02 11:43:25 +00:00
Simon Tatham
d094883d3c Fix segfault when you press a key before the SSH protocol decides whether
it's doing SSH1 or SSH2. Only visible on slow servers :-)

[originally from svn r803]
2000-11-21 10:53:10 +00:00
Simon Tatham
462063cdc5 Implement Zlib compression, in both SSH1 and SSH2.
[originally from svn r792]
2000-11-01 21:34:21 +00:00
Simon Tatham
696400a672 Stop the "Sent username %s" message coming up twice in pscp -v
[originally from svn r772]
2000-10-27 09:24:32 +00:00
Simon Tatham
2c9c817895 Misc bugfixes
[originally from svn r771]
2000-10-27 09:17:19 +00:00
Simon Tatham
eab981fbd1 Format SSH2_MSG_DISCONNECT correctly (with reason code, reason
string, and language tag).

[originally from svn r770]
2000-10-26 13:10:47 +00:00
Simon Tatham
809bd81d5c Fix another bignum formatting problem. This one hit Diffie-Hellmann
[originally from svn r761]
2000-10-24 21:43:39 +00:00
Simon Tatham
5ff9cc2f1f SSH2 connections weren't closing cleanly after socket revamp. Fixed.
[originally from svn r754]
2000-10-24 09:55:45 +00:00
Simon Tatham
039103ff5d Window resizing wasn't working in SSH2
[originally from svn r753]
2000-10-24 09:49:03 +00:00
Simon Tatham
bbbda4110b Created a shiny new abstraction for the socket handling. Has many
advantages:
 - protocol modules can call sk_write() without having to worry
   about writes blocking, because blocking writes are handled in the
   abstraction layer and retried later.
 - `Lost connection while sending' is a thing of the past.
 - <winsock.h> is no longer needed in most modules, because
   "putty.h" doesn't have to declare `SOCKET' variables any more,
   only the abstracted `Socket' type.
 - select()-equivalent between multiple sockets will now be handled
   sensibly, which opens the way for things like SSH port
   forwarding.

[originally from svn r744]
2000-10-23 10:32:37 +00:00
Simon Tatham
e32603347c Introduce a sane interface function, from_backend(), for backends to
use when they have data from the network. Replaces the utterly daft
inbuf / inbuf_head / term_out() interface, which only made sense
when feeding to terminal.c. (terminal.c now implements
from_backend() as a small function that gateways to the old
interface.)

As a side effect, from_backend() also has an `is_stderr' parameter,
so scp can once again separate the server's pronouncements on stderr
from the actual protocol progress on stdout.

[originally from svn r729]
2000-10-20 13:51:46 +00:00
Simon Tatham
8d0bee8629 PuTTYgen initial version. Still to do are basic user-friendliness
features (prompt for passphrase twice, prompt before overwriting a
file, check the key file was actually saved OK), testing of the
generated keys to make sure I got the file format right, and support
for a variable key size. I think what's already here is basically
sound though.

[originally from svn r715]
2000-10-19 15:43:08 +00:00
Simon Tatham
f543b08ca5 Add some more commented-out diagnostics for ssh1
[originally from svn r713]
2000-10-18 15:33:05 +00:00
Simon Tatham
95697270b5 Implement MD5 MAC for the benefit of old SSH2 servers
[originally from svn r709]
2000-10-12 14:24:58 +00:00
Simon Tatham
fd3e15f328 Miscellaneous fixes for better interoperation with commercial SSH 2
[originally from svn r708]
2000-10-12 13:34:46 +00:00
Simon Tatham
3e83d75154 Add a config option to emulate the HMAC bug in commercial SSH v2.3.x
and earlier (namely, it uses only 16 bytes of key rather than 20).

[originally from svn r706]
2000-10-12 12:39:44 +00:00
Simon Tatham
fd5588d087 Robert de Bath's big patch:
- cope with strange WinSock wrappers not supporting SIOCATMARK
  - define yet more terminal compatibility modes
  - support UK-ASCII (just like US-ASCII but # is a sterling sign)
  - support connection keepalives at a configurable interval

[originally from svn r692]
2000-10-09 12:53:32 +00:00
Simon Tatham
8c169b0c6d Tighten up use of "static" throughout. Module-internal things should NOT
be exported willy-nilly. It encourages people to use them.

[originally from svn r677]
2000-10-06 11:42:30 +00:00
Simon Tatham
9a9bd54197 Store default port number in each back end
[originally from svn r669]
2000-10-04 14:35:15 +00:00
Simon Tatham
a4a9ccc70b Further restructuring
[originally from svn r657]
2000-09-29 15:56:33 +00:00
Simon Tatham
bfec52c1c9 Fix ssh2 after the rev 1.54 [r649] reorg broke it
[originally from svn r656]
[r649 == 960c03468d]
2000-09-29 15:53:59 +00:00
Simon Tatham
0a1fe7a9af Make sure a locally entered login name still comes up in the pw prompt
[originally from svn r653]
2000-09-29 12:04:42 +00:00
Simon Tatham
0e9b76540b Add -pw and -P options, and usage/version message, to plink
[originally from svn r650]
2000-09-29 08:56:30 +00:00
Simon Tatham
960c03468d Minor restructuring to ssh.c in preparation for portability drive
[originally from svn r649]
2000-09-29 08:43:47 +00:00
Simon Tatham
087f33eb71 While we're doing a hostkey reorg, store port numbers as well
[originally from svn r643]
2000-09-28 08:37:10 +00:00
Simon Tatham
aad0a52dfb Rationalised host key storage. Also started code reorg: persistent-state
routines have been moved out into a replaceable module winstore.c.

[originally from svn r639]
2000-09-27 15:21:04 +00:00
Simon Tatham
0fed43e9f4 Remove the special hooks in ssh.c for pscp. pscp now uses the standard
interface to the outside of the ssh module. This means pscp now works
without change in SSH2.

[originally from svn r638]
2000-09-27 09:36:39 +00:00