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

7111 Commits

Author SHA1 Message Date
Jacob Nevins
4eb089f601 Tweak another certified-host-key-prompt.
Like 5f3b743eb0, specifically reassure the user that taking the
add-to-cache action will not cause the CA that signed the key to be
trusted in any wider context, in the case where there was no previous
certified key cached. (I don't know why I missed this out before.)

(cherry picked from commit 9209c7ea38)
2023-04-19 14:19:34 +01:00
Jacob Nevins
b760a2a040 Use correct date in cert check error.
When a host certificate was used outside its valid date range, we were
displaying the current time where we meant to show the relevant bound of
the validity range.

(cherry picked from commit 68db3d195d)
2023-04-19 14:19:34 +01:00
Jacob Nevins
4d888d1ff4 Docs: fix typo in SUPDUP section.
(cherry picked from commit f78a1a944f)
2023-04-19 14:19:34 +01:00
Simon Tatham
5678b4c7cf Windows: fix terminal hang with resize forbidden.
A server attempt to resize the window (for instance via DECCOLM) when
"When window is resized" was set to "Forbid resizing completely" would
cause all terminal output to be suspended, due to the resize attempt
never being acknowledged.

(There are other code paths like this, which I've fixed for
completeness, but I don't think they have any effect: the terminal
filters out resize attempts to the current size before this point, and
even if a server can get such a request through the SUPDUP protocol, the
test for that is wrong and will never fire -- this needs fixing
separately.)

(cherry picked from commit ebceb8bc94)
2023-04-19 14:19:22 +01:00
Jacob Nevins
01b4fb746c Docs: add a 'pdf' cmake target.
We still don't build or ship a PDF PuTTY manual by default, but we may
as well conveniently expose Halibut's ability to do so.

(I don't guarantee the resulting PDF is particularly pretty -- some of
our overlong code lines do go off the right margin currently.)

(cherry picked from commit f9a8213d95)
2023-04-19 14:18:58 +01:00
Simon Tatham
32e5215129 Some checklist updates for the Windows Store.
I didn't actually get these things wrong during the submission of
0.78, but I did notice that I'd forgotten to write them down.

(cherry picked from commit d39bcaedba)
2023-04-19 14:18:58 +01:00
Jacob Nevins
fe11c1e498 authplugin-example.py: Flush stderr.
Python 3's stderr was fully-buffered when non-interactive, unlike
Python 2 and more or less everything else, until 3.9 in 2020(!):
https://bugs.python.org/issue13601

(It would be less faff to sys.stderr.reconfigure(line_buffering=True)
at the start, but that was only added in 3.7, whereas the 'flush'
argument to print() dates back to 3.3, so I chose that to minimise
the risk of version dependencies getting in the way of using this as
a working example.)

(cherry picked from commit 329a4cdd79)
2023-04-19 14:18:58 +01:00
Jacob Nevins
5a50288718 authplugin-example.py: Mention documentation.
(Just in case anyone's entry point is this example, and concludes they
have to reverse-engineer the protocol from the script.)

(cherry picked from commit 538c8fd29c)
2023-04-19 14:18:58 +01:00
Simon Tatham
7398dfa3fc Remove a pointless allocation.
The char buffer 'blob' allocated in read_blob was never actually used
for anything, so there was no need to allocate it - and also no need
for the assert() just before it, which was added in commit
63a58759b5 to be extra safe against integer overflow when
computing the buffer size.

I feel a bit silly for having added that assertion in the first place
rather than removing the allocation it was protecting! It was
unnecessary even then, and I completely failed to notice :-)

(cherry picked from commit c780cffb7a)
2023-04-19 14:18:58 +01:00
Simon Tatham
b8d40c7ae8 Checklist updates for pre-release setup.
I don't know why I never bothered to write it down before, but it's a
good idea to let a pre-release build actually *happen* between turning
them on and updating the website to claim they exist.

Also, for the first time ever, I've just sent out an announcement
email for the 0.78 *pre-releases*, soliciting testing in advance of
the actual release. So, add that to the checklist as well.

(cherry picked from commit 1a3655013d)
2023-04-19 14:18:58 +01:00
Simon Tatham
4ff82ab29a Update version number for 0.78 release. 2022-10-28 18:19:19 +01:00
Simon Tatham
475c23875e Unix: stop accessing ctrl->fileselect for font selectors.
The setup code for CTRL_FILESELECT and CTRL_FONTSELECT is shared,
which means it's a mistake to test ctrl->fileselect.just_button in it
without first checking which control type we're actually dealing with.

