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

557 Commits

Author SHA1 Message Date
Simon Tatham
a326264500 Two small memory leaks, also noticed by Martin Prikryl.
[originally from svn r3752]
2004-01-21 19:41:34 +00:00
Simon Tatham
b424ea234f Martin Prikryl points out that need_pw may be used uninitialised.
[originally from svn r3751]
2004-01-21 19:33:48 +00:00
Simon Tatham
33a59e78f1 Memory management fixes. Fixed a segfault in SSH1 compression
cleanup noticed by Gerhard Wiesinger, and also fixed some memory
leaks spotted by valgrind while debugging same.

[originally from svn r3726]
2004-01-18 09:14:41 +00:00
Simon Tatham
c53056f95c Joe Yates's memory leak patch was overenthusiastically freeing
things; it called freebn on the DH gex values even if DH gex had not
taken place. Bug was trivially reproducible as a NULL-dereference
segfault by making any SSH2 connection with DH gex disabled. Should
now be fixed.

[originally from svn r3678]
2004-01-01 16:42:48 +00:00
Simon Tatham
7a1eae7ff2 Joe Yates's memory leak patches.
[originally from svn r3650]
2003-12-19 12:44:46 +00:00
Simon Tatham
f9f6763a0e Trivial braino in parsing of the port forwarding config data. Was
causing all port forwardings after the first dynamic one to be
ignored.

[originally from svn r3572]
2003-11-22 14:50:57 +00:00
Jacob Nevins
eebc7529ed Work towards wish `keyfile-diagnostic'. Many sshpubk.c keyfile-loading
functions have sprouted `**errorstr' arguments, which if non-NULL can
return a textual error message. The interface additions are patchy and
ad-hoc since this seemed to suit the style of the existing interfaces.

I've since realised that most of this is masked by sanity-checking that
gets done before these functions are called, but it will at least report
MAC failures and the like (tested on Unix), which was the original point
of the exercise.

Note that not everyone who could be using this information is at the
moment.

[originally from svn r3430]
2003-08-29 22:52:57 +00:00
Jacob Nevins
92db92af5a Control of 'addr' is now handed over to {platform_,}new_connection() and
sk_new() on invocation; these functions become responsible for (eventually)
freeing it. The caller must not do anything with 'addr' after it's been passed
in. (Ick.)

Why:
A SOCKS5 crash appears to have been caused by overzealous freeing of
a SockAddr (ssh.c:1.257 [r2492]), which for proxied connections is
squirreled away long-term (and this can't easily be avoided).

It would have been nice to make a copy of the SockAddr, in case the caller has
a use for it, but one of the implementations (uxnet.c) hides a "struct
addrinfo" in there, and we have no defined way to duplicate those. (None of the
current callers _do_ have a further use for the SockAddr.)

As far as I can tell, everything _except_ proxying only needs addr for the
duration of the call, so sk_addr_free()s immediately. If I'm mistaken, it
should at least be easier to find the offending free()...

[originally from svn r3383]
[r2492 == bdd6633970]
2003-08-07 16:04:33 +00:00
Jacob Nevins
d534d4e104 Add SSH-1 password camouflage bug detection for version OSU_1.4alpha3 of the
OSU VMS SSH server <http://kcgl1.eng.ohio-state.edu/~jonesd/ssh/>.

The changelog appears to indicate that the server was fixed for pwplain1 at
1.5alpha4, and for IGNORE and DEBUG messages at 1.5alpha6. However I'm going
to go on the reports we've had as I haven't tested this; and they indicate
only that 1.5alpha6 is known not to require any bug compatibility modes.

(I wasn't sure whether to add this at all, given that upgrading to version
OSU_1.5alpha6 is an easy way to fix the problem. However, there is precedent
for adding detection for old versions of servers which have since been fixed.)

[originally from svn r3359]
2003-07-12 13:45:21 +00:00
Simon Tatham
d02ea52abc Fix a segfault (non-security-critical - null dereference for
reading) in the zlib code when fed certain kinds of invalid data. As
a result, ssh.c now needs to be prepared for zlib_decompress_block
to return failure.

[originally from svn r3306]
2003-06-26 13:41:30 +00:00
Ben Harris
3006ebf15c Fix a couple of memory leaks pointed out by Adam Bernstein.
[originally from svn r3262]
2003-06-14 18:27:10 +00:00
Jacob Nevins
e955cc77ce Add exceptions for "VShell" to the ssh.com bug compatibility modes (which are
just numbers) in an attempt to fix `vshell-no-bug-compat'.
Not even tested a little bit.

[originally from svn r3219]
2003-05-24 19:03:34 +00:00
Simon Tatham
06e6997a74 Rename crc32() to crc32_compute(), to avoid clashing catastrophically
with the crc32() function in the zlib interface. (Not that PuTTY
itself _uses_ zlib, but on Unix it's linked against libgtk which
uses libpng which uses zlib. And zlib has poor namespace management
so it defines this ridiculously intrusive function name. Arrrrgh.)

[originally from svn r3191]
2003-05-13 18:23:43 +00:00
Ben Harris
ead3dee597 Make ssh_agent_callback() and ssh_agentf_callback() static.
[originally from svn r3182]
2003-05-10 12:54:29 +00:00
Simon Tatham
6bb121ecb9 Colin's const-fixing Patch Of Death. Seems to build fine on Windows
as well as Unix, so it can go in.

[originally from svn r3162]
2003-05-04 14:18:18 +00:00
Simon Tatham
0bfe876b57 Colin's and my fixes to connection_fatal().
[originally from svn r3161]
2003-05-04 14:14:10 +00:00
Simon Tatham
f6a208fbdd First half of `pageant-async' work. agent_query() is now passed a
callback function; it may return 0 to indicate that it doesn't have
an answer _yet_, in which case it will call the callback later on
when it does, or it may return 1 to indicate that it's got an answer
right now. The Windows agent_query() implementation is functionally
unchanged and still synchronous, but the Unix one is async (since
that one was really easy to do via uxsel). ssh.c copes cheerfully
with either return value, so other ports are at liberty to be sync
or async as they choose.

