Граф коммитов

4480 Коммитов

Автор SHA1 Сообщение Дата
Ben Harris 5c42f97b68 Switch to flow-control-based SFTP uploading.
Formerly PuTTY's SFTP code would transmit (or buffer) a megabyte of data
before even starting to look for acknowledgements, but wouldn't allow
there to be more than a megabyte of unacknowledged data at a time.  Now,
instead, it pays attention to whether the transmit path is blocked, and
transmits iff it isn't.

This should mean that SFTP goes faster over long fat pipes, and also
doesn't end up buffering so much over thin ones.

I practice, I tend to run into other performance limitations (such as
TCP or SSH-2 windows) before this enhancement looks particularly good,
but with an artificial lag of 250 ms on the loopback interface this
patch almost doubles my upload speed, so I think it's worthwhile.
2016-04-09 17:20:07 +01:00
Ben Harris cb36668185 pscp: pull out upload block size into a constant. 2016-04-09 00:46:44 +01:00
Ben Harris c431c63f5c Correct a comment: OUR_V2_WINSIZE is now the default, not maximum. 2016-04-09 00:46:43 +01:00
Simon Tatham d29d33e165 Update build script for Inno Setup 5.5.9.
I've just upgraded my build environment to the latest Inno Setup
(apparently fixing some DLL hijacking issues), and found that the
build script doesn't run any more because the name of the output file
has changed - it used to produce Output/setup.exe, but now it produces
Output/mysetup.exe.

Rather than just fixing the build script to expect the new name, I've
explicitly specified an output filename of my own choice in putty.iss,
so that the build script should now work with versions before and
after the change.
2016-04-08 11:01:58 +01:00
Simon Tatham f0f19b6147 Add some missing 'const' in version.c's string data.
I can't believe this codebase is around 20 years old and has had
multiple giant const-fixing patches, and yet there are _still_ things
that should have been const for years and aren't.
2016-04-07 07:52:55 +01:00
Simon Tatham c0a57d0b9e Fix semantics of empty string in mkfiles.pl "!cflags".
Previously, if you tried to set the special cflags for an object file
to the empty string, mkfiles.pl would normalise that to the string
"1". I'm not entirely sure why - that line of code was added without
explanation in commit 64150a5ef which brought in that directive in the
first place - but I have to guess that it was left over from some
earlier design iteration in which I hadn't quite decided whether I was
going to need a string or a boolean to separate version.o from other
objects.

Of course, setting an object's cflags to "" is a bit of a weird thing
to want to do anyway - why not just leave them unset? But in fact I've
now thought of something useful for it to do: this commit arranges
that setting cflags="" has the effect (in the 'am' makefile type) of
separating the object out into its own little automake library but not
actually giving that library any separate cflags. And the point of
_that_, in turn, will be that then you can add cflags to it
_conditionally_ in a "!begin am" snippet, e.g. conditionalised on
something in configure.
2016-04-07 07:52:01 +01:00
Simon Tatham 8552f5cb9a Windows PuTTYgen: stop saying "Pageant" in the About box!
Ahem. Cut-and-paste goof that I introduced in commit 2eb952ca3, when I
moved the application names out of separate text controls in the
resource-file dialog descriptions.
2016-04-06 14:12:45 +01:00
Simon Tatham 0ac3526b3e Fix duplicate definition of typedef 'bufchain'.
This was defined in misc.h, and also in network.h (because one
function prototype needed to refer to it in the latter), leading to a
build failure if any source file inconveniently included both those
headers.

