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

3367 Commits

Author SHA1 Message Date
Simon Tatham
d764872e9e Rewrite gprefs() in settings.c so that its input mapping includes
information about where to put items that aren't mentioned in the
saved configuration. So far the only nontrivial use I've made of this
facility is to default to placing KEX_RSA just above KEX_WARN in the
absence of any other information, which should fix
'ssh2-rsa-kex-pref'.

While I'm here I've rewritten wprefs() on general principles to remove
the needless length limit, since I was touching it anyway. The length
limit is still in gprefs (but I've lengthened it just in case).

[originally from svn r9181]
2011-06-25 17:37:31 +00:00
Simon Tatham
af78191a9c Make Pageant use the same SID-selection logic as the Pageant client
code (as introduced in r9043), so that it uses the user SID rather
than the default SID.

This does change the access-control model, in that a Pageant running
with administrator privilege will now serve keys to an unprivileged
PuTTY running as the same user who started Pageant. Owen and I think
this isn't a problem (in particular, it will still not serve keys to a
_different_ user).

More importantly, making the Pageant client and server code work the
same way means that PuTTY and Pageant can still talk to each other
when UAC is turned off, which we've had several reports of r9043
having broken.

[originally from svn r9178]
[r9043 == 05f22632eb]
2011-06-08 20:47:07 +00:00
Simon Tatham
6e40a0db57 When we fail to get a response from Pageant, we should log the fact.
Currently, if the IPC exchange goes wrong, the Event Log just prints
"Pageant is running. Requesting keys." and then goes on to the next
step without ever saying what happened.

[originally from svn r9177]
2011-06-08 20:39:06 +00:00
Simon Tatham
934a5ad6b2 Fixes (mostly from Colin Watson, a couple redone by me) to make Unix
PuTTY compile cleanly under gcc 4.6.0 without triggering any of its
new warnings.

[originally from svn r9169]
2011-05-07 10:57:19 +00:00
Jacob Nevins
e70878bd3a The documentation was still claiming that we don't support x11-auth.
[originally from svn r9149]
2011-04-08 15:52:02 +00:00
Jacob Nevins
fbee8c409c Note the possibility of a pause due to /dev/random blocking.
[originally from svn r9125]
2011-03-09 18:10:47 +00:00
Jacob Nevins
74c5f7dda9 Implement zlib@openssh.com, using the rekey-after-userauth method suggested in
the wishlist entry.

[originally from svn r9120]
[this svn revision also touched putty-website,putty-wishlist]
2011-03-04 22:34:47 +00:00
Simon Tatham
d0b99ccee3 Colin Watson reports that gnome-session has been known to leave
SIGPIPE ignored in its child processes, leading to unexpected
behaviour inside pterms. (The gnome-session I'm sitting in front of
doesn't seem to do this as far as I can tell, but I don't doubt there
are some that do.) Add SIGPIPE to the list of signals we reset to
default behaviour before launching pterm's child process.

[originally from svn r9117]
2011-03-02 19:12:42 +00:00
Simon Tatham
09080057ca Set the 'must_close_session' flag at the end of close_session(), so
that we won't keep calling close_session() again the next time we go
round the message loop. Should fix unclean-close-hang. Thanks to Simon
Coleman for debugging.