[originally from svn r3153]
2003-04-28 11:41:39 +00:00
Simon Tatham
1f9c9bb00f The new ssh_do_close() function itself causes a segfault if the
connection goes foom before ssh->channels is set up. Oops. Fixed.

[originally from svn r3141]
2003-04-25 17:44:09 +00:00
Simon Tatham
2a0fff2451 Robustness in the face of sudden connection closures: we now make a
credible effort to shut down open forwardings cleanly when the
owning SSH connection terminates abruptly (for whatever reason).

[originally from svn r3137]
2003-04-25 11:48:24 +00:00
Simon Tatham
041dcfd83d Unix makefile now uses -O2, which massively cuts down key exchange
time. This gives rise to a whole bunch of spare warnings, one or two
of which might have been actual bugs; now all resolved.

[originally from svn r3134]
2003-04-23 13:48:09 +00:00
Simon Tatham
717fd50963 Oops; we _do_ need to set dport even when doing dynamic forwarding,
because otherwise the `if (sport && dport)' statement runs the risk
of not working.

[originally from svn r3129]
2003-04-18 09:06:11 +00:00
Simon Tatham
a9c8e035dd Fix obvious foulup in X forwarding: my recent `how did this ever
work' change to port forwarding completely broke it, by failing to
set peeraddr{,len} before reading them. Oops.

[originally from svn r3127]
2003-04-18 09:00:16 +00:00
Simon Tatham
65fab07ad0 Remote-to-local port forwarding in SSH2 was apparently completely
broken! We were expecting the peer address/port in the incoming
packet _before_ the connected address/port, which is just wrong. I
wonder how I managed to mess that up.

[originally from svn r3083]
2003-04-09 11:19:39 +00:00
Simon Tatham
8a3ff2bf3e Dynamic port forwarding by means of a local SOCKS server. Fully
supports SOCKS 4, SOCKS 4A and SOCKS 5 (well, actually IPv6 in SOCKS
5 isn't supported, but it'll be no difficulty once I actually get
round to it). Thanks to Chas Honton for his `stone soup' patch: I
didn't end up actually using any of his code, but it galvanised me
into doing it properly myself :-)

[originally from svn r3055]
2003-04-05 11:45:21 +00:00
Simon Tatham
3bd0415579 Turned the old `Telnet Command' System-submenu into a more general
`Special Command' menu, in which any backend can place its own list
of magical things the user might want to ask the backend to do. In
particular I've implemented the recently proposed "break" extension
in SSH2 using this mechanism.
NB this checkin slightly breaks the Mac build, since it needs to
provide at least a stub form of update_specials_menu().

[originally from svn r3054]
2003-04-04 20:21:05 +00:00
Simon Tatham
09ba8ca111 Make sure the socket is closed properly in the various SSH exit paths.
[originally from svn r3037]
2003-03-31 13:15:51 +00:00
Simon Tatham
b044c350f4 Ahem; fix `bombout' so it passes the correct frontend handle to
connection_fatal().

[originally from svn r3030]
2003-03-31 11:22:30 +00:00
Ben Harris
3e4386d810 In a couple of places, snewn() was being asked for an array of char which was
then assigned to an unsigned char * variabe.  This fixes that.

[originally from svn r3023]
2003-03-29 23:05:36 +00:00
Simon Tatham
d36a4c3685 Introduced wrapper macros snew(), snewn() and sresize() for the
malloc functions, which automatically cast to the same type they're
allocating the size of. Should prevent any future errors involving
mallocing the size of the wrong structure type, and will also make
life easier if we ever need to turn the PuTTY core code from real C
into C++-friendly C. I haven't touched the Mac frontend in this
checkin because I couldn't compile or test it.

[originally from svn r3014]
2003-03-29 16:14:26 +00:00
Simon Tatham
cbb126917f While I'm adding explanatory comments by the coroutine macros, it
occurs to me that would also be a good place to put a copy of the
instructions for disabling Edit and Continue debugging. Nobody
_actually_ reads the README, after all...

[originally from svn r2935]
2003-03-14 21:20:32 +00:00
Simon Tatham
9890c7a57a I've been meaning to get round to this for _ages_: in front of my
coroutine macros, I now include a comment linking to my web article
that explains what they do.

[originally from svn r2902]
2003-03-03 16:35:45 +00:00
Simon Tatham
8aa463b7a1 In merging the username and password input functions I inadvertently
removed the support for control characters in passwords. Replaced.

