Timeline

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

140 check-ins using file pscp.c version 5973595d19

2012-09-18
18:07
Better document the various environments with which Makefile.cyg works. check-in: 4f5cf307a3 user: ben tags: trunk
18:05
Add a new COMPAT option for environments lacking SecureZeroMemory(), rather than explicitly checking for Winelib. It seems that w32api is lacking it as well. check-in: b814cb52ab user: ben tags: trunk
16:50
Allow remote-to-local forwardings to use IPv6. RFC 4245 section 7.1 specifies the meaning of the "address to bind" parameter in a "tcpip-forward" request. "0.0.0.0" and "127.0.0.1" are specified to be all interfaces and the loopback interface respectively in IPv4, while "" and "localhost" are the address-family-agnostic equivalents. Switch PuTTY to using the latter, since it doesn't seem right to force IPv4. There's an argument that PuTTY should provide a means of configuring the address family used for remote forwardings like it does for local ones. check-in: f6fa69cf31 user: ben tags: trunk
16:42
Two related changes to timing code: First, make absolute times unsigned. This means that it's safe to depend on their overflow behaviour (which is undefined for signed integers). This requires a little extra care in handling comparisons, but I think I've correctly adjusted them all. Second, functions registered with schedule_timer() are guaranteed to be called with precisely the time that was returned by schedule_timer(). Thus, it's only necessary to check these values for equality rather than doing risky range checks, so do that. The timing code still does lots that's undefined, unnecessary, or just wrong, but this is a good start. check-in: a2d79b9e07 user: ben tags: trunk
2012-09-17
17:28
Quell a (correct) GCC warning in the NO_HTMLHELP case. check-in: 26974b0b75 user: ben tags: trunk
2012-09-13
18:00
Should have been part of r9663: do use the platform-independent version of smemclr when compiling with Winelib. check-in: 55418d7f9a user: ben tags: trunk
17:34
Tweak comment in Recipe that had become separated from its code. check-in: 1728fb86ce user: ben tags: trunk
17:34
Don't try to use SecureZeroMemory under Winelib, since it isn't available there (yet). check-in: 9576fab1e6 user: ben tags: trunk
17:33
Define SECURITY_WIN32 for Winelib/Cygwin builds as well as for VC. This should perhaps go into winmisc.c: it's caused problems for other people too: <http://stackoverflow.com/questions/8530159/vs2010-build-error-at-putty-source> check-in: a1328977bc user: ben tags: trunk
16:53
In the cygwin Makefile, use "-o" on the windres command line to specify the output file. This appears to be supported by windres, and is required by wrc (the Winelib resource compiler). check-in: 8ed9ff86c4 user: ben tags: trunk
2012-09-08
14:46
Most of the code for "nc" mode duplicated that for opening a session or a fowarded port. Arrange that this code is shared instead. The main visible change is a slight change of log messages. check-in: 45e5597a72 user: ben tags: trunk
05:40
Hiroshi Oota points out that PuTTY's agent forwarding sockets can get confused if they receive a request followed by immediate EOF, since we currently send outgoing EOF as soon as we see the incoming one - and then, when the response comes back from the real SSH agent, we send it along anyway as channel data in spite of having sent EOF. To fix this, I introduce a new field for each agent channel which counts the number of calls to ssh_agentf_callback that are currently expected, and we don't send EOF on an agent channel until we've both received EOF and that value drops to zero. check-in: 18cc9933bb user: simon tags: trunk
2012-09-01
07:28
Factor out some common code for constructing SSH2_CHANNEL_OPEN. check-in: a820fa2f7d user: ben tags: trunk
07:10
struct winadj is unused now. G/c it. check-in: 215a9bd3fa user: ben tags: trunk
07:03
All of the initial CHANNEL_REQUESTs are conditional on (ssh->mainchan && !ssh->ncmode), so bundle them up in a big block conditional on this rather than checking it five times. check-in: 7cd9f82d83 user: ben tags: trunk
06:32
do_ssh2_authconn() now installs the standard handlers for CHANNEL_SUCCESS and CHANNEL_FAILURE as soon as it's opened a channel, so there's no need for it to set them again later. check-in: 3f43707fed user: ben tags: trunk
2012-08-30
13:48
Memory leak fixes reported by Balazs Domjan. check-in: 837bb0029b user: simon tags: trunk
13:44
Rename the various ssh2_maybe_setup_* functions to ssh2_setup_*, and move the primary conditions out of them into their callers. Fixes a crash in 'plink -N', since those functions would be called with a NULL channel parameter and immediately dereference it to try to get c->ssh. check-in: 91489422bb user: simon tags: trunk
13:44
In openssh_read(), we shouldn't ever return SSH2_WRONG_PASSPHRASE for an unencrypted key. (The other import function, sshcom_read(), already got this right.) Thanks to David Wedderwille for the report. This is more than just an error-reporting mistake; it actually causes Windows PuTTYgen to tight-loop on attempting to load a corrupt OpenSSH key, because the 'wrong passphrase' return value causes the caller to loop round and try again, but of course it knows the key is unencrypted so it doesn't prompt for a different passphrase and just tries again with no change... check-in: eb33193237 user: simon tags: trunk
13:44
Avoid leaking file handles in load_openssh_key(), as reported by David Wedderwille. check-in: 4487093d6a user: simon tags: trunk
2012-08-28
12:42
Fix a controlling-terminal bug reported by Anthony Heading: Cygwin doesn't have TIOCSCTTY, so my attempt to set the ctty of the child process isn't doing anything, and only works by chance when you run bash because bash does the thing that _will_ set the ctty, namely opening the terminal file again without O_NOCTTY. So now we do that too. check-in: 2728617d96 user: simon tags: trunk
12:41
Partially revert r9636. It is true that we can directly return the result of memcmp, but untrue that we can do so _unconditionally_: if memcmp returns zero, we still need to fall through to the next comparison. check-in: 3bce939695 user: simon tags: trunk
2012-08-27
18:16
Clang, like LCC, objects to using '<' and '>' on function pointers. I'm not entirely sure that using memcmp() is any more defined by the C standard, but at least Clang doesn't complain about it. While I'm here, tree234 doesn't require that comparison functions return precisely +1 or -1, so we can use the return value of memcmp() directly. check-in: 59a02c549d user: ben tags: trunk
17:02
Change return type of do_ssh2_transport() to void. Nothing pays attention to it any more, anyway. check-in: 602c100aba user: ben tags: trunk
16:55
Make bombout() less of a macro and more of a function. This gives GCC slightly fewer opportunities to gratuitously inflate its output. check-in: e1f8ba8e7b user: ben tags: trunk
14:11
Fix a memory leak in parse_ttymodes() (found by Memcheck/Valgrind). check-in: f3232e6fc3 user: ben tags: trunk
13:44
Slightly simplify crFinishFree{,V}. They're only likely to be useful for freeing a coroutine state structure, in which case there's no need to reset the line number (since all such coroutines keep their line number in the state structure) and the state structure pointer is always called "s". check-in: fd2ca901e3 user: ben tags: trunk
12:37
Don't close SSH-2 channels with outstanding channel requests on local error. In sshfwd_unclean_close(), get ssh2_check_close() to handle sending SSH_MSG_CHANNEL_CLOSE. That way, it can hold off doing so until any outstanding channel requests are processed. Also add event log message for unclean channel closures. check-in: 8f16c188ed user: ben tags: trunk
09:34
It's not legal to free a coroutine's state structure before invoking crFinish or crFinishV, since they will attempt to write to the coroutine state variable contained in that structure. Introduced some new all-in-one macros crFinishFree and crFinishFreeV, and used those instead. Should fix today's report of a crash just after authentication. check-in: edfebde5a7 user: simon tags: trunk
2012-08-26
04:50
Fix markup error introduced in r9626. check-in: 2f63c751c5 user: jacob tags: trunk
04:19
Remove documentation for "Out of space for port forwardings" error. It no longer exists in the code, and should have been obsoleted by r9214 at the latest. check-in: 188ae2adc3 user: ben tags: trunk
2012-08-25
17:57
Improve window-size handling in Unix Plink. Unconditionally override the configured terminal size with the one from stdin if it's available. This avoids the silliness whereby if Default Settings had a terminal size set, Plink used this and thus caused the server to use the wrong size. check-in: 102e90f6af user: ben tags: trunk
16:06
Better handling of outstanding CHANNEL_REQUESTS on channel destruction. Part the first: make sure that all structures describing channel requests are freed when the SSH connection is freed. This involves adding a means to ask a response handler to free any memory it holds. Part the second: in ssh_channel_try_eof(), call ssh2_channel_check_close() rather than emitting an SSH_MSG_CHANNEL_EOF directly. This avoids the possibility of closing the channel while a CHANNEL_REQUEST is outstanding. Also add some assertions that helped with tracking down the latter problem. check-in: c87aa624ea user: ben tags: trunk
10:57
Factor out common code to construct CHANNEL_REQUESTS. This reduces code size a little and also makes it harder to accidentally request a reply without putting in place a handler for it or vice versa. check-in: 3182a9a27e user: ben tags: trunk
10:04
Simplify handling of responses to channel requests. The various setup routines can only receive CHANNEL_SUCCESS or CHANNEL_FAILURE, so there's no need for the to worry about receiving anything else. Strange packets will end up in do_ssh2_authconn instead. check-in: 054111be55 user: ben tags: trunk
09:34
Add some kind of window tracking to logparse.pl. check-in: c22f69b213 user: ben tags: trunk
08:54
Fix matching of channel and global requests with replies in logparse.pl. In each case, want_reply was being treated as true even when it wasn't, because it got decoded into "yes"/"no", both of which are true in Perl. check-in: 85c62a0921 user: ben tags: trunk
08:39
Handle all replies to CHANNEL_REQUESTs through the per-channel queue. Each of the minor start-of-session requests is now dealt with by its own little co-routine, while the shell/command is done in do_ssh2_authconn() itself. This eliminates one more round-trip in session setup: PuTTY gets all the way up to sending a shell request before worrying about any replies. check-in: f8eedbd544 user: ben tags: trunk
06:12
Generalise SSH_MSG_CHANNEL_{SUCCESS,FAILURE} handling. Now each channel has a queue of arbitrary handlers for those messages, with anything that sends a CHANNEL_REQUEST with want_reply true pushing a new entry onto the queue, and a shared handler that dispatches responses appropriately. Currently, this is only used for winadj@putty.projects.tartarus.org, but extending it to cover the initial requests as well shouldn't be too painful. check-in: 008c38a33f user: ben tags: trunk
2012-08-22
13:36
Fix a bug in the PSFTP command parser which would cause it to hallucinate an extra empty argument word at the end of a line if the line ended in more than one whitespace character. check-in: 07769e1daf user: simon tags: trunk
13:25
Enhance logparse.pl so that it detects channels running SFTP and decodes the SFTP message layer in addition to the underlying SSH. Requests and responses are matched up via their ids. check-in: 297ea2b807 user: simon tags: trunk
2012-08-21
18:04
Fix recently-introduced memory leak in ssh2_msg_unexpected(). check-in: 4d3163506d user: ben tags: trunk
17:33
De-duplicate code in KEXINIT generation. There's no need to have identical code generating server-to-client and client-to-server versions of the cipher and MAC lists; a couple of twice-around loops will do fine. check-in: 8a9f4acc01 user: ben tags: trunk
17:04
Reworking of packet delivery to coroutines in SSH-2. Before, NULL in the dispatch table meant "send to the appropriate one of do_ssh2_transport() and do_ssh2_authconn()". Now those (via small shims) are specified directly in the dispatch table, so ssh2_protocol() is much simpler. In the process, this has somewhat centralised the handling of gross server protocol violations. PuTTY will now disconnect with a rude message when (e.g.) OpenSSH sends us an SSH_MSG_UNIMPLEMENTED when we try to KEXINIT during authentication. check-in: 147d6fa6a9 user: ben tags: trunk
2012-08-19
06:35
Fix an erroneous "case" fallthrough in ssh1_msg_channel_close, which was causing assertion failures when closing X11 channels in SSH-1. Also fix another pasto. check-in: 4c44cc259a user: ben tags: trunk
2012-08-18
04:30
Tweak to SSH coroutine code: put line number in the coroutine state structure, which is consistent with Simon's canonical version of the macros. check-in: e5667a8d0d user: ben tags: trunk
2012-08-12
15:17
Use a single sftp_senddata() to send each SFTP packet, rather than using one for the length field and one for the rest of the packet contents. Since sftp_senddata() has no queuing or deferral mechanism but instead constructs and sends an SSH2_MSG_CHANNEL_DATA message immediately, this change has the effect of ceasing to split every SFTP packet across two SSH messages. check-in: 46ddd55b12 user: simon tags: trunk
2012-08-11
04:10
Rework bufchain code to allow for variable-sized granules. bufchain_add() now allocates at most one new granule. Granules still have a minimum size, so small adds still get coalesced. The main practical consequence of this is that PSCP and PSFTP now generate 4K SSH packets rather than 512-byte ones. Also, the compiled code (on my Ubuntu box) is fractionally smaller. check-in: ead74b235b user: ben tags: trunk
2012-08-02
17:18
Reduce the number of round-trips involved in opening an SSH-2 session by sending most of the initial SSH_MSG_CHANNEL_REQUEST messages before waiting for any replies. The initial version of this code was a clever thing with a two-pass loop, but that got hairy so I went for the simpler approach of separating the request and reply code and having flags to keep track of which requests have been sent. check-in: 5da2ce49e0 user: ben tags: trunk
2012-07-29
08:38
Add a missing \define I accidentally assumed was there in r9592. check-in: bb7c73258b user: simon tags: trunk
2012-07-28
14:30
Add a bug-compatibility flag to disable the winadj@putty.projects.tartarus.org request. Not currently enabled automatically, but should be usable as a manual workaround. check-in: feb44c7dcc user: simon tags: trunk
11:53
Fix an embarrassing mistake in config box handling which was causing changes to any SSH bug config option to be lost when the config box switched to a different panel, at least on GTK. check-in: 723e01c194 user: simon tags: trunk
11:33
Move the declaration of smemclr() out of putty.h into misc.h, because one of its uses (in sshaes.c) wasn't picking up the former. Thanks to Ubuntu's gcc for spotting that. check-in: b41c0f9a37 user: simon tags: trunk
11:33
Remove an unused variable. check-in: 5fca0480b8 user: simon tags: trunk
2012-07-22
14:51
Introduce a new utility function smemclr(), which memsets things to zero but does it in such a way that over-clever compilers hopefully won't helpfully optimise the call away if you do it just before freeing something or letting it go out of scope. Use this for (hopefully) every memset whose job is to destroy sensitive data that might otherwise be left lying around in the process's memory. check-in: aee68b8d31 user: simon tags: trunk
14:48
Remove a bashism in mksrcarc.sh, without which bob builds fail on Ubuntu (whose /bin/sh is not bash). check-in: 4aed111c79 user: simon tags: trunk
2012-07-18
23:42
Add '-Wall -Werror' to the compile options in the autotools makefile, having just noticed that Makefile.gtk had it and this one doesn't. (Of course, this being autoconf, we can easily enough make it conditional on the compiler actually being gcc.) check-in: b18fa86db2 user: simon tags: trunk
23:29
Rework the new type-check in sresize so that it doesn't cause a compile warning ('left-hand operand of comma expression has no effect'), which of course becomes fatal under -Werror. (This would have been instantly noticeable to people compiling with the old-fashioned Makefile.gtk, which does include -Wall -Werror, but those of us using the new autoconf makefile hadn't noticed.) check-in: e0cb545c71 user: simon tags: trunk
11:08
Remove term_key, which was intended to handle function keys in a cross- platform manner, but which nothing ever called. It thus served only to trap up the unwary. The live function key handling code lives in the frontends, i.e. window.c on Windows and gtkwin.c on Unix. check-in: ebca704008 user: owen tags: trunk
2012-07-11
13:12
If pterm's execvp fails when given the whole argument list after -e, and the argument list contains only one string, try again by passing that single string to "$SHELL -c" to be parsed as a shell command. This matches xterm's behaviour (as of xterm 261, at least), and means in practice that users can do _either_ of 'pterm -e some command' and 'pterm -e "some command"'. (A quick survey suggests that the majority of X terminal programs agree with pterm's old behaviour of only supporting '-e some command', except that gnome-terminal only supports the other behaviour and xterm supports both. With that disagreement, I think supporting both is probably the sensible thing.) check-in: 6530f824ce user: simon tags: trunk
2012-07-05
18:45
Turns out that the compose-keys fix in r9567 did in fact break one piece of keyboard handling: if Num Lock is on, numeric keypad keys are eaten by the IM, so we must avoid passing them to the IM in the first place if we're in any non-default numeric keypad mode (application or Nethack). This is a grubby way to do it, but the more obvious approach of just moving the Nethack and app-keypad if statements up to above the IM call doesn't work because those statements depend on the generic Alt-prefix handling that happens just _below_ the IM call. So instead I just repeat the list of keystrokes and modes in an if statement conditionalising the IM call. check-in: 7c3afb2e69 user: simon tags: trunk
2012-07-01
11:55
Stop including <gtk/gtkcontainer.h> directly, since a user points out that it'll be absent in GTK 3. check-in: 9858aaec38 user: simon tags: trunk
2012-06-20
12:39
John Hartnup reports that Apache SSHD's SFTP server responds to FXP_READDIR on an empty directory by returning a zero-length list of filenames, instead of the more common response of a list containing just "." and "..". Stop PSFTP failing an assertion when that happens. check-in: 36569ee0d2 user: simon tags: trunk
2012-06-18
13:10
Add the missing code to treat data coming from the input method as keypresses for purposes of hiding the mouse pointer and resetting the scrollback. check-in: a0c27fcd97 user: simon tags: trunk
2012-06-17
02:26
Support for dead keys and compose sequences on Unix, by instantiating a GtkIMMulticontext and having that filter most keypresses. I think I've got this right so that it doesn't break any previous deliberate keyboard-handling behaviour that's now _after_ the 'if (filter keypress) return' statement. check-in: e02da4865e user: simon tags: trunk
2012-06-09
10:09
Introduce a third setting for the 'bold as colour' mode, which lets you both brighten the colour _and_ bold the font at the same time. (Fixes 'bold-font-colour' and Debian #193352.) check-in: 8394417bea user: simon tags: trunk
2012-06-04
18:32
Add missing check for failure to agree a host key algorithm. check-in: dac73d4239 user: simon tags: trunk
2012-06-01
14:43
Missing #include. check-in: 22958c57fc user: simon tags: trunk
01:50
Fix a bug in cygtermd, spotted by Casey Zacek, in which we unconditionally set the telnet state to SEENCR regardless of whether we have actually seen a CR, and as a result sending a NUL through PuTTY (via Ctrl-Space or whatever) does not work. Must have arisen through some kind of really weird cut-and-paste error! check-in: f270727eb1 user: simon tags: trunk
2012-05-18
14:51
Enhance my 'sresize' macro so that it type-checks the pointer you pass _in_ to it, as well as the one it returns. Why have I never thought of doing that before?! check-in: 35bac4b296 user: simon tags: trunk
2012-05-15
17:19
Fix bug in the new CLOCK_MONOTONIC implementation. I was treating the nanoseconds field as a microseconds field, with hilarious consequences. check-in: 90d7f8c35f user: simon tags: trunk
2012-05-13
10:59
Use clock_gettime(CLOCK_MONOTONIC) as the Unix getticks(), if it's available. check-in: 37168cc6dd user: simon tags: trunk
10:59
Patch from Robert de Bath to substantially simplify timing.c. The previous platform-dependent ifdefs, switching between a system which tried to cope with spurious callbacks (which I'd observed on Windows) and one which tried to cope with system clock jumps (which can happen on Unix, if you use gettimeofday) have been completely removed, and replaced with a much simpler approach which just copes with system clock jumps by triggering any timers immediately. None of the resulting effects should be catastrophic (the worst thing might be the waste of CPU in a spurious rekey, but as long as the system clock isn't jumping around _all_ the time that's hardly critical) and in any case the Unix port has had a long-standing oddity involving occasional lockups if pterm or PuTTY runs for too long, which hopefully this should replace with a much less bad failure mode. And the code is much simpler, which is not to be sneezed at. check-in: 88bffdc065 user: simon tags: trunk
10:59
Fix from Robert de Bath which reorders the Windows initialisation sequence: since init_fonts sets up ucsdata based on the available Windows fonts, we should call it before passing ucsdata to term_init. check-in: 2717a22bba user: simon tags: trunk
10:59
Bug fix from Robert de Bath: since lpDx_maybe is always supposed to equal either lpDx or NULL, we mustn't forget to update it when we realloc lpDx. check-in: 97d3643dfe user: simon tags: trunk
2012-05-12
12:00
When we are asked to unthrottle an SSH connection (by the front end calling back->unthrottle), we should immediately call ssh_process_queued_incoming_data to handle the SSH packets that have been saved for later functioning while we were throttled. Otherwise, they'll sit there unhandled until the next call to ssh_gotdata, which might not be for ages if the server thinks it's waiting for us. check-in: 02b713d7b0 user: simon tags: trunk
2012-04-30
12:28
Fix trivial Perl goof in logparse.pl which caused SSH2_MSG_CHANNEL_FAILURE to be reported as replying to ARRAY(0xrubbish) instead of to a message number. check-in: cf89852550 user: simon tags: trunk
2012-04-24
12:33
Fix an inverted comparison in rlogin.c which must surely have broken logins completely, with or without a supplied username. Ahem. check-in: 43d74f79ef user: simon tags: trunk
2012-04-23
12:59
Call sshfwd_unclean_close() in the event of a local socket error on a forwarded X connection. (I somehow forgot to do this in r9364, despite making the identical change in portfwd.c.) check-in: b487bd5e1d user: simon tags: trunk
2012-04-22
09:22
Patch from Robert de Bath to ifdef out the Windows-specific hack for the offset horizontal line characters in the VT100 line-drawing set (o,p,r,s), so that no trace of it - and hence no pointless performance hit - is compiled into the cross-platform modules on non-Windows platforms. check-in: c9610e7ecb user: simon tags: trunk
09:22
Bug fix from Robert de Bath: if the utf8_override setting is changed in mid-session, it affects translation and hence display, so it should be listed among the settings that require a redraw. check-in: 15c9c5b0d3 user: simon tags: trunk
09:22
Bug fix from Robert de Bath: if wc_to_mb returns a length of zero, it will not even initialise sbstring[0], so we shouldn't even look at it let alone depend on it to tell us the desired character was absent. check-in: 31149e5bdd user: simon tags: trunk
2012-04-18
01:36
Conditionalise the calls to premsg and postmsg in uxcons.c's logevent(), which temporarily turn off the raw mode we've put stderr into, so that they don't get called if the log_eventlog() call between them is not _actually_ going to write to stderr. Fixes a bug in which, if you define a Unix PuTTY saved session which uses 'plink -nc' as a local proxy command and then run PuTTY backgrounded from the shell with that session loaded, the subprocess Plink would get SIGTTOU when it tried to muck about with stderr and the whole thing would grind to a halt. I'm prepared to consider that acceptable if Plink _really_ wants to write on standard error, but if it doesn't, it should just carry on working in the background! check-in: cdafcd314c user: simon tags: trunk
2012-04-16
13:21
Fix a Perl warning about useless use of a constant in void context. check-in: 176866b9c2 user: simon tags: trunk
2012-04-14
12:24
New utility script to parse an SSH packet dump and write out an interpretation with some analysis done on it. The script will do its own tracking of the set of open channels and their states, and its output is in a one-line-per-packet format such that every distinct channel has a unique identifier in it which should make it easy to grep out all lines relating to that channel. The script also matches up {CHANNEL,REQUEST}_{SUCCESS,FAILURE} to the requests that caused them, by tracking a queue of requests in each direction per channel and for global requests. Command-line options permit generating a final dump of all channels ever known to the script and their various ids and final state, and also dumping out the data transferred over each channel in each direction. Output is not complete, in the sense that some parameters in some messages (e.g. pixel sizes in window-size specifications) are deliberately omitted due to being boring, and the entire contents of some messages (e.g. KEXINIT) are omitted because I haven't yet seen any purpose in decoding them. Filling them in might be a useful thing, although I'm inclined to think that the default should still be to show only the potentially interesting stuff (e.g. still not pixel sizes!) and enable the rest using a -v option. Hopefully this should do a lot of the legwork in debugging issues in which a channel mysteriously remains partially open and prevents PuTTY closing. check-in: bacd65bbf5 user: simon tags: trunk
2012-04-13
13:02
Add code in dlg_filesel_set and dlg_fontsel_set which makes them duplicate the strings they pass to gtk_entry_set_text. I was already doing that in dlg_editbox_set, but forgot to add the same code when I revamped FontSpec and Filename to contain dynamically allocated strings (r9314 and r9316 respectively). This fixes a bug where, on some versions of GTK (but apparently not up-to-date versions), loading a saved session causes gibberish to appear in file-selector edit boxes accompanied by a valgrind error. check-in: 9e94ccddfe user: simon tags: trunk
2012-04-08
04:42
Fallout from the big revamp in r9214: colour handling was going a bit wonky because I'd used the subkey for the red component in four places where I should have used the green/blue subkeys instead. Thanks to Martin Kletzander for spotting it. check-in: 9bf895b959 user: simon tags: trunk
2012-03-05
12:40
Fix another type mismatch introduced by r9409. check-in: d2c442916f user: simon tags: trunk
12:34
Fix a type mismatch in minibidi.c - r9409 changed the 'wc' fields in bidi_char from wchar_t to unsigned int, but omitted to similarly adjust the parameter to doMirror which is passed a pointer to that field. check-in: 747a4a8d26 user: simon tags: trunk
12:32
Initialise some variables to NULL, to placate optimisers. check-in: f98093aa2e user: simon tags: trunk
2012-03-03
19:01
Remove comment about 1024/1023 RSA key lengths that's no longer true as of r9421. check-in: fdca1e4975 user: jacob tags: trunk
18:24
Generate keys more carefully, so that when the user asks for an n-bit key they always get an n-bit number instead of n-1. The latter was perfectly harmless but kept confusing users. check-in: de4b8709f0 user: simon tags: trunk
18:24
Long overdue rewrapping of the primes[] array for legibility. I think the previous ghastly formatting arose when I ran the whole source base through GNU indent... check-in: a4226d3c39 user: simon tags: trunk
2012-02-19
04:44
Update default key length in PuTTYgen to 2048. check-in: c630f6dc40 user: simon tags: trunk
04:32
Update to 2007-05-26 version of upstream wcwidth.c. check-in: e4d74f3b5c user: simon tags: trunk
04:27
Patch from Matsui Nag to implement xterm's "bracketed paste mode", in which text pasted into the terminal is preceded and followed by special function-key-like escape sequences ESC[200~ and ESC[201~ so that the application can identify it and treat it specially (e.g. disabling auto-indent-same-as-previous-line in text editors). Enabled and disabled by ESC[?2004h and ESC[?2004l, and of course off by default. check-in: 90e7b33dbb user: simon tags: trunk
2012-02-17
13:28
Patch from Yoshida Masato to fill in the missing pieces of Windows UTF-16 support. High Unicode characters in the terminal are now converted back into surrogates during copy and draw operations, and the Windows drawing code takes account of that when splitting up the UTF-16 string for display. Meanwhile, accidental uses of wchar_t have been replaced with 32-bit integers in parts of the cross-platform code which were expecting not to have to deal with UTF-16. check-in: af034c145b user: simon tags: trunk
2012-02-05
04:08
WM_SIZE/SIZE_MAXIMIZED can show up even during an interactive resize, so we should ensure we treat it the same way as other WM_SIZEs that show up during that time: set the width and height in conf, and set the flag to have that width and height enacted on WM_EXITSIZEMOVE. Fixes a bug in which dragging a PuTTY window directly from the Win7 snapped-to-half-screen position to the snapped-to-maximised state would leave the terminal in the pre-snapped size. check-in: f465256d47 user: simon tags: trunk
2012-01-29
18:29
New FAQ: "When I put PuTTY in C:\WINDOWS\SYSTEM32 on my 64-bit Windows system, `Duplicate Session' doesn't work." (Explanation courtesy Owen.) check-in: a4057416e6 user: jacob tags: trunk
2012-01-26
12:53
It's a new year. check-in: 5c1e09c0b1 user: jacob tags: trunk
12:22
If we're called on to uncleanly close an SSH channel for which we've already sent SSH2_MSG_CHANNEL_CLOSE, we should not skip the _whole_ of sshfwd_unclean_close(), only the part about sending SSH2_MSG_CHANNEL_CLOSE. It's still important to retag the SSH channel as CHAN_ZOMBIE and clean up its previous data provider. check-in: 4dc3ffb821 user: simon tags: trunk
2012-01-03
13:43
Patch from Colin Watson to use g_ascii_strcasecmp in place of the deprecated g_strcasecmp (since all the strings being compared are parts of XLFDs and won't be in interesting character sets anyway). check-in: 861a49e69b user: simon tags: trunk
2011-12-10
08:03
Checklist update following the 0.62 release. I managed to send out the announcement email without a subject line, so I'm reorganising the announcement entry in the checklist in the hope that it'll make it harder for me to get that one wrong in future! check-in: 2e6ff4194a user: simon tags: trunk
06:07
Bump version number on trunk prior to tagging 0.62 on the branch. check-in: 896ba0eb03 user: simon tags: trunk
2011-12-08
13:15
Introduce a function sshfwd_unclean_close(), supplied by ssh.c to subsidiary network modules like portfwd.c. To be called when the subsidiary module experiences a socket error: it sends an emergency CHANNEL_CLOSE (not just outgoing CHANNEL_EOF), and immediately deletes the local side of the channel. (I've invented a new channel type in ssh.c called CHAN_ZOMBIE, for channels whose original local side has already been thrown away and they're just hanging around waiting to receive the acknowledging CHANNEL_CLOSE.) As a result of this and the last few commits, I can now run a port forwarding session in which a local socket error occurs on a forwarded port, and PuTTY now handles it apparently correctly, closing both the SSH channel and the local socket and then actually recognising that it's OK to terminate when all _other_ channels have been closed. Previously the channel corresponding to the duff connection would linger around (because of net_pending_errors never being called), and keep being selected on (hence chewing CPU), and inhibit program termination at the end of the session (because not all channels were closed). check-in: 9377dd8f27 user: simon tags: trunk
13:15
Arrange to call net_pending_errors on Unix, which we've never actually remembered to do before! Also some related fixes, such as that after we do so we should immediately stop selecting on the socket in question. check-in: 49322399b9 user: simon tags: trunk
13:15
When we receive CHANNEL_CLOSE on an SSH-2 channel and haven't sent EOF on it yet, we should send EOF on _that channel_, not the main session channel! Oops. check-in: 88c017dc17 user: simon tags: trunk
13:15
Whitespace fix while I was passing. check-in: a1b22459c5 user: simon tags: trunk
13:15
Make sure we never send window adjustments (or winadjes) on channels for which we've already sent CHANNEL_CLOSE. It would be embarrassing if the remote end had also sent CHANNEL_CLOSE in response and then received our communication once it had forgotten about the channel. check-in: fe229d2998 user: simon tags: trunk
13:15
Block SIGPIPE in Unix plink. In a port-forwarding run we may have lots of local sockets and pipes all open at once, and if one of them is uncleanly closed from the remote end we don't want the whole application to die - we want to close that socket's SSH channel and continue with the rest of the run. check-in: e039bca76c user: simon tags: trunk
2011-12-07
13:07
Add a missing free_prompts() call in the keyboard-interactive code. check-in: 596656b982 user: simon tags: trunk
2011-11-28
13:23
Tiny patch from Martin Packman to fix a Windows handle leak in Pageant's IPC mechanism. It's incomplete (he sent a much more comprehensive set of fixes that I haven't reviewed), but should be adequate to mitigate a particular issue for Bazaar users. check-in: 8050548bc2 user: simon tags: trunk
13:17
I missed a bit in r9343: windows/version.rc2 also needed updating for the new 'pre-release' version type. check-in: a0be433597 user: simon tags: trunk
2011-11-27
05:10
Add a release checklist entry to remind me to get rid of 'pre-release' sections on the Download page. check-in: 5cc46486b7 user: simon tags: trunk
2011-11-26
11:35
Introduce a new version type, 'prerelease'. Quotes the version number it's a pre-release of, and the revision number so you can tell two pre-releases apart. I intend to use this for builds from branch-0.61 until I call it 0.62 proper. check-in: acf1c41d51 user: simon tags: trunk
2011-10-14
02:03
Support code page 852. Thanks to Tamas Tevesz. check-in: 7459546673 user: simon tags: trunk
2011-10-02
09:16
Private files saved on Unix should have mode 0600, not 0700. They're generally private-key files, which have no need to be executable. check-in: c4dd9a1230 user: simon tags: trunk
09:14
More arbitrary-limit hunting: retire PASSPHRASE_MAXLEN in the Windows GUIs of Pageant and PuTTYgen. With that and the prompts_t redesign, there should no longer be any limit on passphrase length other than the patience of the user. check-in: 2a6b005d2c user: simon tags: trunk
09:03
Another utility function, to free a string containing sensitive data. check-in: 27157daada user: simon tags: trunk
08:53
Move a recently introduced utility function out of the file in which I declared it static, and into winutils.c where it can be more generally accessible. check-in: 2dfc9e873c user: simon tags: trunk
06:50
While I'm crusading against arbitrary limits, here's a redesign of prompt_t to arrange that the buffer in which each prompt is stored can be reallocated larger during the input process. check-in: 3f7657c9b5 user: simon tags: trunk
06:01
Turn 'Filename' into a dynamically allocated type with no arbitrary length limit, just as I did to FontSpec yesterday. check-in: 7756dc109c user: simon tags: trunk
2011-10-01
13:00
Fix copy-and-paste error in command-line font selection in r9314. check-in: 2d4a59148d user: jacob tags: trunk
12:38
Change the semantics of 'FontSpec' so that it's a dynamically allocated type. The main reason for this is to stop it from taking up a fixed large amount of space in every 'struct value' subunion in conf.c, although that makes little difference so far because Filename is still doing the same thing (and is therefore next on my list). However, the removal of its arbitrary length limit is not to be sneezed at. check-in: 78529746fb user: simon tags: trunk
2011-09-19
11:38
We shouldn't fork off a utmp helper subprocess when we aren't setuid, because (a) under that circumstance we won't be writing to utmp anyway, and (b) if we aren't setuid, then we won't have created the pty at the point we fork, so even if our subprocess _could_ have written to utmp it wouldn't have done it right! Spotted by valgrind (triggering on the access beyond the end of the ttyname string in setup_utmp, clueing me in to it having been empty). check-in: acb21a748a user: simon tags: trunk
11:21
Add a missing initialisation to NULL. check-in: f2d153ee09 user: simon tags: trunk
2011-09-17
09:50
Cope with XFontStructs having a NULL per_char array, which happened to me this morning under strange circumstances. check-in: b1c237ec85 user: simon tags: trunk
03:11
Fix x11font_has_glyph so it doesn't get caught out by signed chars. check-in: 4cf87efd79 user: simon tags: trunk
2011-09-16
14:18
Suppress Pango's bidi, by displaying RTL characters one at a time. I hadn't previously noticed, but Pango was helpfully re-reversing text that PuTTY's own bidi module had already reversed, leading to Arabic text being wrongly displayed and also total chaos when you move the cursor over it or try to cut and paste it. check-in: 62f403a7c9 user: simon tags: trunk
14:18
Support font fallback even when an X11 server-side font is selected, by introducing a wrapper around an individual unifont which falls back to Pango (which already has built-in fallback) in the case where the selected font doesn't support the glyph in question. The wrapper itself is a (vestigial) subclass of unifont, to minimise disturbance at the call sites. check-in: 91efaca9f4 user: simon tags: trunk
14:18
Change the unifont API so that text is passed right down to the individual font implementation as wchar_t, rather than having to be converted by the client into the appropriate MBCS/SBCS. This also means I can remove 'real_charset' from the public-facing contents of the unifont structure. check-in: a22d103f26 user: simon tags: trunk
14:18
Add some missing consts in character set handling. check-in: d7363b4954 user: simon tags: trunk
04:01
Remove empty.h from CLEANFILES, so that after mkfiles.pl has constructed it it won't be deleted again by 'make clean'. The effect is that not only does this work (as r9288 arranged), ./configure; make plink but these work too: ./configure; make; make clean; make plink ./configure; make; make distclean; ./configure; make plink check-in: e24f3aade9 user: simon tags: trunk
03:49
Stop using GDK's wrapper on the X11 font functions (GdkFont). All X11 font operations are now done directly using Xlib calls, and the only interaction with GDK within the x11font mechanism is to get the X ids for drawables, GCs and the X display itself. This should remove an obstacle to porting to GTK3, and also makes the XFontStruct for loaded fonts more readily available, which I hope will come in handy for another plan I have in mind. check-in: 7e53488c87 user: simon tags: trunk
2011-09-14
10:54
Create empty.h (used to force rebuilds of version.o by the automake makefile) as a side effect of running mkfiles.pl. The automake docs observe that the BUILT_SOURCES list is only automatically built by plain 'make' or 'make all' or a couple of other targets, so the sequence './configure && make plink' from a freshly unpacked tar file would previously fail for lack of empty.h. If empty.h had important _content_ that needed to be built at compile time, of course, I wouldn't be able to fix it like this; but since the only important thing is the timestamp, I can just make sure it already exists at the time of first build. check-in: 354e7a22cd user: simon tags: trunk
04:49
No, I take that back: we _do_ have a mechanism for suppressing reads from forwarding data sources which will be good enough to last until we close the socket, in the form of the override_throttle() functions. So this finishes up the work in r9283, by manufacturing outgoing EOF in response to incoming CLOSE on all channel types. check-in: a4b537e1f3 user: simon tags: trunk
04:09
Another tweak to EOF policy: invent an outgoing EOF on receipt of an incoming CHANNEL_CLOSE, if it's the main session channel. The idea is that invocations such as 'plink -T hostname sh' (running a shell without a remote pty) can be exited by typing 'exit' to the remote shell, without plink blocking forever waiting for outgoing EOF. I think it would be better to do the same for all other channel types too, but that would need an extra API call which I haven't implemented yet. check-in: 304b3571f2 user: simon tags: trunk
2011-09-13
10:38
Changed my mind about the EOF policy in SSH mode: I think the SSH backend should unilaterally assume outgoing EOF when it sees incoming EOF, if and only if the main session channel is talking to a pty. (Because ptys don't have a strong concept of EOF in the first place, that seems like a sensible place to draw the line.) This fixes a bug introduced by today's revamp in which if you used Unix Plink to run a console session it would hang after you hit ^D - because the server had sent EOF, but it was waiting for a client-side EOF too. check-in: 3aaf9b7e0f user: simon tags: trunk
06:56
Nearly forgot noting this down in the 'half-closed' bug entry: don't send CHANNEL_CLOSE until we have acks for all our winadj requests. Should work around https://bugzilla.mindrot.org/show_bug.cgi?id=1818 . check-in: de1e102574 user: simon tags: trunk
06:44
Revamp of EOF handling in all network connections, pipes and other data channels. Should comprehensively fix 'half-closed', in principle, though it's a big and complicated change and so there's a good chance I've made at least one mistake somewhere. All connections should now be rigorous about propagating end-of-file (or end-of-data-stream, or socket shutdown, or whatever) independently in both directions, except in frontends with no mechanism for sending explicit EOF (e.g. interactive terminal windows) or backends which are basically always used for interactive sessions so it's unlikely that an application would be depending on independent EOF (telnet, rlogin). EOF should now never accidentally be sent while there's still buffered data to go out before it. (May help fix 'portfwd-corrupt', and also I noticed recently that the ssh main session channel can accidentally have MSG_EOF sent before the output bufchain is clear, leading to embarrassment when it subsequently does send the output). check-in: 0831792ea4 user: simon tags: trunk