[originally from svn r9115]
2011-03-02 18:52:03 +00:00
Jacob Nevins
91131fd197 Fix probably-harmless type mismatch in nogss.c (and #include "putty.h" to stop
it happening again; this was spotted by GCC's "-flto" option).

[originally from svn r9114]
2011-03-02 00:18:03 +00:00
Jacob Nevins
767778cf1b Add some extra validation to zlib decompression (primarily to shut up a GCC 4.6
warning).

[originally from svn r9113]
2011-03-01 23:44:06 +00:00
Jacob Nevins
d5790e1e72 Add some "#ifdef OPTIMISE_SCROLL" scar tissue to placate GCC 4.6
-Wunused-but-set-variable.

[originally from svn r9112]
2011-03-01 23:10:16 +00:00
Jacob Nevins
5eb70af8b1 Remove an unused variable (should shut up a warning from GCC 4.6).
[originally from svn r9111]
2011-03-01 23:04:37 +00:00
Jacob Nevins
1c28be2056 Use pid_t more consistently. Should shut up a warning from GCC 4.6, and may
conceivably help on platforms where int and pid_t aren't sufficiently similar.

[originally from svn r9110]
2011-03-01 23:00:32 +00:00
Simon Tatham
7957ca1153 Rejig the bottom-level loops in internal_mul_* to use pointers instead
of array indices. You'd hope that compilers could automatically turn
the one representation into the other if it was faster to do so, but
apparently not: even on gcc -O3, this source transformation gains over
15% performance.

[originally from svn r9105]
2011-02-22 19:09:27 +00:00
Simon Tatham
9d4005e5c1 Make bignum.py self-contained, by importing versions of the two
functions I was depending on from my personal Python maths utility
module.

[originally from svn r9104]
2011-02-22 00:06:12 +00:00
Simon Tatham
77180221bd Move the malloc and free of scratch space out of the internal_mul
routines into their callers, where they'll be done once for a whole
modpow rather than many times within each multiply. Doesn't save much
time as far as I can see - perhaps a couple of percent, one second in
the minute it takes to run the new bignum test suite - but seems like
a sensible idea anyway on general principles.

[originally from svn r9103]
2011-02-21 19:47:28 +00:00
Simon Tatham
7a0bd8247c A few more modpow tests, exercising the fallback option. This is
mostly so I can valgrind both and make sure they free all their
workspace - a memory leak in this code would be not merely an
inconvenience but a security hazard.

[originally from svn r9101]
2011-02-20 15:42:44 +00:00
Simon Tatham
15d7f8bb3e Add tests of modpow.
[originally from svn r9100]
2011-02-20 15:27:48 +00:00
Simon Tatham
1b47322c3b Nearly forgot. Reinstate the original unoptimised modpow, as a
fallback for when Montgomery is inapplicable.

(I may also at some point switch to using it for small exponents, if
speed testing should reveal that there's a noticeable threshold beyond
which preparing the Montgomery setup is uneconomical.)

[originally from svn r9099]
2011-02-20 15:14:02 +00:00
Simon Tatham
260cee498e Fix bug in Karatsuba multiplication, which affected propagation of a
carry by more than one word. Now the current set of test cases all
pass again.

[originally from svn r9098]
2011-02-20 15:06:39 +00:00
Simon Tatham
01d365b626 Beginnings of a test suite for the bignum code. The output of
testdata/bignum.py is twice the size of the rest of the PuTTY source
put together, so I'm not checking it in.

This reveals bugs in the new multiplication code, which I have yet to
fix.

[originally from svn r9097]
2011-02-20 14:59:00 +00:00
Simon Tatham
b22bdb2b0d Prompt for a remote username in rlogin connections, if one wasn't
specified in the configuration. Jacob's userpass abstraction proves
its worth in making this a trivial job.

(Actually reported by a user - somebody's still using rlogin!)

[originally from svn r9096]
2011-02-18 19:12:20 +00:00
Simon Tatham
fa85085640 Implement the Chinese Remainder Theorem optimisation for speeding up
RSA private key operations by making use of the fact that we know the
factors of the modulus.

[originally from svn r9095]
2011-02-18 08:25:39 +00:00
Simon Tatham
61875b87e3 Implement the Montgomery technique for speeding up modular
exponentiation by replacing the modulo operation by a cleverly chosen
multiplication. This was not worth doing in the previous state of the
code (because my multiply was about as slow as my modulo), but now
that multiplication has been sped up by the Karatsuba optimisation,
Montgomery becomes worthwhile.

[originally from svn r9094]
2011-02-18 08:25:38 +00:00
Simon Tatham
d9c3353176 Implement the Karatsuba technique for recursive divide-and-conquer
optimisation of large multiplies.

[originally from svn r9093]
2011-02-18 08:25:37 +00:00
Simon Tatham
8b4c50be45 Add some appropriate bignum typedefs for generic 64-bit systems,
setting BignumInt to 32 bits. gcc defines _LP64 on x86-64 and
presumably on other 64-bit architectures, so I've conditioned my
defines on that in the hope that they won't need redoing for the next
few such architectures.

I've also added a set for _LLP64, but it's untested as yet.

[originally from svn r9092]
2011-02-18 08:25:36 +00:00
Simon Tatham
7c61c07eb8 Allow setting the WM_CLASS X window property as a configuration option
in saved sessions, so that a programmable window manager can
distinguish different PuTTYs/pterms on startup and assign them
different window management properties.

[originally from svn r9078]
2011-01-15 11:39:44 +00:00
Jacob Nevins
b570f28224 Tweak to r7635: when changing between protocols in the configuration dialog
and avoiding trashing a non-default port, don't treat a port of 0 as special;
this was causing defaults to "freeze in" for sequences of clicks like SSH,
Raw, Telnet.
Arrange that a port of 0 (which in a backend indicates no default) is displayed
as a blank in the port box, to make this less jarring.

[originally from svn r9077]
[r7635 == db7cc1cba6]
2011-01-14 19:57:00 +00:00
Jacob Nevins
c5228adce3 It's a new year.
[originally from svn r9072]
[this svn revision also touched putty-website]
2011-01-05 12:01:00 +00:00
Jacob Nevins
28ef3c91c4 Remove references to the now-dead Mac OS 9 port.
[originally from svn r9071]
2011-01-05 11:58:52 +00:00
Jacob Nevins
99db81f2e7 When iterating over all channels for a dead SSH connection, don't miss out
those in the CHAN_SOCKDATA_DORMANT state (i.e., local-to-remote forwardings
which the SSH server had not yet acknowledged).
Marcel Kilgus has been running with the ssh_do_close() patch for nearly two
years (*cough*) and reports that it has eliminated frequent
'unclean-close-crash' symptoms for him (due to the unclosed socket generating
a pfd_closing() which accessed freed memory), although I've not reproduced
that. The patch to ssh_free() is mine and not known to fix any symptoms.

[originally from svn r9069]
[this svn revision also touched putty-wishlist]
2011-01-03 16:50:41 +00:00
Simon Tatham
a45f984c75 Stop general_textout() from trying to slice up the input clipping
rectangle into smaller ones: it doesn't work any more, since the new
variable-pitch code can now call general_textout() with a larger
clipping rectangle than the text it's meant to be displaying. Instead,
general_textout() now uses the same semantics as the next loop up in
do_text_internal(): the first piece of text it displays uses the
opacity setting passed in, which blanks the entire clipping rectangle
if necessary, and then subsequent overlays are non-opaque. And the
same clipping rectangle is used throughout.

[originally from svn r9067]
2010-12-30 00:06:43 +00:00
Simon Tatham
a418e0d2dc Rationalise the mechanism in do_text_internal for providing the 'lpDx'
array to ExtTextOut:
 - move it inside the new big loop (this should fix a potential bug
   whereby the DBCS handling altered some elements of it but the loop
   did not actually step along it)
 - initialise it more sensibly
 - rename it to lpDx rather than IpDx, since as far as I can tell the
   latter name was derived from a misreading of the former in the
   Windows API docs.

[originally from svn r9066]
2010-12-29 23:48:54 +00:00
Jacob Nevins
46355d29ae Move some not-compiled-in debug code somewhere more useful.
[originally from svn r9065]
2010-12-29 22:38:36 +00:00
Simon Tatham
3a691b5e0d Fix segfault in general_textout with variable-pitch fonts: we can't
pass null lpDx, because general_textout depends on it being filled in.
Instead we null it out in the calls to subroutines _from_
general_textout.

[originally from svn r9064]
2010-12-29 16:00:58 +00:00
Simon Tatham
00b32eda3c Support for using variable-pitch fonts for the terminal on Windows.
Done in much the same way as it is in the GTK front end: the character
cell width is determined using the font's digits (which seems to give
generally not-too-offensive spacing in most cases, at the expense of
Ms and Ws typically overhanging a bit into adjacent cells) and each
character is centred in its cell. Overhangs never leave permanent
droppings on the window, because the existing work done in r5003
handles them just fine even in this stressful scenario.

There's a hacky new checkbox in the Appearance panel to make
variable-pitch fonts appear in the font selector (they still don't by
default, because I still think it's _usually_ not What You Want); the
checkbox state is not actually stored as part of a saved session, but
it should be automatically ticked when reloading a session that's got
a variable pitch font selected.

(I'm half-expecting a potential flurry of requests for this feature in
the wake of http://xkcd.com/840/ , so I thought I'd pre-empt them :-)

[originally from svn r9063]
[r5003 == ba470dec5e]
2010-12-29 14:11:25 +00:00
Simon Tatham
7dab9e5573 Vyacheslav Andrejev points out a heap management goof in the new jump
list code. Free the old value of the pointer variable we just
overwrote, not the new one!

[originally from svn r9062]
2010-12-29 13:35:44 +00:00
Simon Tatham
6538793a72 Thou shalt not suffer a misplaced apostrophe to live.
[originally from svn r9061]
2010-12-29 11:57:04 +00:00
Simon Tatham
0adb957784 Fix resize handling when enabling and disabling full-screen mode.
I'm not sure whether I broke this in the recent revamp or whether it
was always broken, but: transitions in and out of full-screen mode
work by first maximising or restoring the window, which triggers a
WM_SIZE, whose handler then fiddles with the window style to disable
or re-enable all the furniture, which in turn triggers a recursive
WM_SIZE. The trouble is, after returning from the handler for the
inner WM_SIZE, the rest of the outer handler runs, and its client area
size is now out of date.

So I've added a flag which is set when a resize is handled 'properly',
so that after returning from the inner WM_SIZE handler the outer one
knows not to try to redo badly work that's already been done well.

[originally from svn r9056]
2010-12-27 12:58:39 +00:00
Jacob Nevins
af1060856e Add an option to disable SSH-2 banners.
[originally from svn r9055]
2010-12-27 01:19:13 +00:00
Jacob Nevins
526aff23b6 Fix up svn:eol-style and svn:keywords on new files.
[originally from svn r9054]
2010-12-27 00:24:48 +00:00
Jacob Nevins
69090b86da Remove a couple of unused variables.
[originally from svn r9053]
2010-12-26 23:23:11 +00:00
Jacob Nevins
ed80dcc3cf Try to delete jump lists in "-cleanup".
[originally from svn r9050]
2010-12-26 20:00:45 +00:00
Jacob Nevins
301d30c68e Optionally define PropVariantInit() locally to restore ability to build with
MinGW after r9046, and munge the COMPTR() macro to remove a couple of warnings
with my MinGW GCC (3.4.5).

[originally from svn r9049]
[r9046 == 1a03fa9292]
2010-12-26 18:29:53 +00:00
Jacob Nevins
b54a8eaef5 Document the behaviour of Alt in the "hybrid" resizing mode alluded to in
r9045.

[originally from svn r9047]
[r9045 == 6cd24c839d]
2010-12-23 22:19:13 +00:00
Simon Tatham
1a03fa9292 Support for Windows 7 jump lists (right-click on a program's taskbar
icon, even if the program isn't running at the time, to be presented
with an application-defined collection of helpful links). The current
jump list is updated every time a saved session is loaded, and shows
the last few launchable saved sessions (i.e. not those like Default
Settings) that were loaded. Also, if Pageant or PuTTYgen or both is in
the same directory as the PuTTY binary, the jump list will present
links to launch those too.

Based on a patch sent last year by Daniel B. Roy, though it's barely
recognisable any more...

[originally from svn r9046]
2010-12-23 17:32:28 +00:00
Simon Tatham
6cd24c839d The special treatment of Alt-resize (to cause resizing to affect the
font instead of the terminal size) should only be active in
RESIZE_EITHER mode - in RESIZE_TERM it is worse than useless.

[originally from svn r9045]
2010-12-23 17:16:19 +00:00
Simon Tatham
674f68f1ef Another fix to yesterday's window-resizing revamp: when restoring from
maximised state, we must be sure to disable the window offset used to
centre the terminal in cases where the window is non-negotiably the
wrong size (e.g. maximised). Hence we must call reset_window after our
terminal resize.

[originally from svn r9044]
2010-12-23 15:44:20 +00:00
Simon Tatham
05f22632eb More careful owner SID selection in the Pageant client code. This
should solve some of the SID-mismatch issues we've occasionally had
reported. Because it's a modification on the client side, it doesn't
affect the security of Pageant itself.

[originally from svn r9043]
2010-12-23 15:22:50 +00:00