[originally from svn r2900]
2003-02-28 20:28:03 +00:00
Ben Harris
01105493cc Work around an SC bug that causes it to try to use the same register for
two purposes in s_wrpkt_prepare().  This makes SSH1 work on 68K Macs, at
least until I deactivate the terminal window...

[originally from svn r2876]
2003-02-23 00:13:17 +00:00
Jacob Nevins
2bb23257f2 Fix `ssh2.0.11-keyderive-nonbug' on the strength of Ben's analysis.
Not tested it myself.

[originally from svn r2861]
2003-02-18 20:10:24 +00:00
Simon Tatham
be9718cb13 Add another bug workaround, this one for old OpenSSH (<2.3) servers
which have a strange idea of what data should be signed in a PK auth
request. This actually got in my way while doing serious things at
work! :-)

[originally from svn r2800]
2003-02-04 13:02:51 +00:00
Simon Tatham
b83b9fad77 Further fallout from the introduction of the Filename type. (Memo to
self: if you change the type of a variable and everything compiles
without type-checking errors, that doesn't mean it's all fixed,
because variadic functions aren't type-checked! Oops.)

[originally from svn r2799]
2003-02-04 13:00:54 +00:00
Simon Tatham
bd16b29a7a Oops, Ben is quite right about the rather appalling design of
filename_from_str. Here's a better fix, with some const
repercussions too.

[originally from svn r2768]
2003-02-01 17:24:27 +00:00
Simon Tatham
f26b7aa0d3 Created new data types Filename' and FontSpec', intended to be
opaque to all platform-independent modules and only handled within
per-platform code. `Filename' is there because the Mac has a magic
way to store filenames (though currently this checkin doesn't
support it!); `FontSpec' is there so that all the auxiliary stuff
such as font height and charset and so on which is needed under
Windows but not Unix can be kept where it belongs, and so that I can
have a hope in hell of dealing with a font chooser in the forthcoming
cross-platform config box code, and best of all it gets the horrid
font height wart out of settings.c and into the Windows code where
it should be.
The Mac part of this checkin is a bunch of random guesses which will
probably not quite compile, but which look roughly right to me.
Sorry if I screwed it up, Ben :-)

[originally from svn r2765]
2003-02-01 12:54:40 +00:00
Simon Tatham
6aa4211f6e Remove all `enum'-typed variables from the Config structure.
Everything in there which is integral is now an actual int, which
means my forthcoming revamp of the config box will be able to work
with `int *' pointers without fear of doom.

[originally from svn r2733]
2003-01-27 18:02:24 +00:00
Ben Harris
eaf6cce661 Remove stray debugging code that got in with the last commit.
[originally from svn r2650]
2003-01-18 22:02:22 +00:00
Ben Harris
35f3ef5cc9 Clear kex_ctx in a new session so we can safely free an ssh session without
one.

[originally from svn r2649]
2003-01-18 21:56:33 +00:00
Ben Harris
694aafa071 Add the ability to close sessions. This adds *_free() functions to most
areas of the code.  Not all back-ends have been tested, but Telnet and SSH
behave reasonably.

Incidentally, almost all of this patch was written through Mac PuTTY,
admittedly over a Telnet connection.

[originally from svn r2615]
2003-01-15 23:30:21 +00:00
Simon Tatham
952857fca3 proxy.c now no longer refers to `cfg'. Instead, each of the three
proxy-indirection network functions (name_lookup, new_connection,
new_listener) takes a `const Config *' as an argument, and extracts
enough information from it before returning to handle that
particular network operation in accordance with the proxy settings
it specifies. This involved {win,ux}net.c due to a `const'
repercussion.

[originally from svn r2567]
2003-01-12 15:26:10 +00:00
Simon Tatham
5ecbac2441 There's no real need for portfwd.c to reference `cfg' directly, when
it only needs one item from it and that can easily be passed in from
the call site in ssh.c.

[originally from svn r2564]
2003-01-12 14:56:19 +00:00
Simon Tatham
f49c8c5a07 The back ends now contain their own copies of the Config structure,
and have a function to pass in a new one. (Well, actually several
back ends don't actually bother to do this because they need nothing
out of Config after the initial setup phase, but they could if they
wanted to.)

[originally from svn r2561]
2003-01-12 14:48:29 +00:00
Simon Tatham
fee1624c69 Support for XDM-AUTHORIZATION-1 at the SSH server end, making use of
the remote IP/port data provided by the server for forwarded
connections. Disabled by default, since it's incompatible with SSH2,
probably incompatible with some X clients, and tickles a bug in
at least one version of OpenSSH.

[originally from svn r2554]
2003-01-12 14:11:38 +00:00
Simon Tatham
ee54789b25 Yet _another_ `received data for nonexistent channel' bug. This time
it was because we received WINDOW_ADJUST on a channel we'd already
sent CLOSE on, and reflexively attempted to continue sending the
buffered data in response. Should now be fixed.

[originally from svn r2539]
2003-01-11 10:05:29 +00:00
Simon Tatham
86977efa81 Introduce framework for authenticating with the local X server.
Windows and Mac backends have acquired auth-finding functions which
do nothing; Unix backend has acquired one which actually works, so
Plink can now do X forwarding believably.
(This checkin stretches into some unlikely parts of the code because
there have been one or two knock-on effects involving `const'. Bah.)