Fixed by guarding each copy of the typedef with a #ifdef.
2016-04-06 10:08:52 +01:00
Simon Tatham 2c37bfca42 GTK 3: tweak margin below the gtkask drawing areas.
A side effect of commit 1f9df706b seems to have been to squash those
areas right up against the bottom of the dialog box, which is ugly. I
don't fully understand why it only happens to those drawing areas and
not to buttons placed in the fake 'action area' by other dialogs, but
anyway, adding an explicit margin-bottom attribute seems to solve it.
2016-04-04 11:52:01 +01:00
Simon Tatham 4f904fcd15 Account for GtkApplicationWindow menu bar in geometry hints.
This is another widget that can appear in the top-level window, in
addition to the drawing area and scrollbar we put there ourselves, and
hence which needs to be accounted for when figuring out the
relationship between the drawing area size in character cells and the
full window size in pixels.

Finding the menu bar widget itself is a bit of a hassle, but having
found it, dealing with it is basically the same as dealing with the
scrollbar, only with x and y swapped.
2016-04-04 11:37:07 +01:00
Simon Tatham 8fd67a9c46 GTK: stop using gtk_window_parse_geometry.
This function, which parses the X11-style '-geometry WxH+X+Y' option
argument and automatically loads the result into the window, is also
being deprecated.

Fortunately we already had a fallback option for GTK1 (which didn't
have gtk_window_parse_geometry in the first place), calling the Xlib
geometry-parsing function and manually loading the results into GTK.
The method of loading into GTK is not the same between the two
versions, but the basic strategy is still viable.

For the sake of maintaining and testing fewer ifdef branches, I've
removed the use of gtk_window_parse_geometry _completely_, even in
GTK2 which did have it. GTK2 now uses the same strategy that I've
switched to for GTK3.
2016-04-04 11:37:07 +01:00
Simon Tatham 4ba7ff006a GTK: stop using geometry-based window sizing functions.
gtk_window_resize_to_geometry and gtk_window_set_default_geometry are
deprecated as of GTK 3.20, so now we do the geometry -> pixel size
conversion on our side.
2016-04-04 11:24:24 +01:00
Simon Tatham a7befbf40e GTK: split out the computation part from set_geom_hints.
This is preparation for dealing with the fact that GTK's geometry-
based API routines for setting the window size are being deprecated:
we'll no longer be able to specify a width/height in characters and
have GTK convert that into a pixel size based on the geometry hints
we'd already fed it. So we'll need to do that conversion ourselves,
and the easiest approach is to make it easy to recompute the geometry
hints on our side whenever we need them.
2016-04-04 11:23:25 +01:00
Simon Tatham 169a3d2457 GTK 3.20 compatibility: switch to gdk_seat_grab.
gdk_device_grab and all its preparatory faff are now deprecated, and
gdk_seat_grab is the new thing. Introduce yet another branch to all
the ifdefs for keyboard-grabbing. On the plus side, at least it's
slightly simpler than the GdkDevice business.
2016-04-04 11:21:54 +01:00
Simon Tatham ab433e8073 Reorganise the Bugs and More Bugs config panels.
Now bugs that are still likely to come up with relatively recent
server software (because they're only a few years fixed, or because
they're the sort of mistake that new server implementors will likely
make again) are in the Bugs panel, and very old things long since
fixed are relegated to More Bugs.

