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

849 Commits

Author SHA1 Message Date
Simon Tatham
e52087719c Documentation for OpenSSH certificates.
Also I've filled in the help contexts in all the new GUI controls.
2022-08-07 18:44:11 +01:00
Jacob Nevins
1952519c60 Update Unix build instructions in FAQ.
(Bit late, but never mind.)
2022-05-27 11:07:04 +01:00
Simon Tatham
ec4e414d49 Merge tag '0.77' 2022-05-27 09:10:35 +01:00
Jacob Nevins
3af153b6fb We're unlikely to spend donations on Windows XP. 2022-05-25 01:18:21 +01:00
Jacob Nevins
7b2b116f27 FAQ: cross-reference command-line docs. 2022-05-25 01:17:57 +01:00
Jacob Nevins
55b53923d6 Tweak the "PSCP filenames with spaces" FAQ.
These days it's overwhelmingly likely that SFTP will be in use, so deal
with that case first.
2022-05-25 01:16:31 +01:00
Jacob Nevins
7e65b705f1 Acknowledge existence of Windows 11.
(PuTTY has been seen running on it.)
2022-05-25 00:41:58 +01:00
Jacob Nevins
e94699ae56 Remove reference to Bugtraq.
(Rather showing our age...)
2022-05-25 00:39:21 +01:00
Simon Tatham
61ab33efe4 Update version number for 0.77 release. 2022-05-24 17:53:18 +01:00
Jacob Nevins
04311767fa Merge docs and icon fixes from 'pre-0.77'. 2022-05-20 19:35:17 +01:00
Jacob Nevins
2985383c0b Indexing for Windows Pageant command-line options. 2022-05-20 19:33:31 +01:00
Jacob Nevins
98a213e832 Document Windows PuTTYgen's -E option.
This was missed in 11aa9ab8f3.
2022-05-20 13:28:01 +01:00
Jacob Nevins
1dfa0f538b Update proxy docs to reflect recent changes.
For new UI in 2a26ebd0d5, and new features added in 6f7c52dcce.
2022-04-29 19:03:26 +01:00
Jacob Nevins
3b3df6b60d Merge proxy docs tweaks from 'pre-0.77'. 2022-04-29 18:49:32 +01:00
Jacob Nevins
1088080cdd Tweaks to proxy documentation. 2022-04-29 18:48:55 +01:00
Simon Tatham
d73a6d6f06 Merge GSSAPI/DNS docs addition from 'pre-0.77'. 2022-02-22 18:45:51 +00:00
Simon Tatham
0613ec9986 Add a docs note about DNS performed by GSSAPI.
I recently noticed a mysterious delay at connection startup while
using an SSH jump host, and investigated it in case it was a bug in
the new jump host code that ought to be fixed before 0.77 goes out.

strace showed that at the time of the delay PuTTY was doing a DNS
lookup for the destination host, which was hanging due to the
authoritative DNS server in question not being reachable. But that was
odd, because I'd configured it to leave DNS lookup to the proxy,
anticipating exactly that problem.

But on closer investigation, the _proxy_ code was doing exactly what
I'd told it. The DNS lookup was coming from somewhere else: namely, an
(unsuccessful) attempt to set up a GSSAPI context. The GSSAPI library
had called gethostbyname, completely separately from PuTTY's own use
of DNS.

Simple workaround for me: turn off GSSAPI, which doesn't work for that
particular SSH connection anyway, and there's no point spending 30
seconds faffing just to find that out.

But also, if that puzzled me, it's worth documenting!
2022-02-22 18:44:48 +00:00
Simon Tatham
6f8db22972 Windows Pageant: option to open an AF_UNIX socket.
There's now a command-line option to make Pageant open an AF_UNIX
socket at a pathname of your choice. This allows it to act as an SSH
agent for any client program willing to use a WinSock AF_UNIX socket.