[originally from svn r2536]
2003-01-10 18:33:35 +00:00
Simon Tatham
10c1d43ac6 Yikes! Forgot to zero the password after SSH2 PW authentication.
[originally from svn r2512]
2003-01-09 17:33:49 +00:00
Ben Harris
40493b20ea Use '\012' as the end of the SSH banner line, not '\n'.
Mac compilers default to making '\n' == '\015'.

[originally from svn r2493]
2003-01-07 23:05:12 +00:00
Ben Harris
bdd6633970 Initialise the "protocol" field of a new ssh_tag to NULL so Bad Things don't
happen if we try to type things before the SSH banner has been received.

[originally from svn r2492]
2003-01-07 22:45:12 +00:00
Ben Harris
88b1506298 Make ssh1_pkt_type(), ssh2_pkt_type, logeventf(), setup_userpass_input(),
process_userpass_input(), and ssh_unthrottle() static, since they're not
referenced outside this file.

[originally from svn r2475]
2003-01-05 23:01:43 +00:00
Ben Harris
3f055f22d8 Move x11fwd and portfwd prototypes from ssh.c into ssh.h so they can be seen
by (and checked against) the definitions.

[originally from svn r2474]
2003-01-05 22:53:23 +00:00
Ben Harris
7c37547df8 Deal with "possible unintended assignment" warnings.
[originally from svn r2461]
2003-01-05 13:46:13 +00:00
Ben Harris
b91ae87c78 Attack char * vs unsigned char * conversions. In most cases, I've just
gone for replacing the implicit casts with explicit ones.  Where there was
something obviously better that I could do, I've done it, though.

[originally from svn r2460]
2003-01-05 13:43:02 +00:00
Simon Tatham
368ead15bc Propagate the screen number from a local X display to the remote
forwarded one. Fixes `x11-default-screen'.

[originally from svn r2418]
2003-01-02 10:41:22 +00:00
Simon Tatham
6c34f06a71 Move the stderr output of event log messages in verbose mode to the
general logging module rather than localising it in ssh.c. This
means it should work in other protocols as well (notably Telnet,
where it might actually be useful for debugging negotiations).

[originally from svn r2360]
2002-12-19 14:24:28 +00:00
Simon Tatham
7f7e3f539c logeventf() shouldn't throw stuff at stderr, since it invokes the
ssh.c logevent _macro_ which has already done so! Duhh.

[originally from svn r2356]
2002-12-19 11:51:42 +00:00
Simon Tatham
a564ad3140 Support for doing DNS at the proxy end. I've invented a new type of
SockAddr, which just contains an unresolved hostname and is created
by a stub function in *net.c. It's an error to pass this to most of
the real-meat functions in *net.c; these fake addresses should have
been dealt with by the time they get down that far. proxy.c now
contains name_lookup(), a wrapper on sk_namelookup() which decides
whether or not to do real DNS, and the individual proxy
implementations each deal sensibly with being handed an unresolved
address and avoid ever passing one down to *net.c.

[originally from svn r2353]
2002-12-18 16:23:11 +00:00
Simon Tatham
99b870dbc6 Implement `portfwd-loopback-choice'. Works on local side in Unix as
well, though it's a lot less useful since you still can't bind to
low-numbered ports of odd loopback IPs. Should work in principle for
SSH2 remote forwardings as well as local ones, but OpenSSH seems
unwilling to cooperate.

[originally from svn r2344]
2002-12-18 11:39:25 +00:00
Simon Tatham
8cb52a26e1 BUG_SSH2_DERIVEKEY is apparently only present in SSH 2.0.11 and
before, not in 2.0.13. Verified on at least one host. Fixes bug
`ssh2-keyderive-nonbug'.

[originally from svn r2342]
2002-12-18 10:06:38 +00:00
Simon Tatham
29b0705961 logeventf()'s first argument is ssh, not ssh->frontend! This is what
I get for making the latter a `void *' - type checking deserts me in
my hour of need. Should fix Andrey Borzenkov's bug.

[originally from svn r2340]
2002-12-18 09:47:20 +00:00
Jacob Nevins
4ffd0ca9d1 Modify bug-compatibility checks to use wildcards. Should have exactly the
same behaviour as before (tested a little bit), but should be easier to
expand.
(This is the easy bit -- work still needs to be done to fix
ssh2-keyderive-nonbug, vshell-no-bug-compat, etc -- but should be easier
now.)

[originally from svn r2293]
2002-12-08 16:54:31 +00:00
Simon Tatham
75ebfa28f0 Interchange two parameters in a printf, to prevent a silly segfault.
[originally from svn r2235]
2002-11-20 19:56:10 +00:00
Simon Tatham
7c95ea19c8 Robustness fixes for KEXINIT handling and others. In particular, I've
created a self-mallocing variant of sprintf, to obviate any future
need for paranoid %.100s type stuff in format strings.

[originally from svn r2199]
2002-11-07 19:49:03 +00:00
Simon Tatham
63f793b965 valgrind has caught two more uninitialised elements in the SSH
context structure. I knew the Unix port would be a good idea!

[originally from svn r2173]
2002-11-01 12:59:09 +00:00
Simon Tatham
a5da5adc07 Move an output newline to make username entry in Plink/SSH2 look
more sensible.