In particular, More Bugs contains everything SSH-1 related.
2016-04-03 18:16:44 +01:00
Owen Dunn e22a72c66a Merge branch 'master' of ssh://tartarus.org/putty 2016-04-03 15:09:59 +01:00
Owen Dunn e31898d044 Allow PROCESS_QUERY_INFORMATION access to our process.
Blocking PROCESS_QUERY_INFORMATION access to the process turned out to
stop screen readers like Microsoft Narrator from reading parts of the
PuTTY window like the System Menu.
2016-04-03 15:06:44 +01:00
Simon Tatham c2c22fb16a Compile fix for GTK 3.18: avoid gtk_adjustment_changed().
That function is deprecated as of 3.18, on the basis that GTK doesn't
need telling any more when the adjustment's owning widget needs
updating. So we just need to condition out the call.
2016-04-03 10:10:40 +01:00
Simon Tatham ef7a821bb1 64-bit cleanness: fix a couple of format strings in winjump.c.
strcspn() returns a size_t, which is not safe to pass as the parameter
in a printf argument list corresponding to a "*" field width specifier
in the format string, because the latter should be int, which may not
be the same size as size_t.
2016-04-02 14:23:11 +01:00
Simon Tatham a5d7a6c102 64-bit cleanness: fix integer types in winsftp.c.
We were calling Windows file-handling API functions GetFilesize and
SetFilePointer, each of which returns two halves of a large integer by
writing the high half through a pointer, with pointers to the wrong
integer types. Now we're always passing the exact type defined in the
API, and converting after the fact to our own uint64 type, so this
should avoid any risk of wrong-sized pointers.
2016-04-02 14:23:07 +01:00
Simon Tatham 83746d7236 64-bit cleanness: use INT_PTR/UINT_PTR where appropriate.
These integer types are correct for the id/handle parameter to
AppendMenu / InsertMenu / DeleteMenu, and also for the return type of
dialog box procedures.
2016-04-02 14:21:54 +01:00
Simon Tatham 00960d8695 Windows: condition setprocessacl() on lack of -DNO_SECURITY.
We also have the special-purpose -DUNPROTECT to disable just the ACL
changes, but if you want to compile without any Windows security API
support at all (e.g. experimentally building against winelib) then
it's easier not to have to specify both defines separately.
2016-04-02 14:21:54 +01:00
Simon Tatham 8730ed5297 Windows: compile with /D_CRT_SECURE_NO_WARNINGS.
With all due respect to Microsoft, a cross-platform program simply
cannot switch to using MS's assorted 'secure' versions of standard C
functions if it wants to continue compiling on platforms other than
Windows. So I might as well squash the warnings, so that any other
more interesting compiler warnings can avoid being swamped in the
mess.
2016-04-02 14:21:54 +01:00
Jacob Nevins 16dfefcbde Stop supporting fallback between SSH versions.
The UI now only has "1" and "2" options for SSH protocol version, which
behave like the old "1 only" and "2 only" options; old
SSH-N-with-fallback settings are interpreted as SSH-N-only.

This prevents any attempt at a protocol downgrade attack.
Most users should see no difference; those poor souls who still have to
work with SSH-1 equipment now have to explicitly opt in.
2016-04-02 12:46:04 +01:00
Simon Tatham 43f1aa01cd Provide a separate post-install README for MSI.
The old README.txt instructed you to manually update PATH if you
wanted to run pscp from a command prompt. But the MSI installer can do
that automatically, so the wording needs tweaks. And now that we're
actually launching README (at least optionally) from the installer UI,
it's more important to not make it look silly.
2016-04-02 08:26:26 +01:00
Simon Tatham 1620aef7c6 MSI installer: offer to display the README file after install.
This is a thing that the Inno Setup installer did, and that I didn't
get round to replicating when I rushed out the initial MSI in a hurry.

I've checked that this doesn't prevent unattended installation by
administrators: running 'msiexec /q /i putty-whatever.msi' as
administrator still installs silently after this change, without
popping up the README unexpectedly on anyone's desktop as a side
effect.