UBsan picks this up by complaining that the just_button field contains
some byte value that's illegal for a boolean. I think it's also the
cause of an intermittent assertion failure reported recently, in which
dlg_fontsel_set finds that uc->entry is NULL when it never ought to
be. If the byte from the wrong union branch happened to be 0 by sheer
bad luck, that could give rise to exactly that failure.
2022-10-28 17:49:59 +01:00
Simon Tatham
a7106d8eb2 Add missing initialisation of term->osc_strlen.
An uninitialised value could have got as far as do_osc() via the
relatively recent code path for early termination of an OSC before
it's fully set up.
2022-10-23 17:45:51 +01:00
Simon Tatham
bdb3ac9f3b Restrict -pwfile / -pw to apply to server prompts only.
Jacob spotted that an unused -pwfile input can be accidentally used as
the answer to Plink's antispoof 'press Return to begin session'
prompt, which is unintended and confusing.

To fix that, I've made the use of a command-line password conditional
on p->to_server, the flag in a prompts_t that indicates whether the
results of the prompts are going to be sent directly to the server or
consumed locally by PuTTY. (And I've also corrected the setting of
to_server in the antispoof prompt, which was true when it should have
been false.)

A side effect of this is that -pwfile will no longer work to provide a
private-key passphrase, if you're using public-key authentication
without Pageant. This is deliberate, because if you're doing that on
purpose then Pageant is a better way to achieve the same thing (or
else just store the key unencrypted, which is no worse); but in the
case of a server that sequentially demands public-key _and_ password
authentication, the new behaviour makes -pwfile apply to the right one
of the two prompts, i.e. the actual password.
2022-10-23 14:13:55 +01:00
Jacob Nevins
2fbb9284f3 Fix outdated comment relating to -pw. 2022-10-23 12:38:00 +01:00
Jacob Nevins
f7e86ca267 README: remove mention of doc/Makefile.
While cmake might create it, it's not something we ship any more.

This is a combined cherry-pick of:
  afebe8027f
  f229aab20c
2022-10-23 12:37:20 +01:00
Simon Tatham
0c59d49683 Update the pre-release-candidate testing checklist.
Removed 'try cmake 3.7 on Windows': I think that's not really
necessary, because Windows doesn't have the concept of an old overall
distro that makes it hard to upgrade a particular build tool.

On the other hand, added a big pile of other things I'd like not to
forget.
2022-10-22 08:23:06 +01:00
Simon Tatham
d2795e5cb5 Fix build with GTK3 prior to 3.22.23.
Those versions of GTK (or rather, GDK) don't support the
GDK_WINDOW_STATE_TOP_TILED constants; they only support the
non-directional GDK_WINDOW_STATE_TILED. And GTK < 3.10.0 doesn't even
support that.

All those constants were under #ifdef already; I've just made the
ifdefs a bit more precise.
2022-10-22 07:48:56 +01:00
Jacob Nevins
75ac444324 Document subdomain matching of cert expr wildcards.
In the manual, in comments, and in a new test.
2022-10-22 01:22:10 +01:00
Jacob Nevins
500568d204 Docs: fix trivial typo from 6472f7fc77. 2022-10-22 00:20:03 +01:00
Jacob Nevins
5f3b743eb0 Tweak certified-host-key prompt.
Add a specific reassurance that taking the add-to-cache action will not
cause the CA that signed the key to be trusted in any wider context.
2022-10-21 20:41:37 +01:00
Jacob Nevins
344cde8ded Windows host-key warning: reinstate shortcut.
The "Cancel" button's keyboard shortcut was accidentally removed by
f1c8298000, having only just reinstated it in a77040afa1.

(Also, fix a couple of blatantly fibbing "accelerators used" comments.)
2022-10-21 20:41:36 +01:00
Jacob Nevins
bb1ebc9b57 Docs: tweak certified-host-key warning responses.
Mainly to try to clarify that if you're sat at this warning dialog/
prompt, no response you make to it will cause a new CA to be trusted for
signing arbitrary host keys.
2022-10-21 20:12:23 +01:00
Jacob Nevins
5716c638a5 Docs: cross-reference host-key warning sections.
The 'certified host key' variant of the host key warning always comes
with a scary 'POTENTIAL SECURITY BREACH!' message. So the error message
section with the scary title that should acknowledge that variant, and
the section about that variant should mention the scary warning.
2022-10-21 19:46:51 +01:00
Jacob Nevins
8c534c26fd Docs: note "wrong host key" warning is stronger.
To try to prime readers learning the often-seen "unknown host key"
warning to recognise the rarer and scarier "wrong host key" warning, if
they see it.
2022-10-21 19:43:26 +01:00
Jacob Nevins
1d1d81d66e Fix regressions in Gtk host key "More info".
A description like "SHA256 fingerprint:" could run into the previous
public key blob; and add a missing colon.
2022-10-21 19:01:58 +01:00
Jacob Nevins
dc9ab5e0f0 Rename NTRU Prime / Curve25519 kex in UI.
The previous name, which included '(quantum-resistant)', was too long to
be completely seen in the Windows config dialog's kex list (which is
narrower than the Gtk one, due to the Up/Down buttons). No point
including that explanation if people can't actually read it, so we'll
have to rely on docs to explain it.