In particular, this allows WSL 1 processes to talk directly to Windows
Pageant without needing any intermediate process, because the AF_UNIX
sockets in the WSL 1 world interoperate with WinSock's ones.

(However, not WSL 2, which isn't very surprising.)
2022-02-05 12:58:41 +00:00
Jacob Nevins
ca62d67699 Update usage messages embedded in docs.
For changes in 44ee7b9e76.
2022-01-27 15:04:37 +00:00
Simon Tatham
9d687e4177 Pageant docs: improve the new OpenSSH section.
I tried setting this up on a different Windows machine today and had
some slightly different experiences. I found that in at least some
situations the command 'Include c:\...\pageant.conf' will cause
OpenSSH to emit a log message saying it's trying to open the file
'~/.ssh/c:\...\pageant.conf', which it then doesn't find. But 'Include
pageant.conf' works, because that's interpreted relative to the .ssh
directory that it's already found.

(I don't know why this happened on one Windows machine and not
another, since I only have a sample size of two. But an obvious guess
would be a bug fix in the Windows OpenSSH port, present in the version
on one of the machines I tried, and not in the other. Certainly that
failure mode looks to me like 'apply Unix instead of Windows rules to
decide what's an absolute pathname'.)

Also, clarified that all of this only works with the version of
OpenSSH that's available as a Windows optional feature, and not with
the MSYS-based one that ships with Windows git.
2022-01-26 19:59:19 +00:00
Simon Tatham
f11b20156b Windows PuTTYgen docs: remove redundant text.
When I was writing the documentation for the new command-line options,
I wondered why there was an existing section for the corresponding GUI
setting for each option I'd added except strong primes. Now I've found
it: strong primes are discussed in the same section as prime-
generation methods. So I can replace the second explanation with a
cross-reference.
2022-01-22 16:45:29 +00:00
Simon Tatham
575318717b Remove the prohibition on // comments.
Those were forbidden so that we could still compile on pre-C99 C
compilers. But now we expect C99 everywhere (or at least most of it,
excluding the parts that MSVC never implemented and C11 made
optional), so // comments aren't forbidden any more.

Most of the comments in this code base are still old-style, but that's
now a matter of stylistic consistency rather than hard requirement.
2022-01-22 15:53:24 +00:00
Simon Tatham
5935c68288 Update source file names in comments and docs.
Correcting a source file name in the docs just now reminded me that
I've seen a lot of outdated source file names elsewhere in the code,
due to all the reorganisation since we moved to cmake. Here's a giant
pass of trying to make them all accurate again.
2022-01-22 15:51:31 +00:00
Simon Tatham
e262dab642 udp.but: update description of handle-io system.
It's been so long since Windows Plink kept its stdio subthreads in its
own main source file that I'd forgotten it had ever done so! They've
lived in a separate module for managing Windows HANDLE-based I/O for
ages. That module has recently changed its filename, but this piece of
documentation was so out of date that the old filename wasn't in there
- it was still mentioning the filename _before_ that.
2022-01-22 14:52:46 +00:00
Simon Tatham
cadd86ac49 doc/CMakeLists.txt: reorganise custom targets.
Jacob reported that on Debian buster, the command sequence

  cmake $srcdir
  cmake --build .
  cmake --build . --target doc

would fail at the third step, with the make error "No rule to make
target 'doc/cmake_version.but', needed by 'doc/html/index.html'".

That seems odd, because the file ${VERSION_BUT} _was_ declared as a
dependency of the rule that builds doc/html/*.html, and _cmake_ knew
what rule built it (namely the custom target 'cmake_version_but'). I
suspect this is a bug in cmake 3.13, because the same command sequence
works fine with cmake 3.20.

However, it's possible to work around, by means of adding the cmake
_target name_ to the dependencies for any rule that uses that file,
instead of relying on it to map the output _file_ name to that target.

While I'm at it, I've transformed the rules that build copy.but and
licence.but in the same way, turning those too into custom targets
instead of custom commands (I've found that the former are more
generally reliable across a range of cmake versions), and including
the target names themselves as dependencies.
2022-01-22 14:42:03 +00:00
Jacob Nevins
fafad1b8f6 doc: relevance of 'Host keys' panel to SSH-1.
The documentation claimed that it was entirely for SSH-2, but the
manually-configured host keys part is still useful with SSH-1.
2022-01-16 12:35:24 +00:00
Simon Tatham
8a2883933d Windows Pageant: integrate with Windows OpenSSH.
After a discussion with a user recently, I investigated the Windows
native ssh.exe, and found it uses a Windows named pipe to talk to its
ssh-agent, in exactly the same way Pageant does. So if you tell
ssh.exe where to find Pageant's pipe, it can talk directly to Pageant,
and then you can have just one SSH agent.

The slight problem is that Pageant's pipe name is not stable. It's
generated using the same system as connection-sharing pipe names, and
contains a hex hash value whose preimage was fed through
CryptProtectData. And the problem with _that_ is that CryptProtectData
apparently reinitialises its seed between login sessions (though it's
stable within a login session), which I hadn't fully realised when I
reused the same pipe-name construction code.

One possibility, of course, would be to change Pageant so that it uses
a fixed pipe name. But after a bit of thought, I think I actually like
this feature, because the Windows named pipe namespace isn't
segregated into areas writable by only particular users, so anyone
using that namespace on a multiuser Windows box is potentially
vulnerable to someone else squatting on the name you wanted to use.
Using this system makes that harder, because the squatter won't be
able to predict what the name is going to be! (Unless you shut down
Pageant and start it up again within one login session - but there's
only so much we can do. And squatting is at most a DoS, because
PuTTY's named-pipe client code checks ownership of the other end of
the pipe in all cases.)

So instead I've gone for a different approach. Windows Pageant now
supports an extra command-line option to write out a snippet of
OpenSSH config file format on startup, containing an 'IdentityAgent'
directive which points at the location of its named pipe. So you can
use the 'Include' directive in your main .ssh/config to include this
extra snippet, and then ssh.exe invocations will be able to find
wherever the current Pageant has put its pipe.
2022-01-15 18:54:31 +00:00
Simon Tatham
11aa9ab8f3 Windows PuTTYgen: support cmdgen's key-type and PPK options.
This imports the following options from command-line PuTTYgen, which
all correspond to controls in Windows PuTTYgen's GUI, and let you set
the GUI controls to initial values of your choice:

  -t <key type>
  -b <bits>
  -E <fingerprint type>
  --primes <prime gen policy>
  --strong-rsa
  --ppk-param <KDF parameters or PPK version etc>

The idea is that if someone generates a lot of keys and has standard
non-default preferences, they can make a shortcut that passes those
preferences on the command line.
2022-01-15 18:54:07 +00:00
Jacob Nevins
91806dfbb7 A few tweaks to SSH proxy docs. 2022-01-12 01:16:53 +00:00
Jacob Nevins
7843b428ad docs: Correct proven-primes side channel risk.
After reading Simon's wishlist write-up 'rsa-gen-side-channels'.
2022-01-12 01:15:55 +00:00
Jacob Nevins
16ead30c0f Update docs for new host key prompts.
The message wording changed in d1dc1e927c.
2022-01-11 23:57:39 +00:00
Jacob Nevins
e7b9eea786 udp: Tweak for new source structure.
There are lots of subdirectories now besides 'windows' and 'unix'.
2022-01-11 23:57:39 +00:00
Jacob Nevins
1ca557a29b udp: Correct name of ProxySocket type in example.
(I don't think this type has ever been called 'Proxy'.)
2022-01-11 23:57:39 +00:00
Jacob Nevins
c78226a711 udp: Coroutines are used in more than just SSH. 2022-01-11 23:57:39 +00:00
Jacob Nevins
39d1515ea6 Note side-channel resistance of probable primes.
This came in around d8fda3b6da.
2022-01-11 23:57:20 +00:00
Jacob Nevins
f0162af6a5 doc: Index 'DSS'. 2022-01-11 23:57:05 +00:00
Simon Tatham
4ecb40a60d Fix a batch of typos in comments and docs. 2022-01-03 06:40:51 +00:00
Simon Tatham
f9d0557330 Update proxy documentation.
This update covers several recently added features: SSH proxying, HTTP
Digest proxy auth, and interactive prompting for proxy auth in general.

Also, downplayed the use of 'plink -nc' as a Local-type proxy command.
It still works, but it's no longer the recommended way of tunnelling
SSH over SSH, so there's no need to explain it quite so
enthusiastically.
2021-12-30 11:52:51 +00:00
Simon Tatham
b94bdac931 Document Cygwin as a use case for psusan.
I have _no_ idea how I managed to leave this out of the list of
examples when I first wrote this man page. It should have been the
very first one I thought of, since Cygwin was the platform I wrote
cygtermd for, and one of psusan's primary purposes was to be a
productised and improved replacement for cygtermd!

Oh well, better late than never.
2021-12-29 16:38:06 +00:00
Simon Tatham
5eee8ca648 Compatibility with older versions of cmake.
After this change, the cmake setup now works even on Debian stretch
(oldoldstable), which runs cmake 3.7.

In order to support a version that early I had to:

 - write a fallback implementation of 'add_compile_definitions' for
   older cmakes, which is easy, because add_compile_definitions(FOO)
   is basically just add_compile_options(-DFOO)

 - stop using list(TRANSFORM) and string(JOIN), of which I had one
   case each, and they were easily replaced with simple foreach loops

 - stop putting OBJECT libraries in the target_link_libraries command
   for executable targets, in favour of adding $<TARGET_OBJECTS:foo>
   to the main sources list for the same target. That matches what I
   do with library targets, so it's probably more sensible anyway.

I tried going back by another Debian release and getting this cmake
setup to work on jessie, but that runs CMake 3.0.1, and in _that_
version of cmake the target_sources command is missing, and I didn't
find any alternative way to add extra sources to a target after having
first declared it. Reorganising to cope with _that_ omission would be
too much upheaval without a very good reason.
2021-10-29 18:08:18 +01:00
Simon Tatham
b13f3d079b New function-key mode similar to modern xterm.
This is the same as the previous FUNKY_XTERM mode if you don't press
any modifier keys, but now Shift or Ctrl or Alt with function keys
adds an extra bitmap parameter. The bitmaps are the same as the ones
used by the new SHARROW_BITMAP arrow key mode.
2021-10-23 11:31:09 +01:00
Simon Tatham
22911ccdcc New config option for shifted arrow key handling.
This commit introduces a new config option for how to handle shifted
arrow keys.

In the default mode (SHARROW_APPLICATION), we do what we've always
done: Ctrl flips the arrow keys between sending their most usual
escape sequences (ESC [ A ... ESC [ D) and sending the 'application
cursor keys' sequences (ESC O A ... ESC O D). Whichever of those modes
is currently configured, Ctrl+arrow sends the other one.

In the new mode (SHARROW_BITMAP), application cursor key mode is
unaffected by any shift keys, but the default sequences acquire two
numeric arguments. The first argument is 1 (reflecting the fact that a
shifted arrow key still notionally moves just 1 character cell); the
second is the bitmap (1 for Shift) + (2 for Alt) + (4 for Ctrl),
offset by 1. (Except that if _none_ of those modifiers is pressed,
both numeric arguments are simply omitted.)

The new bitmap mode is what current xterm generates, and also what
Windows ConPTY seems to expect. If you start an ordinary Command
Prompt and launch into WSL, those are the sequences it will generate
for shifted arrow keys; conversely, if you run a Command Prompt within
a ConPTY, then these sequences for Ctrl+arrow will have the effect you
expect in cmd.exe command-line editing (going backward or forward a
word). For that reason, I enable this mode unconditionally when
launching Windows pterm.
2021-10-18 20:15:35 +01:00
Simon Tatham
44ee7b9e76 Add -pwfile option, a more secure version of -pw.
Similarly to cmdgen's passphrase options, this replaces the password
on the command line with a filename to read the password out of, which
means it can't show up in 'ps' or the Windows task manager.
2021-09-28 18:04:15 +01:00
Simon Tatham
76688f9a0b Docs: insert missing 'inline' in a code example.
In the section about our ad-hoc trait idioms, I described a code
sample as containing a set of 'static inline' wrapper functions, which
indeed it should have done - but I forgot to put the 'inline' keyword
in the code sample itself.
2021-09-07 13:38:14 +01:00
Simon Tatham
22fab78376 Tidy up formatting of manpage cross-references.
In most Halibut man pages I write, I have a standard convention of
referring to another man page by wrapping the page name in \cw and the
section number in \e, leaving the parentheses un-marked-up. Apparently
I forgot in this particular collection.
2021-08-22 12:23:05 +01:00
Simon Tatham
2cb38da6e9 psusan manpage: suggest setsid in UML example.
When UML terminates, it kills its entire process group. The way PuTTY
invokes proxy processes, they are part of its process group. So if UML
is used directly as the proxy process, it will commit patricide on
termination.

Wrapping it in 'setsid' is overkill (it doesn't need to be part of a
separate _session_, only a separate pgrp), but it's good enough to
work around this problem, and give PuTTY the opportunity to shut down
cleanly when the UML it's talking to vanishes.
2021-08-16 22:26:26 +01:00
Simon Tatham
c62b7229c1 Bug workaround to delay sending our SSH greeting.
Ian Jackson recently tried to use the recipe in the psusan manpage for
talking to UML, and found that the connection was not successfully set
up, because at some point during startup, UML read the SSH greeting
(ok, the bare-ssh-connection greeting) from its input fd and threw it
away. So by the time psusan was run by the guest init process, the
greeting wasn't there to be read.

Ian's report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991958

I was also able to reproduce this locally, which makes me wonder why I
_didn't_ notice it when I originally wrote that part of the psusan man
page. It worked for me before, honest! But now it doesn't.

Anyway. The ssh verstring module already has a mode switch to decide
whether we ought to send our greeting before or after waiting for the
other side's greeting (because that decision varies between client and
server, and between SSH-1 and SSH-2). So it's easy to implement an
override that forces it to 'wait for the server greeting first'.

I've added this as yet another bug workaround flag. But unlike all the
others, it can't be autodetected from the server's version string,
because, of course, we have to act on it _before_ seeing the server's
greeting and version string! So it's a manual-only flag.

However, I've mentioned it in the UML section of the psusan man page,
since that's the place where I _know_ people are likely to need to use
this flag.
2021-08-14 11:46:21 +01:00
Simon Tatham
dfb252d161 GPG key rollover.
Following the same pattern as the previous one (commit 6c924ba862),
except that this time, I don't have to _set up_ the pattern in the
front-end code of presenting the current and previous key details -
just change over the actual string literals in putty.h.

But the rest is the same: new keys at the top of pgpkeys.but, old ones
relegated to the historical appendix, key ids in sign.sh switched over.
2021-08-14 08:02:27 +01:00
Simon Tatham
9983ff53d5 psusan manpage: add a PATH to the UML example.
Ian Jackson observes that if PATH is not set in the environment,
current versions of bash will pick a default one that has "." as the
last directory, which is generally considered a terrible idea:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991959

Work around this by specifying a more sensible default in our example
script, per Ian's suggestion in

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991960
2021-08-07 17:08:19 +01:00
Simon Tatham
84175f4aea Merge tag '0.76' into main 2021-07-17 11:49:44 +01:00