[originally from svn r2168]
2002-11-01 12:53:45 +00:00
Simon Tatham
2e25b715e3 Pass int rather than char to va_arg (the latter gets promoted).
[originally from svn r2167]
2002-11-01 12:53:10 +00:00
Simon Tatham
52bdffbfe0 More preparatory work: remove the <windows.h> include from lots of
source files in which it's no longer required (it was previously
required in anything that included <putty.h>, but not any more).
Also moved a couple of stray bits of exposed WinSock back into
winnet.c (getservbyname from ssh.c and AF_INET from proxy.c).

[originally from svn r2160]
2002-10-30 17:57:31 +00:00
Simon Tatham
ce677ce258 Yikes - put back a #include I accidentally removed two revs ago!
That'd have been embarrassing. Mind you I'd like to remove this
particular #include for good anyway, but the time is not now...

[originally from svn r2158]
2002-10-29 16:54:09 +00:00
Simon Tatham
1c80391e61 Hmm. Probably best initialise mainchan as well; oops.
[originally from svn r2157]
2002-10-29 14:41:10 +00:00
Simon Tatham
7e4f9e1af0 Try actually initialising ssh->v1_compressing. With any luck this
will be what was causing Owen's crash report today.

[originally from svn r2156]
2002-10-29 13:05:20 +00:00
Simon Tatham
4756c15fc9 Yet more global-removal. The static variables in logging.c are now
absent, and also (I think) all the frontend request functions (such
as request_resize) take a context pointer, so that multiple windows
can be handled sensibly. I wouldn't swear to this, but I _think_
that only leaves the Unicode stuff as the last stubborn holdout.

[originally from svn r2147]
2002-10-26 12:58:13 +00:00
Simon Tatham
ae09bf1c95 X forwarding authentication is now invented on a per-SSH-connection
basis, so the statics are gone from x11fwd.c.

[originally from svn r2145]
2002-10-26 11:23:15 +00:00
Simon Tatham
948f95d5e8 Reorganised the Unicode layer somewhat: moved luni_send and
lpage_send out into the line discipline, making them _clients_ of
the Unicode layer rather than part of it. This means they can access
ldisc->term, which in turn means I've been able to remove the
temporary global variable `term'. We're slowly getting there.

[originally from svn r2143]
2002-10-26 11:08:59 +00:00
Simon Tatham
24530b945e Port forwarding module now passes backend handles around properly.
As a result I've now been able to turn the global variables `back'
and `backhandle' into module-level statics in the individual front
ends. Now _that's_ progress!

[originally from svn r2142]
2002-10-26 10:33:59 +00:00
Simon Tatham
0b2523eeda Line discipline module now uses dynamically allocated data. Also
fixed one or two other minor problems.

[originally from svn r2141]
2002-10-26 10:16:19 +00:00
Simon Tatham
5df8e45c2e The Zlib module now uses dynamically allocated contexts. I think
that completes the static-removal in the crypto library. Ooh.

[originally from svn r2136]
2002-10-25 13:26:33 +00:00
Simon Tatham
db7196c174 Diffie-Hellman key exchange now uses a dynamically allocated context.
[originally from svn r2135]
2002-10-25 13:08:01 +00:00
Simon Tatham
107d1d875d SSH CRC attack detector now uses a dynamically allocated context.
[originally from svn r2132]
2002-10-25 12:58:21 +00:00
Simon Tatham
8f91f07599 SSH2 MACs now use dynamically allocated contexts.
[originally from svn r2131]
2002-10-25 12:51:28 +00:00
Simon Tatham
9848062b86 SSH ciphers now use dynamically allocated contexts.
[originally from svn r2130]
2002-10-25 12:35:22 +00:00
Simon Tatham
72ff571148 Major destabilisation, phase 2. This time it's the backends' turn:
each backend now stores all its internal variables in a big struct,
and each backend function gets a pointer to this struct passed to
it. This still isn't the end of the work - lots of subsidiary things
still use globals, notably all the cipher and compressor modules and
the X11 forwarding authentication stuff. But ssh.c itself has now
been transformed, and that was the really painful bit, so from here
on it all ought to be a sequence of much smaller and simpler pieces
of work.

[originally from svn r2127]
2002-10-25 11:30:33 +00:00
Jacob Nevins
771b0299c3 Fixes for (Backend)->size() changes -- internal declarations didn't include
new arguments and neither did internal calls.

[originally from svn r2119]
2002-10-23 14:03:11 +00:00
Simon Tatham
a9bd716df8 Cleanups from yesterday's destabilisation: lots of stuff in
terminal.c was apparently relying on implicit initialisation to
zero, and also I've removed the backends' dependency on terminal.h
by having terminal sizes explicitly passed in to back->size().

[originally from svn r2117]
2002-10-23 12:41:35 +00:00
Simon Tatham
0a80c983e2 Major destabilisation, phase 1. In this phase I've moved (I think)
all the global and function-static variables out of terminal.c into
a dynamically allocated data structure. Note that this does not yet
confer the ability to run more than one of them in the same process,
because other things (the line discipline, the back end) are still
global, and also in particular the address of the dynamically
allocated terminal-data structure is held in a global variable
`term'. But what I've got here represents a reasonable stopping
point at which to check things in. In _theory_ this should all still
work happily, on both Unix and Windows. In practice, who knows?