(I did try squashing the rest of the name to "SNTRUP/X25519 hybrid", but
that wasn't enough.)

As some sort of compensation, index it more thoroughly in the docs, and
while I'm there, tweak the indexing of other key exchange algorithms
too.
2022-10-21 17:53:24 +01:00
Jacob Nevins
6472f7fc77 Docs: update Pageant key list description.
GUI Pageant stopped using SSH identifiers for key types in fea08bb244,
but the docs were still referring to them.

As part of this, ensure that the term "NIST" is thoroughly
cross-referenced and indexed, since it now appears so prominently in
Pageant.

(While I'm there, reword the "it's OK that elliptic-curve keys are
smaller than RSA ones" note, as I kept tripping over the old wording.)
2022-10-21 13:04:57 +01:00
Jacob Nevins
5d5a6a8fd3 Docs: MD5 is forced for SSH-1 key fingerprints. 2022-10-21 13:04:41 +01:00
Jacob Nevins
d42983088a Docs: prime generation defaults are usually fine. 2022-10-21 13:02:36 +01:00
Jacob Nevins
2b5b7b5c45 Docs: note warning about <2048-bit RSA/DSA keys. 2022-10-21 12:52:27 +01:00
Jacob Nevins
617bf732bd Docs: PuTTYgen: fix gratuitous exclusion of PSFTP. 2022-10-21 12:52:27 +01:00
Jacob Nevins
1195073925 Docs: add index alias for "ECDSA". 2022-10-21 12:47:39 +01:00
Jacob Nevins
4af8a585e7 cmdgen: Fix docs and usage messages.
Some new cert-related stuff wasn't documented in the usage message
and/or man page; and the longer-standing "-E fptype" was entirely
omitted from the usage message.
2022-10-20 23:55:19 +01:00
Jacob Nevins
25ac012c40 Document Windows PuTTYgen "-t ed25519" / "ed448". 2022-10-20 23:42:21 +01:00
Jacob Nevins
044e4217f3 Windows PuTTYgen: fit cert info values in dialog.
(When an item is too long, as "Fingerprint including certificate" often
is, you can at least drag the control to see all of the content.)
2022-10-20 23:25:34 +01:00
Jacob Nevins
68c97fb22a Fix installing man pages from our tarballs.
As of the cyclic-dependency fix in b01173c6b7, building from our tarball
using the instructions in its README (using the source tree as build
tree), in the absence of Halibut, would lead to the pre-built man pages
not being installed.
(Also, a load of "Could not build man page" complaints at cmake
generation time, which is how I actually noticed.)
2022-10-19 20:08:09 +01:00
Simon Tatham
2222cd104d AES-GCM NEON: cope with missing vaddq_p128.
In some compilers (I'm told clang 10, in particular), the NEON
intrinsic vaddq_p128 is missing, even though its input type poly128_t
is provided.

vaddq_p128 is just an XOR of two vector registers, so that's easy to
work around by casting to a more mundane type and back. Added a
configure-time test for that intrinsic, and a workaround to be used in
its absence.
2022-10-12 20:01:58 +01:00
Simon Tatham
0615767224 Windows installer: remove explicit InstallScope setting.
It turns out this isn't actually necessary after all to make the
installer behave in the expected way in the default case (giving a UAC
prompt and installing systemwide). And I'm told it has undesirable
consequences in more complicated cases, which I'm not expert enough in
MSI to fully understand.
2022-10-12 20:01:17 +01:00
Simon Tatham
9fcfd679b4 Stop trying to include X11 headers in non-GTK builds.
In commit 732ec31a17 I made the check for libX11 conditional on
GTK - but I forgot that if we're building without GTK, I should
_define_ NOT_X_WINDOWS, rather than leaving it undefined. As a result,
the build would fail on files like unix/utils/x11_ignore_error.c.
2022-09-19 20:21:01 +01:00
Simon Tatham
864b4c27fa Use GTK_LDFLAGS when testing for Pango.
On FreeBSD, the GTK libraries aren't stored on the standard library
path, so pkg-config has to emit a -L option as well as -l options.
This worked fine during the main build, but the -L option wasn't being
passed through to check_symbol_exists() for the tests of Pango API
function availability.
2022-09-19 11:40:17 +01:00
Simon Tatham
ae2c0d40ae setpgrp cmake check: use #if, not #if defined.
I still haven't got out of the habit of doing this the autotools way,
which doesn't work in cmake. cmake's HAVE_FOO variables are always
defined, and they take values 0 or 1, so testing them with 'defined'
will return the wrong value.
2022-09-19 11:40:12 +01:00
Simon Tatham
fda41e1990 Add cmake check for whether setpgrp takes arguments.
FreeBSD declares setpgrp() as taking two arguments, like Linux's
setpgid(). Detect that at configure time and adjust the call in
Pageant appropriately.
2022-09-18 15:08:31 +01:00
Simon Tatham
732ec31a17 Add explicit cmake setting for 'build without GTK'.
If you have GTK installed on your system but want to build without it
anyway (e.g. if you're buliding a package suitable for headless
systems), it's useful to be able to explicitly instruct PuTTY's build
system not to use GTK even if it's there.

This would already work if you unilaterally set PUTTY_GTK_VERSION to
some value other than 1, 2, 3 or ANY. Added NONE as an officially
supported option, and included it in the list that cmake-gui will
present.

Also, made the check for libX11 conditional on having GTK, since
there's no need to bother with it otherwise.
2022-09-18 15:02:32 +01:00
Simon Tatham
a95e38e9b1 GSSAPI fix: don't pass GSS_C_NO_NAME to inquire_cred_by_mech.
This was pointed out by another compiler warning. The 'name' parameter
of inquire_cred_by_mech is not a gss_name_t (which is the type of
GSS_C_NO_NAME); it's a gss_name_t *, because it's an _output_
parameter. We're not telling the library that we aren't _passing_ a
name: we're telling it that we don't need it to _return_ us a name. So
the appropriate null pointer representation is just NULL.

(This was harmless apart from a compiler warning, because gss_name_t
is a pointer type in turn and GSS_C_NO_NAME expands to a null pointer
anyway. It was just a wrongly-typed null pointer.)
2022-09-17 07:55:08 +01:00
Simon Tatham
35a87984f6 Unix GSSAPI: support static linking against Heimdal.
Heimdal provides its own definitions of OIDs like GSS_C_NT_USER_NAME
in the form of macros, which conflict with our attempt to redefine
them as variables - the macro gets expanded into the middle of the
variable declaration, leaving the poor C compiler trying to parse a
non-declaration along the lines of

const_gss_OID (&__gss_c_nt_anonymous_oid_desc) = oids+5;

Easily fixed by just not redefining these at all if they're already
defined as macros. To make that easier, I've broken up the oids[]
array into individual gss_OID_desc declarations, so I can put each one
inside the appropriate ifdef.

In the process, I've removed the 'const' from the gss_OID_desc
declarations. That's on purpose! The problem is that not all
implementations of the GSSAPI headers make const_gss_OID a pointer to
a *const* gss_OID_desc; sometimes it's just a plain one and the
'const' prefix is just a comment to the user. So removing that const
prevents compiler warnings (or worse) about address-taking a const
thing and assigning it into a non-const pointer.
2022-09-17 07:55:08 +01:00
Simon Tatham
374107eb1e Unix static GSSAPI: fix an uninitialised structure field.
When linking statically against Kerberos, the setup code in
ssh_got_ssh_version() was trying to look up want_id==0 in the list of
one GSSAPI library, but unfortunately, the id field of that record was
not initialised at all, so if it happened to be nonzero nonsense, the
loop wouldn't find a library at all and would fail an assertion.
2022-09-17 07:55:05 +01:00
Simon Tatham
b0a61849ef Unix GSSAPI: support krb5-config as well as pkg-config.
On FreeBSD, I'm told, you can't configure Kerberos via pkg-config. So
we need a fallback. Here's some manual code to run krb5-config and
pick apart the result, similar to what I already did with gtk-config
for our (still not dead!) GTK 1 support.
2022-09-17 07:53:43 +01:00
Jacob Nevins
e1b73f0d54 New FAQ entry about the Microsoft Store. 2022-09-13 23:51:26 +01:00
Simon Tatham
c1a4eda9f6 GSSAPI kex: don't call dh_is_gex() on ECDH algorithms.
dh_is_gex() expects to find a 'struct dh_extra' in the 'extra' field
of the kex_alg you pass in, and won't look kindly on finding an
instance of some totally different structure type. We were being
careful about that everywhere in the GSSAPI kex code except for the
final free step.
2022-09-13 20:53:03 +01:00