(I _think_ - but I'm still a long way from an MSI expert - that that's
because /q turns off the whole UI part of the MSI system, and the
loading of README is actually triggered by the transition away from
the final UI dialog box, which we now never visit in the first place.)
2016-04-02 08:26:26 +01:00
Simon Tatham 8c0104ca0a MSI installer: turn the desktop icon off by default.
I rushed out the MSI in too much of a hurry to sort out this kind of
thing, but now we've got leisure to reconsider, I think it's better
behaviour not to clutter everyone's desktops unless specifically asked
to.
2016-04-02 08:26:22 +01:00
Simon Tatham 57477cb7ca Warn about short RSA/DSA keys in PuTTYgen.
It's only a warning; Windows PuTTYgen puts it up as a message box, and
will still generate the key if you click yes, and Unix PuTTYgen just
prints the warning and gets on with generation anyway. But it might
help encourage people to move away from 1024-bit keys, if they're
still using them.
2016-04-02 08:26:21 +01:00
Simon Tatham b0b5d5fbe6 Extend ACL-restriction to all Windows tools.
Protecting our processes from outside interference need not be limited
to just PuTTY: there's no reason why the other SSH-speaking tools
shouldn't have the same treatment (PSFTP, PSCP, Plink), and PuTTYgen
and Pageant which handle private key material.
2016-04-02 08:00:07 +01:00
Simon Tatham b4202c917a Fix a potential time-wraparound issue in pinger.c.
A compiler warning drew my attention to the fact that 'next' in
pinger_schedule() was an int, not the unsigned long it should have
been. And looking at the code that handles it, it was also taking no
care with integer wraparound when checking whether an existing
scheduled ping should be moved forward.

So now I do something a bit more robust, by remembering what time it
_was_ when we set pinger->next, and checking if the new time value
falls in the interval between those two times.
2016-04-02 07:51:24 +01:00
Simon Tatham 46051027fb Add a missing #include.
winshare.c uses make_private_security_descriptor(), but wasn't
including winsecur.h where it's declared.
2016-04-01 19:57:00 +01:00
Simon Tatham 7f3c956ed1 cmdgen: refuse to generate RSA/DSA keys under 256 bits.
This replicates the existing error message in Windows PuTTYgen, on the
basis that keys smaller than that will actually fail to work with our
signing code.
2016-03-30 11:41:43 +01:00
Simon Tatham 2a47ac3ac5 Cleanup: rename Windows PuTTYgen's key generation function.
It's been a generation function for keys in general for yonks, not
just RSA keys specifically.
2016-03-30 11:28:59 +01:00
Simon Tatham a22e43d3d8 Add a file of extra bignum tests.
I generated these as a by-product of using afl-fuzz on the testbn
executable. I'd hoped it would find interesting bugs in the bignum
code itself, but in fact it mostly found bugs in the parsing code in
the test main(). However, even so, it did produce a list of tests
which reach as much of the code as afl-fuzz was able to, and that
seems like a useful thing to save.

Also, of course, just having a place to put explicitly specified
bignum tests is a good thing anyway, because then we can put
regression tests on the end of it every time we fix bugs.
2016-03-30 08:45:21 +01:00
Simon Tatham 3e40566bb0 cmdgen: rescue test suite from bit rot.
cmdgen.c has contained code for ages to build a test main() if you
compile with -DTEST_CMDGEN. But it's painful to do so manually, since
you've still got to link in all the same supporting objects, and also
nobody can have actually done that for a while because the stub test
code hasn't been kept up to date with changes in the internal APIs
(specifically prompt_t).

Now we have the ability to include our test programs in Recipe as [UT]
or [XT] so as to leave them out of 'make install', that seems like a
useful thing to do with cmdgen's test suite. So here's a Recipe change
that builds it as 'cgtest', plus fixes for compiler warnings and bit
rot. Pleasantly, the test suite still _passes_ after those are fixed.
2016-03-30 08:34:14 +01:00
Simon Tatham 435b29da88 cmdgen: option to specify the random number device to use.
E.g. you might pass '--random-device=/dev/urandom'.

Mostly because I got sick of waiting for /dev/random to finish
blocking while I was trying to generate throwaway keys for testing bug
fixes in cmdgen itself. But it might also be useful on systems that
call their random device by a different name that we haven't
encountered.

(Since cmdgen also reads the saved PuTTY random seed file, setting
this option to /dev/zero will not render key generation deterministic.
It's tempting to provide _some_ way to do that, for testing purposes
and clearly marked as dangerous of course, but I think it would take
more faff than this.)
2016-03-30 08:30:40 +01:00
Simon Tatham ad87950539 Rework window geometry to avoid using geometry_widget.
Partly this is because the geometry_widget functionality is going away
in a later version of GTK3, so sooner or later we'll need not to be
using it anyway. But also, it turns out that GTK 3's geometry
calculations have the unfortunate effect of setting the window's base
and min heights to values that are not congruent mod height_increment
(because the former is the value we gave, but the latter is based on
the minimum height of the scrollbar), which confuses at least one
window manager (xfwm4) and causes the window to be created one row too
small.