[originally from svn r2115]
2002-10-22 16:11:33 +00:00
Simon Tatham
ace232f5fa Remove last vestiges of `buggymac' in the Config structure. Might
have been cause of a Plink bug since it no longer got initialised.

[originally from svn r1986]
2002-10-01 18:30:15 +00:00
Simon Tatham
a394f20829 Add a new SSH2 bug: some servers apparently claim to be able to do
DH group exchange, but choke when you actually try it. Never
automatically enabled; manual control only.

[originally from svn r1982]
2002-09-26 18:37:33 +00:00
Simon Tatham
30e159d112 Be proactively pedantic about channel-close irregularities: we no
longer just sit there like a lemon if we can't find the channel in
question, we bomb out and complain. With any luck, remaining
problems of this type should be easier to catch under this policy.

[originally from svn r1962]
2002-09-15 13:31:11 +00:00
Simon Tatham
9b69e1b8aa Improvements to SSH1 channel close handling: track sending and
receiving of CLOSE and CLOSE_CONFIRMATION separately rather than
taking short cuts. I believe ssh-1.2.33 sending CLOSE_CONFIRMATION
before CLOSE was causing the remaining incidences of bug
`nonexistent-channel'. (ssh-1.2.33 appears to have unilaterally
decreed that CLOSE and CLOSE_CONFIRMATION are respectively renamed
INPUT_EOF and OUTPUT_CLOSING, hence there is no longer an ordering
constraint on them. Bah.)

[originally from svn r1961]
2002-09-15 13:24:00 +00:00
Jacob Nevins
9f9739602b Semi-bug "long-usernames":
Bump username storage from 32 to 100 chars. Also replaced a couple of magic
numbers with sizeof in ssh.c.
I don't believe this is going to startle any of the protocols PuTTY talks.

[originally from svn r1952]
2002-09-12 16:05:05 +00:00
Simon Tatham
3391745d2d Introduce the Bugs control panel, for overriding PuTTY's server
version number checks to determine the presence or absence of server
bugs.

[originally from svn r1936]
2002-09-08 13:28:38 +00:00
Simon Tatham
b15be34edf Increase length limit on SSH1_MSG_DEBUG; 70 chars is short enough to
lose vital information in some existing servers' messages.

[originally from svn r1932]
2002-09-07 12:27:13 +00:00
Simon Tatham
c24016e0da Add BUG_SSH2_DERIVEKEY, present (according to OpenSSH) in ssh.com
versions 2.0.*, and causing the shared secret not to be included in
key derivation hashes. (This doesn't quite cause a blatant security
hole because the session ID - _derived_ from the shared secret - is
still included.)

[originally from svn r1853]
2002-08-18 09:27:15 +00:00
Simon Tatham
67cb02d03d In SSH2, if decrypting the packet length gave us a negative value,
subsequent packet-receiver code would fail to notice anything was
wrong and segfault. Since this is clearly a silly packet length
anyway, we now explicitly reject it as a daft encryption error.

[originally from svn r1852]
2002-08-18 09:10:17 +00:00
Simon Tatham
4b64ea9db9 Final fixes to keyboard-interactive so it now works with packets
containing more than one prompt instead of less than one, and also
correctly enables echo on prompts that the server requests it for.
In the process I've moved the whole username/password input routine
out into its own function, where it's called independently of which
SSH protocol we're using, so this should even have _saved_ code
size. Rock!

[originally from svn r1830]
2002-08-11 13:02:01 +00:00
Simon Tatham
5ac941933a Oops. Didn't quite get the new SSH protocol selection code right. *blush*
[originally from svn r1818]
2002-08-07 17:57:06 +00:00
Simon Tatham
6e00685af0 Add an option to force SSH1 protocol only. Partly for symmetry;
mostly because I'm about to want it for the -1 command line option.

[originally from svn r1816]
2002-08-07 17:48:26 +00:00
Simon Tatham
118fc8c81e Revamp of command-line handling. Most command line options should
now be processed in cmdline.c, which is called from all utilities
(well, not Pageant or PuTTYgen). This should mean we get to
standardise almost all options across almost all tools. Also one
major change: `-load' is now the preferred option for loading a
saved session in PuTTY proper. `@session' still works but is
deprecated.

[originally from svn r1799]
2002-08-04 21:18:56 +00:00
Simon Tatham
949cecd569 Fix culpable lack of generality in keyboard-interactive
authentication: a k-i request packet can contain any number of auth
prompts (including zero!) and we must ask the user all of them and
send back a packet containing the same number of responses. FreeBSD
systems were sending a zero-prompts packet which was crashing us;
this now appears fixed (we correctly return a zero-responses packet)
but I haven't tested a multiple-prompts packet because I can't
immediately think of a server that generates them.

[originally from svn r1797]
2002-08-03 16:22:55 +00:00
Simon Tatham
3f8d151c5a One of the recent port forwarding crash reports contained details
which suggested bufchain_prefix() was finding an improperly
initialised bufchain structure. Looking at the code, this may indeed
have been able to happen, since the bufchain in a SOCKDATA_DORMANT
channel was not initialised until CHANNEL_OPEN_CONFIRMATION was
received. This seems utterly daft, so I now call bufchain_init()
when the channel structure is actually created. With any luck the
crash will mystically disappear now (I wasn't able to reproduce it
myself).

[originally from svn r1735]
2002-06-15 16:52:35 +00:00
Simon Tatham
858441ba81 Workaround for the SSH2 RSA padding bug in OpenSSH 2.5 - 3.2
inclusive. Padding is accomplished by rewriting the signature blob
rather than at the point of generation, in order to avoid having to
move part of the workaround into Pageant (and having to corrupt the
agent wire protocol to allow PuTTY to specify whether it wants its
signatures padded!).

[originally from svn r1708]
2002-05-31 17:39:16 +00:00
Simon Tatham
8cdae4f73b ieof-for-nonexistent-channel problem: avoid comparing an unsigned with -1
[originally from svn r1686]
2002-05-17 12:33:20 +00:00
Owen Dunn
c71432cb86 SSH2 only support
[originally from svn r1664]
2002-05-11 13:08:37 +00:00
Simon Tatham
8c3a0eb50b Improved error messages if you use the wrong key type: you should
now be told that the key is the wrong type, _and_ what type it is,
rather than being given a blanket `unable to read key file' message.

[originally from svn r1662]
2002-05-11 12:13:42 +00:00
Simon Tatham
17af65c78c Remember to wait for SSH1_MSG_SUCCESS after enabling remote port
forwardings in SSH1. Was causing several MSG_SUCCESS to be queued up
unread, which was wrong-but-benign in most cases but caused a hard
crash with compression enabled (one of those uncompressed
MSG_SUCCESSes was fed to the zlib decompressor with spectacular
results).

[originally from svn r1609]
2002-03-27 21:58:11 +00:00
Simon Tatham
e40f043ff8 Matt Harden's (modified) patch to do getservbyname() lookups on port-
forwarding port numbers.

[originally from svn r1608]
2002-03-27 21:43:37 +00:00
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
Simon Tatham
355cdbd5e8 Implement OpenSSH-compatible RSA key fingerprints and use them throughout
[originally from svn r637]
2000-09-26 14:26:21 +00:00
Simon Tatham
ab839c6127 Fix a segfault in agent forwarding code
[originally from svn r633]
2000-09-26 11:16:47 +00:00
Simon Tatham
3e4619b479 The "Authenticated using key from agent" message is a verbose-only one
[originally from svn r631]
2000-09-26 10:06:05 +00:00
Simon Tatham
673f2e48a7 Rationalise ordering of authentication operations. Still some work to do,
but at least pscp no longer hangs when prompting for a passphrase

[originally from svn r621]
2000-09-25 10:14:53 +00:00
Simon Tatham
e70425dda6 Enable better build-time flexibility over which WinSock to include
[originally from svn r615]
2000-09-22 13:16:49 +00:00
Simon Tatham
c0ac8ab9b4 Bug fix: line discipline selection is not enabled until after ssh
authentication phase to stop user/password prompts behaving oddly

[originally from svn r614]
2000-09-22 13:10:19 +00:00
Simon Tatham
e5ef37f3f5 Prevent network errors from summarily closing the window when CoE is off
[originally from svn r613]
2000-09-22 11:04:57 +00:00
Simon Tatham
180b62b6b0 Miscellaneous ssh2 fixes. plink is now relatively sane
[originally from svn r608]
2000-09-21 14:34:32 +00:00
Simon Tatham
ea8d61f2d9 Fix Blowfish-with-SSH2 combination, and enable user cipher
selection for SSH2

[originally from svn r606]
2000-09-20 15:15:02 +00:00
Simon Tatham
c410c7c44c SSH2 is now more plausible - window sizes listened to, basic non-crashing
[originally from svn r604]
2000-09-20 14:29:52 +00:00
Simon Tatham
774110ee94 A couple of SSH2 fixes
[originally from svn r602]
2000-09-20 10:59:24 +00:00
Simon Tatham
f8be19a08b Configuration option for agent forwarding
[originally from svn r597]
2000-09-15 11:26:18 +00:00
Simon Tatham
a97b390d96 A couple of small cleanups
[originally from svn r595]
2000-09-15 10:57:15 +00:00
Simon Tatham
c96384efe0 Pageant now accepts an initial key list on the command line
[originally from svn r592]
2000-09-15 10:48:42 +00:00
Simon Tatham
c366174cc2 Added Pageant, a first-attempt PuTTY authentication agent
[originally from svn r589]
2000-09-14 15:02:50 +00:00
Simon Tatham
eed592d887 Add CryptoCard authentication
[originally from svn r587]
2000-09-12 08:44:30 +00:00
Simon Tatham
334b79e16c Add switch to choose SSH v1-versus-v2 protocol preference where both
are available

[originally from svn r584]
2000-09-11 09:37:43 +00:00
Simon Tatham
1864344036 Oops - remove SHA debugging from ssh2
[originally from svn r578]
2000-09-09 08:21:34 +00:00
Simon Tatham
4109ac3dfc Stop plink losing data at start of session
[originally from svn r577]
2000-09-08 16:42:11 +00:00
Simon Tatham
be711d9cd4 plink can now execute a specific command instead of just a shell session
[originally from svn r576]
2000-09-08 15:24:19 +00:00
Simon Tatham
8394a48620 Added a fourth application: plink, a command line connection utility
[originally from svn r575]
2000-09-08 14:45:20 +00:00
Simon Tatham
263d9e0f09 Public key authentication now works in pscp too - oops
[originally from svn r574]
2000-09-08 08:33:52 +00:00
Simon Tatham
d9af8f4b90 RSA key authentication in ssh1 works; SSH2 is nearly there
[originally from svn r572]
2000-09-07 16:33:49 +00:00
Simon Tatham
0f1e449189 SSH2 transport layer now enables encryption and MAC successfully for 3DES
[originally from svn r571]
2000-09-06 09:55:32 +00:00
Simon Tatham
36a499a7f1 Second attempt. Can successfully decrypt the _first block_ of a packet.
[originally from svn r570]
2000-09-05 16:23:36 +00:00
Simon Tatham
35205e5cb7 SSH 2 support, phase 1, debugging. Currently does Diffie-Hellman and gets
the same results as the server, which is a pretty good start.

[originally from svn r569]
2000-09-05 14:28:17 +00:00
Simon Tatham
0d5d39064a Robert de Bath's Big Patch, part 1
[originally from svn r516]
2000-07-26 12:13:51 +00:00
Simon Tatham
9546cf7393 PSCP: After a password supplied with `-pw' fails to authenticate,
we should _not_ fall back to console input for a second attempt,
because this hangs batch files.