So I've redone all the geometry computations my own way, based on the
knowledge that the only widgets visible in the top-level window are
the drawing area and the scrollbar and I know how both of those
behave, and taking care to keep base_height and min_height congruent
to avoid that xfwm4 bug.
2016-03-29 13:57:10 +01:00
Jacob Nevins df93419ae5 More modern examples of ports we don't have. 2016-03-28 19:18:46 +01:00
Jacob Nevins a1e622523e Remove call for help with a Windows 3 port.
I think that in fact we would not welcome this at this point in time.
2016-03-28 19:18:46 +01:00
Jacob Nevins 03cf73ac01 We will soon have Pageant for Unix. 2016-03-28 19:18:46 +01:00
Jacob Nevins 17377cfa82 Tweaks re Mac elsewhere in FAQ after bb6dd98. 2016-03-28 19:18:46 +01:00
Jacob Nevins f4713d37b8 Tweak Unix bits of FAQ after 776a31b. 2016-03-28 19:18:41 +01:00
Jacob Nevins c755999a95 Fix punctuation. 2016-03-28 17:24:23 +01:00
Simon Tatham 776a31b7da Remove the warning about Unix PuTTY being Linux-specific.
Since I've been building it on OS X recently, I think it's fair to say
it can now cope with reasonable variation in pty APIs and the like.
2016-03-27 20:25:59 +01:00
Simon Tatham 7fdcb804a8 Update Visual Studio versions in README.
VC6 is hopefully long gone, and I've recently been testing on more
up-to-date versions.
2016-03-27 20:25:09 +01:00
Simon Tatham caaaf686f5 Mention the Secure Contact Key on the Feedback page.
Both in a new section about reporting vulnerabilities, and in the
section about large attachments (since some large attachments will
surely contain confidential information from the sender).
2016-03-27 20:20:03 +01:00
Simon Tatham c5021a121b Update docs and FAQ for current DSA policy.
I think the deterministic DSA system we've been using for ages can now
be considered proven in use, not to mention the fact that RFC 6979 and
the Ed25519 spec both give variants on the same idea. So I've removed
the 'don't use DSA if you can avoid it' warning.
2016-03-27 20:10:56 +01:00
Simon Tatham 31d48da317 Decide on a position for ChaCha20-Poly1305.
Previously, due to confusion, it was placed either at the end of the
list or at the start, depending on whether the user had any saved
configuration at all. Now we get to choose a sensible place for it in
the list, and for the moment I think second place behind AES is
reasonable.
2016-03-27 20:07:53 +01:00
Simon Tatham ddb1fc15a1 Fix relative positioning between two new elements in gprefs().
It was only prepared to position a new element relative to an existing
one if the latter was specified in the saved configuration, not if the
latter was another element new to this run of gprefs(). This wasn't
deliberate at all: it was just due to me failing to update the 'seen'
bitmap in the loop adding new elements.
2016-03-27 20:06:33 +01:00
Simon Tatham 940a82fd37 Special host key warning when a better key exists.
If you're connecting to a new server and it _only_ provides host key
types you've configured to be below the warning threshold, it's OK to
give the standard askalg() message. But if you've newly demoted a host
key type and now reconnect to some server for which that type was the
best key you had cached, the askalg() wording isn't really appropriate
(it's not that the key we've settled on is the first type _supported
by the server_, it's that it's the first type _cached by us_), and
also it's potentially helpful to list the better algorithms so that
the user can pick one to cross-certify.
2016-03-27 18:20:37 +01:00