[originally from svn r513]
2000-07-21 09:17:05 +00:00
Simon Tatham
2832ef1e75 Joris van Rantwijk's unified SSH code suitable for PuTTY and PSCP
[originally from svn r504]
[this commit reordered to come after creation of 0.49 tag]
2000-06-22 12:18:34 +00:00
Simon Tatham
0793be4efe Security improvement: check that string length field in
SSH_SMSG_{STDOUT,STDERR}_DATA packets is consistent with length
field in packet header. (Helps prevent insertion attack.)

[originally from svn r496]
2000-06-06 08:57:55 +00:00
Simon Tatham
6b81798205 Security improvement: check CRC on incoming packets
[originally from svn r489]
2000-05-31 10:18:24 +00:00
Simon Tatham
229245f384 Ahem. This time high-half characters really _do_ work in username
and password...

[originally from svn r468]
2000-05-09 08:56:30 +00:00
Simon Tatham
ba68a6d5f7 Enable high-half characters (>=160) in usernames and passwords
[originally from svn r454]
2000-04-11 10:39:58 +00:00
Simon Tatham
9922072a8d Peter Schellenbach's patch: re-implement the PuTTY cryptographic
functions as calls to the MS Crypto API. Not integrated into the
Makefile yet, but should eventually allow building of an SSH-enabled
PuTTY which contains no native crypto code, so it can be used
everywhere (and anyone who can get the MS encryption pack can still
use the SSH parts).

[originally from svn r425]
2000-03-24 09:45:49 +00:00
Simon Tatham
96dbf9c6e6 First stab at the ability to compile puttytel.exe, an SSH-free
variant which is patent-safe in the US and legal in France and
Russia. This is a horrible hack in some ways: it's shown up serious
deficiencies in the module boundaries. Needs further work, probably
once the SSH implementations are recombined.

[originally from svn r410]
2000-03-15 15:08:48 +00:00
Simon Tatham
a8d5838ebc Robert de Bath's multi-purpose patch, slightly modified.
- ^E answerback is now `PuTTY'.
 - The framework is now in place for the scrollback to reset to
   bottom on display _or_ keyboard events _or_ both. An actual
   configurable option isn't yet present, but most of the code is in
   place.
 - Try to deal with the problems where incoming data gets dropped
   after decoding but before display.
 - Scrollback behaviour has changed: instead of keying it off
   `scroll' versus `delete top line', things now go into the
   scrollback from _either_ of those but only if the primary screen
   is selected. Should fix problems with `less' and talkers.
 - must_update variable has gone because rdb correctly observed that
   it didn't seem to be doing a great deal :-)

[originally from svn r328]
1999-11-30 10:52:07 +00:00
Simon Tatham
b51c18f24c Fix unexpected network error 5000
[originally from svn r286]
1999-11-09 11:34:14 +00:00
Simon Tatham
f6c63320ea Changes from executor:
- NetHack keypad mode (Shift only works with NumLock off)
 - Alt-Space handling (best I could manage; not too bad considering)
 - Event Log rather than Telnet Negotiation Log

[originally from svn r284]
1999-11-09 11:10:04 +00:00
Simon Tatham
59e798fc6d Add TIS authentication option
[originally from svn r283]
1999-11-08 17:42:12 +00:00
Simon Tatham
a764191663 Switch to using SSH_MSG macros
[originally from svn r282]
1999-11-08 17:36:08 +00:00
Simon Tatham
3992fc48f1 Fix versioncmp
[originally from svn r255]
1999-10-25 14:27:13 +00:00
Simon Tatham
2d6fcb0a7a Single-DES encryption, patch courtesy of Murphy Lam
[originally from svn r253]
1999-10-25 08:59:40 +00:00
Simon Tatham
b3efa01293 We failed to ignore SSH_MSG_IGNORE :-)
[originally from svn r219]
1999-09-10 15:35:26 +00:00