History of ssh.c of 7b589f12f94d71c6

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

History of file ssh.c at check-in 7b589f12f94d71c6

2014-01-25
09:59
Fix a potential crash in ssh_setup_portfwd. If we search for a colon by computing ptr + host_strcspn(ptr,":"), then the resulting pointer is always non-NULL, and the 'not found' condition is not !p but !*p. This typo could have caused PuTTY to overrun a string, but not in a security-bug sense because any such string would have to have been loaded from the configuration rather than received from a hostile source. file: [36083e7c07] check-in: [55833059a8] user: simon branch: trunk, size: 343755
09:58
Avoid misidentifying unbracketed IPv6 literals as host:port. Both GUI PuTTY front ends have a piece of logic whereby a string is interpreted as host:port if there's _one_ colon in it, but if there's more than one colon then it's assumed to be an IPv6 literal with no trailing port number. This permits the PuTTY command line to take strings such as 'host', 'host:22' or '[::1]:22', but also cope with a bare v6 literal such as '::1'. This logic is also required in the two Plink front ends and in the processing of CONF_loghost for host key indexing in ssh.c, but was missing in all those places. Add it. file: [9f0a2cc2a2] check-in: [dac07879fa] user: simon branch: trunk, size: 343754
09:58
Use the new host_str* functions to improve IPv6 literal support. I've gone through everywhere we handle host names / addresses (on command lines, in PuTTY config, in port forwarding, in X display names, in host key storage...) and tried to make them handle IPv6 literals sensibly, by using the host_str* functions I introduced in my previous commit. Generally it's now OK to use a bracketed IPv6 literal anywhere a hostname might have been valid; in a few cases where no ambiguity exists (e.g. no :port suffix is permitted anyway) unbracketed IPv6 literals are also acceptable. file: [cf1b2b2275] check-in: [7c4cad97cb] user: simon branch: trunk, size: 343615
2014-01-09
04:22
Added putty-cac current state file: [f640d38511] check-in: [62dff76227] user: rkeene branch: putty-cac, size: 309367
2013-12-02
13:26
Fix breakage of SSH-2 packet decompression by r10070. The line that resets st->pktin->length to cover only the semantic payload of the SSH message was overwriting the modification to st->pktin->length performed by the optional decompression step. I didn't notice because I don't habitually enable compression. file: [b467fe75ad] check-in: [bcffebc70c] user: simon branch: trunk, size: 343338
2013-11-17
08:05
Fix an assortment of dupprintf() format string bugs. I've enabled gcc's format-string checking on dupprintf, by declaring it in misc.h to have the appropriate GNU-specific attribute. This pointed out a selection of warnings, which I've fixed. file: [b5515651f5] check-in: [44f33ce7e0] user: simon branch: trunk, size: 343277
08:05
Implement connection sharing between instances of PuTTY. The basic strategy is described at the top of the new source file sshshare.c. In very brief: an 'upstream' PuTTY opens a Unix-domain socket or Windows named pipe, and listens for connections from other PuTTYs wanting to run sessions on the same server. The protocol spoken down that socket/pipe is essentially the bare ssh-connection protocol, using a trivial binary packet protocol with no encryption, and the upstream has to do some fiddly transformations that I've been referring to as 'channel-number NAT' to avoid resource clashes between the sessions it's managing. This is quite different from OpenSSH's approach of using the Unix- domain socket as a means of passing file descriptors around; the main reason for that is that fd-passing is Unix-specific but this system has to work on Windows too. However, there are additional advantages, such as making it easy for each downstream PuTTY to run its own independent set of port and X11 forwardings (though the method for making the latter work is quite painful). Sharing is off by default, but configuration is intended to be very easy in the normal case - just tick one box in the SSH config panel and everything else happens automatically. file: [f8d4ef66c6] check-in: [998dfad436] user: simon branch: trunk, size: 343282
08:05
Get rid of the error-return mechanism from x11_init. Now that it doesn't actually make a network connection because that's deferred until after the X authorisation exchange, there's no point in having it return an error message and write the real output through a pointer argument. Instead, we can just have it return xconn directly and simplify the call sites. file: [d661163a04] check-in: [73c26030cf] user: simon branch: trunk, size: 320821
08:05
Prepare to have multiple X11 auth cookies valid at once. Rather than the top-level component of X forwarding being an X11Display structure which owns some auth data, it's now a collection of X11FakeAuth structures, each of which owns a display. The idea is that when we receive an X connection, we wait to see which of our available auth cookies it matches, and then connect to whatever X display that auth cookie identifies. At present the tree will only have one thing in it; this is all groundwork for later changes. file: [d437367924] check-in: [dce51d4dc0] user: simon branch: trunk, size: 321249
08:05
Decouple X socket opening from x11_init(). Now we wait to open the socket to the X server until we've seen the authorisation data. This prepares us to do something else with the channel if we see different auth data, which will come up in connection sharing. file: [f2a5568630] check-in: [17981b3538] user: simon branch: trunk, size: 319755
08:04
Add a missing null pointer check in s_write. I don't know that this can ever be triggered in the current state of the code, but when I start mucking around with SSH session closing in the near future, it may be handy to have it. file: [47bd0974ce] check-in: [4e49a3898d] user: simon branch: trunk, size: 319683
08:04
Refactor ssh.c's APIs to x11fwd.c and portfwd.c. The most important change is that, where previously ssh.c held the Socket pointer for each X11 and port forwarding, and the support modules would find their internal state structure by calling sk_get_private_ptr on that Socket, it's now the other way round. ssh.c now directly holds the internal state structure pointer for each forwarding, and when the support module needs the Socket it looks it up in a field of that. This will come in handy when I decouple socket creation from logical forwarding setup, so that X forwardings can delay actually opening a connection to an X server until they look at the authentication data and see which server it has to be. However, while I'm here, I've also taken the opportunity to clean up a few other points, notably error message handling, and also the fact that the same kind of state structure was used for both connection-type and listening-type port forwardings. Now there are separate PortForwarding and PortListener structure types, which seems far more sensible. file: [b9edbdab7d] check-in: [7ab21bb146] user: simon branch: trunk, size: 319648
08:04
Complete rewrite of the packet log censoring code. Because the upcoming connection sharing changes are going to involve us emitting outgoing SSH packets into our log file that we didn't construct ourselves, we can no longer rely on metadata inserted at packet construction time to tell us which parts of which packets have to be blanked or omitted in the SSH packet log. Instead, we now have functions that deal with constructing the blanks array just before passing all kinds of packet (both SSH-1 and SSH-2, incoming and outgoing) to logging.c; the blanks/nblanks fields in struct Packet are therefore no longer needed. file: [27b78b1f0f] check-in: [88f08b9cb9] user: simon branch: trunk, size: 318949
08:04
Clean up the 'data' vs 'body' pointers in struct Packet. There's always been some confusion over exactly what it all means. I haven't cleaned it up to the point of complete sensibleness, but I've got it to a point where I can at least understand and document the remaining non-sensibleness. file: [4af948907c] check-in: [c011fa97b1] user: simon branch: trunk, size: 313954
08:03
Move SSH protocol enumerations out into ssh.h. This permits packet type codes and other magic numbers to be accessed from modules other than ssh.c. file: [9f2708c7bc] check-in: [71d87820cd] user: simon branch: trunk, size: 312323
08:03
Clean up the semantics of the ssh_rportfwd structure. It's now indexed by source hostname as well as source port (so that separate requests for the server to listen on addr1:1234 and addr2:1234 can be disambiguated), and also its destination host name is dynamically allocated rather than a fixed-size buffer. file: [88cf04123c] check-in: [87da2eda2d] user: simon branch: trunk, size: 319599
2013-09-08
08:20
Handle socket errors on half-open channels. Anthony Ho reports that this can occur naturally in some situation involving Windows 8 + IE 11 and dynamic port forwarding: apparently we get through the SOCKS negotiation, send our CHANNEL_OPEN, and then *immediately* suffer a local WSAECONNABORTED error before the server has sent back its OPEN_CONFIRMATION or OPEN_FAILURE. In this situation ssh2_channel_check_close was failing to notice that the channel didn't yet have a valid server id, and sending out a CHANNEL_CLOSE anyway containing 32 bits of uninitialised nonsense. We now handle this by turning our half-open CHAN_SOCKDATA_DORMANT into a half-open CHAN_ZOMBIE, which means in turn that our handler functions for OPEN_CONFIRMATION and OPEN_FAILURE have to recognise and handle that case, the former by immediately initiating channel closure once we _do_ have the channel's server id to do it with. file: [65d6fc0ac7] check-in: [1593971ebd] user: simon branch: trunk, size: 319337
02:14
Pass an error message through to sshfwd_unclean_close. We have access to one at every call site, so there's really no reason not to send it through to ssh.c to be logged. file: [ab7c5d0dc8] check-in: [36349ac57c] user: simon branch: trunk, size: 316785
2013-08-26
06:55
Fix free of an uninitialised pointer. CHAN_AGENT channels need c->u.a.message to be either NULL or valid dynamically allocated memory, because it'll be freed by ssh_channel_destroy. This bug triggers if an agent forwarding channel is opened and closed without having sent any queries. file: [f01903b995] check-in: [7b9042322c] user: simon branch: trunk, size: 316717
2013-08-18
01:48
Sensibly enforce non-interactive rekeying. We now only present the full set of host key algorithms we can handle in the first key exchange. In subsequent rekeys, we present only the host key algorithm that we agreed on the previous time, and then we verify the host key by simply enforcing that it's exactly the same as the one we saw at first and disconnecting rudely if it isn't. file: [9a03bd48e7] check-in: [cb5323bd7c] user: simon branch: trunk, size: 316682
2013-07-27
13:35
Add an assortment of missing consts I've just noticed. file: [bf95874977] check-in: [9388e0e1ae] user: simon branch: trunk, size: 315124
2013-07-21
05:12
If the SSH server sends us CHANNEL_CLOSE for a channel on which we're sitting on a pile of buffered data waiting for WINDOW_ADJUSTs, we should throw away that buffered data, because the CHANNEL_CLOSE tells us that we won't be receiving those WINDOW_ADJUSTs, and if we hang on to the data and keep trying then it'll prevent ssh_channel_try_eof from sending the CHANNEL_EOF which is a prerequisite of sending our own CHANNEL_CLOSE. file: [c546cd1227] check-in: [127cf34c50] user: simon branch: trunk, size: 315041
2013-07-14
12:08
In the various channel request mini-coroutines, replace crWaitUntilV(pktin) with plain crReturnV, because those coroutines can be called back either with a response packet from the channel request _or_ with NULL by ssh_free meaning 'please just clean yourself up'. file: [9e57224a1c] check-in: [f0f597f3a9] user: simon branch: trunk, size: 314648
05:46
Move the calculation of the exchange hash to above the various warnings about insecure crypto components. The latter may crReturn (though not in any current implementation, I believe), which invalidates pktin, which is used by the former. file: [30b2e36567] check-in: [ea02e2be18] user: simon branch: trunk, size: 314209
05:46
Fix another giant batch of resource leaks. (Mostly memory, but there's one missing fclose too.) file: [83b4c6f92d] check-in: [17fb711a78] user: simon branch: trunk, size: 314209
05:45
Tighten up a lot of casts from unsigned to int which are read by one of the GET_32BIT macros and then used as length fields. Missing bounds checks against zero have been added, and also I've introduced a helper function toint() which casts from unsigned to int in such a way as to avoid C undefined behaviour, since I'm not sure I trust compilers any more to do the obviously sensible thing. file: [74f3763e1d] check-in: [845f59bde8] user: simon branch: trunk, size: 314207
2013-07-07
09:34
Move the SSH-1 servkey and hostkey variables into the coroutine state, since there is a theoretical code path (via the crReturn loop after asking an interactive question about a host key or crypto algorithm) on which we can leave and return to do_ssh1_login between allocating and freeing those keys. (In practice it shouldn't come up anyway with any of the current implementations of the interactive question functions, not to mention the unlikelihood of anyone non-specialist still using SSH-1, but better safe than sorry.) file: [739a10a321] check-in: [86e974bb0e] user: simon branch: trunk, size: 310726
2013-07-01
12:56
A collection of small bug fixes from Chris West, apparently spotted by Coverity: assorted language-use goofs like freeing the wrong thing or forgetting to initialise a string on all code paths. file: [d9795d9788] check-in: [8962699297] user: simon branch: trunk, size: 310597
2013-02-20
17:30
Add support for HMAC-SHA-256 as an SSH-2 MAC algorithm ("hmac-sha2-256") as specified in RFC 6668. This is not so much because I think it's necessary, but because scrypt uses HMAC-SHA-256 and once we've got it we may as well use it. Code very closely derived from the HMAC-SHA-1 code. Tested against OpenSSH 5.9p1 Debian-5ubuntu1. file: [cdd2148974] check-in: [6c7bd4523b] user: ben branch: trunk, size: 310605
2012-09-18
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. file: [e54bd9b2ba] check-in: [f6fa69cf31] user: ben branch: trunk, size: 310587
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. file: [4ce7e8a5b1] check-in: [a2d79b9e07] user: ben branch: trunk, size: 310601
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. file: [1cb6dd1fd6] check-in: [45e5597a72] user: ben branch: trunk, size: 310529
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. file: [dfac041c63] check-in: [18cc9933bb] user: simon branch: trunk, size: 311757
2012-09-01
07:28
Factor out some common code for constructing SSH2_CHANNEL_OPEN. file: [019d03ec81] check-in: [a820fa2f7d] user: ben branch: trunk, size: 311197
07:10
struct winadj is unused now. G/c it. file: [002e850c90] check-in: [215a9bd3fa] user: ben branch: trunk, size: 311457
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. file: [316898e826] check-in: [7cd9f82d83] user: ben branch: trunk, size: 311592
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. file: [7a788dbd96] check-in: [3f43707fed] user: ben branch: trunk, size: 311830
2012-08-30
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. file: [65cbcd25f6] check-in: [91489422bb] user: simon branch: trunk, size: 312104
2012-08-27
17:02
Change return type of do_ssh2_transport() to void. Nothing pays attention to it any more, anyway. file: [904b019e37] check-in: [602c100aba] user: ben branch: trunk, size: 311818
16:55
Make bombout() less of a macro and more of a function. This gives GCC slightly fewer opportunities to gratuitously inflate its output. file: [2a8a0a200e] check-in: [e1f8ba8e7b] user: ben branch: trunk, size: 311864
14:11
Fix a memory leak in parse_ttymodes() (found by Memcheck/Valgrind). file: [7e8f3f2016] check-in: [f3232e6fc3] user: ben branch: trunk, size: 311872
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". file: [e5819e95ce] check-in: [fd2ca901e3] user: ben branch: trunk, size: 311823
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. file: [68fbc006e2] check-in: [8f16c188ed] user: ben branch: trunk, size: 311867
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. file: [3c5728e14e] check-in: [edfebde5a7] user: simon branch: trunk, size: 311956
2012-08-25
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. file: [f9881e0f70] check-in: [c87aa624ea] user: ben branch: trunk, size: 311855
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. file: [19563b5310] check-in: [3182a9a27e] user: ben branch: trunk, size: 311398
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. file: [37599cae0e] check-in: [054111be55] user: ben branch: trunk, size: 312255
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. file: [62c599dc55] check-in: [f8eedbd544] user: ben branch: trunk, size: 312968
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. file: [e9f2e6b08f] check-in: [008c38a33f] user: ben branch: trunk, size: 311614
2012-08-21
18:04
Fix recently-introduced memory leak in ssh2_msg_unexpected(). file: [f6cee84b14] check-in: [4d3163506d] user: ben branch: trunk, size: 311907
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. file: [3049565a79] check-in: [8a9f4acc01] user: ben branch: trunk, size: 311891
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. file: [c7bccd57e5] check-in: [147d6fa6a9] user: ben branch: trunk, size: 312474
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. file: [fc4c84990c] check-in: [4c44cc259a] user: ben branch: trunk, size: 309835
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. file: [53100310c0] check-in: [e5667a8d0d] user: ben branch: trunk, size: 309808
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. file: [e79ff4815f] check-in: [5da2ce49e0] user: ben branch: trunk, size: 310023
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. file: [23d139951b] check-in: [feb44c7dcc] user: simon branch: trunk, size: 309290
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. file: [edfae0559f] check-in: [aee68b8d31] user: simon branch: trunk, size: 308878
2012-06-04
18:32
Add missing check for failure to agree a host key algorithm. file: [46c636e931] check-in: [dac73d4239] user: simon branch: trunk, size: 308892
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. file: [bea019f208] check-in: [02b713d7b0] user: simon branch: trunk, size: 308750
2012-01-26
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. file: [2dbfa3f6ac] check-in: [4dc3ffb821] user: simon branch: trunk, size: 308589
2011-12-10
12:08
Tag 0.62 release. file: [3a4a8b93f4] check-in: [9c44b3c894] user: simon branch: putty-branch-0.61, size: 301250
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). file: [c92feaf081] check-in: [9377dd8f27] user: simon branch: trunk, size: 308577
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. file: [a02ee1d02b] check-in: [88c017dc17] user: simon branch: trunk, size: 307593
13:15
Whitespace fix while I was passing. file: [89d7dfb77f] check-in: [a1b22459c5] user: simon branch: trunk, size: 307605
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. file: [e55bfd3148] check-in: [fe229d2998] user: simon branch: trunk, size: 307607
2011-12-07
13:07
Add a missing free_prompts() call in the keyboard-interactive code. file: [422cfc3c2d] check-in: [596656b982] user: simon branch: trunk, size: 307541
2011-10-02
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. file: [409bcae31a] check-in: [3f7657c9b5] user: simon branch: trunk, size: 307233
06:01
Turn 'Filename' into a dynamically allocated type with no arbitrary length limit, just as I did to FontSpec yesterday. file: [66ecb8962a] check-in: [7756dc109c] user: simon branch: trunk, size: 307638
2011-09-14
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. file: [0f27e4cb3d] check-in: [a4b537e1f3] user: simon branch: trunk, size: 307640
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. file: [754c4c9994] check-in: [304b3571f2] user: simon branch: trunk, size: 307573
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. file: [aa8bf10a74] check-in: [3aaf9b7e0f] user: simon branch: trunk, size: 306705
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 . file: [4db2fa6df7] check-in: [de1e102574] user: simon branch: trunk, size: 306231
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). file: [77784ec330] check-in: [0831792ea4] user: simon branch: trunk, size: 305876
2011-07-18
13:09
Minor amendment to r9226: don't log GSSAPI failure in the Event Log twice. (Once in the GSSAPI code, once at the top of the main auth loop. Removed the latter.) file: [38f0dd2bca] check-in: [5ba3965a58] user: simon branch: trunk, size: 303310
2011-07-16
07:06
Reorganise the logging and display of messages about SSH authentication. We should now produce an Event Log entry for every authentication attempted and every authentication failure; meanwhile, messages in the PuTTY window will not be generated for the failure of auth types unless we also announced in the PuTTY window that we were trying them. (GSSAPI was getting the latter wrong, leading to spurious 'Access denied' for many users of 0.61.) file: [4a02ef75a0] check-in: [068c9141e5] user: simon branch: trunk, size: 303238
2011-07-14
13:52
Post-release destabilisation! Completely remove the struct type 'Config' in putty.h, which stores all PuTTY's settings and includes an arbitrary length limit on every single one of those settings which is stored in string form. In place of it is 'Conf', an opaque data type everywhere outside the new file conf.c, which stores a list of (key, value) pairs in which every key contains an integer identifying a configuration setting, and for some of those integers the key also contains extra parts (so that, for instance, CONF_environmt is a string-to-string mapping). Everywhere that a Config was previously used, a Conf is now; everywhere there was a Config structure copy, conf_copy() is called; every lookup, adjustment, load and save operation on a Config has been rewritten; and there's a mechanism for serialising a Conf into a binary blob and back for use with Duplicate Session. User-visible effects of this change _should_ be minimal, though I don't doubt I've introduced one or two bugs here and there which will eventually be found. The _intended_ visible effects of this change are that all arbitrary limits on configuration strings and lists (e.g. limit on number of port forwardings) should now disappear; that list boxes in the configuration will now be displayed in a sorted order rather than the arbitrary order in which they were added to the list (since the underlying data structure is now a sorted tree234 rather than an ad-hoc comma-separated string); and one more specific change, which is that local and dynamic port forwardings on the same port number are now mutually exclusive in the configuration (putting 'D' in the key rather than the value was a mistake in the first place). One other reorganisation as a result of this is that I've moved all the dialog.c standard handlers (dlg_stdeditbox_handler and friends) out into config.c, because I can't really justify calling them generic any more. When they took a pointer to an arbitrary structure type and the offset of a field within that structure, they were independent of whether that structure was a Config or something completely different, but now they really do expect to talk to a Conf, which can _only_ be used for PuTTY configuration, so I've renamed them all things like conf_editbox_handler and moved them out of the nominally independent dialog-box management module into the PuTTY-specific config.c. file: [5584fca7ae] check-in: [a2c0243430] user: simon branch: trunk, size: 301787
2011-07-01
16:53
Fix 'winadj-success': since at least one server (boks_sshd) blithely responds to "winadj@putty.projects.tartarus.org" with SSH_MSG_CHANNEL_SUCCESS despite probably having no idea what it means, treat this just the same as SSH_MSG_CHANNEL_FAILURE instead of killing the connection. Tested only as far as making sure that winadj/FAILURE with a normal server isn't _completely_ broken. file: [876d3b4147] check-in: [f1abb22039] user: jacob branch: trunk, size: 299419
2011-06-08
15:39
When we fail to get a response from Pageant, we should log the fact. Currently, if the IPC exchange goes wrong, the Event Log just prints "Pageant is running. Requesting keys." and then goes on to the next step without ever saying what happened. file: [4fe13eebd1] check-in: [fe6e6a6d68] user: simon branch: trunk, size: 299108
2011-05-07
05:57
Fixes (mostly from Colin Watson, a couple redone by me) to make Unix PuTTY compile cleanly under gcc 4.6.0 without triggering any of its new warnings. file: [8abd435223] check-in: [af856539a4] user: simon branch: trunk, size: 298949
2011-03-04
16:34
Implement zlib@openssh.com, using the rekey-after-userauth method suggested in the wishlist entry. file: [cdde96154f] check-in: [d3818c897b] user: jacob branch: trunk, size: 298978
2011-01-03
10:50
When iterating over all channels for a dead SSH connection, don't miss out those in the CHAN_SOCKDATA_DORMANT state (i.e., local-to-remote forwardings which the SSH server had not yet acknowledged). Marcel Kilgus has been running with the ssh_do_close() patch for nearly two years (*cough*) and reports that it has eliminated frequent 'unclean-close-crash' symptoms for him (due to the unclosed socket generating a pfd_closing() which accessed freed memory), although I've not reproduced that. The patch to ssh_free() is mine and not known to fix any symptoms. file: [e52e48edd5] check-in: [170d3850d4] user: jacob branch: trunk, size: 295972
2010-12-26
19:19
Add an option to disable SSH-2 banners. file: [3eefcfd285] check-in: [70e16df16a] user: jacob branch: trunk, size: 295902
2010-09-25
02:16
Cleanups of the GSSAPI support. On Windows, standard GSS libraries are now loaded from standard locations (system32 for SSPI, the registry-stored MIT KfW install location for KfW) rather than using the risky default DLL search path; I've therefore also added an option to manually specify a GSS DLL we haven't heard of (which should in principle Just Work provided it supports proper GSS-API as specified in the RFC). The same option exists on Unix too, because it seemed like too useful an idea to reserve to Windows. In addition, GSSAPI is now documented, and also (unfortunately) its GUI configuration has been moved out into a sub-subpanel on the grounds that it was too big to fit in Auth. file: [442b9afece] check-in: [e760173d54] user: simon branch: trunk, size: 295838
2010-09-09
09:35
Remove redundant check for NULL in sshfwd_close(). The thing we're testing against NULL has already been dereferenced by the time we bother to test it, so it's a bit pointless - and in any case, no null pointer can come to this function from any existing call site. file: [e5c3346967] check-in: [f6168ac02d] user: simon branch: trunk, size: 295518
2010-08-10
13:45
When we disconnect because we have no supported authentication methods left to try, it's nice to have the version of that message going to the client contain the list of methods sent by the server. Saves a user having to pull it out of an SSH packet log. file: [0b773f33b9] check-in: [b79dae693b] user: simon branch: trunk, size: 295523
2010-07-30
15:47
Cancelling a remote port forwarding that had been refused by the server caused a double-free. Reported and diagnosed by Sven Schaepe. Also fix a minor memory leak in ssh_free(). file: [774fe5f7e5] check-in: [679b1b8e8b] user: jacob branch: trunk, size: 295356
2010-07-04
17:53
Patch from Alan Ning (somewhat polished by me): introduce a flag called 'pending_close'. This deals with the situation in which we're forwarding a port, have received and locally buffered some data from the local endpoint but not yet been able to pass it down the SSH connection due to window limitations, and then the local endpoint closes its socket. In this situation what we've been doing until now is to immediately send SSH2_MSG_CHANNEL_CLOSE, causing the data still in our local buffer to be lost; now we instead set the new flag, which will remind us to send SSH2_MSG_CHANNEL_CLOSE _after_ we empty our bufchain. Should fix at least one manifestation of 'portfwd-close', though I don't know if it's the cause of all the reports we've ever seen. file: [ab5f57e35e] check-in: [d39e55d060] user: simon branch: trunk, size: 295229
2010-05-19
13:22
Patch from Alejandro Sedeno, somewhat modified by me, which reorganises the GSSAPI support so that it handles alternative implementations of the GSS-API. In particular, this means PuTTY can now talk to MIT Kerberos for Windows instead of being limited to SSPI. I don't know for sure whether further tweaking will be needed (to the UI, most likely, or to automatic selection of credentials), but testing reports suggest it's now at least worth committing to trunk to get it more widely tested. file: [1933e69ffb] check-in: [d096e14ac5] user: simon branch: trunk, size: 293371
2010-04-23
13:32
New SSH bug flag, for 'can't handle SSH2_MSG_IGNORE'. Another user today reported an SSH2_MSG_UNIMPLEMENTED from a Cisco router which looks as if it was triggered by SSH2_MSG_IGNORE, so I'm experimentally putting this flag in. Currently must be manually enabled, though if it turns out to solve the user's problem then I'll probably add at least one version string... [Edited commit message: actually, I also committed in error a piece of experimental code as part of this checkin. Serve me right for not running 'svn diff' first.] file: [cf908f1533] check-in: [9c99f25c74] user: simon branch: trunk, size: 292315
2010-02-17
13:02
Null out the socket pointers in X- and port-forwarding channels for which we close the socket without destroying the channel. John Peterson reports periodic crashes under heavy load which appear to be fixed by this, though I don't know the exact circumstances induced by that load. file: [99455398bc] check-in: [40866f6b70] user: simon branch: trunk, size: 291595
2010-01-17
10:20
Plug a few minor memory leaks, based on a patch by Sirp Potijk. While I'm here, add an assertion in sshrand.c to catch mistakes in reference counting. file: [d022724cb4] check-in: [fecf1a52c9] user: jacob branch: trunk, size: 291555
2009-08-18
18:38
Fix handling of duplicate port forwardings; they were effectively cancelling out, but are now just ignored. (We should make more effort to prevent duplicates before they get as far as ssh_setup_portfwd() -- it's currently trivially easy to enter them in the GUI and on the command line, let alone both -- but there's bound to be someone with a saved session containing dupes out there by now, and anyway there are duplicates we can't detect before getting this far, for instance "1234:localhost:22" vs "1234:localhost:ssh".) file: [a2ddb2041c] check-in: [16f350f6b0] user: jacob branch: trunk, size: 291503
2009-04-24
13:45
Richard Clark points out a missing check for ssh->mainchan being NULL. file: [1964b00091] check-in: [fbeba1f90f] user: simon branch: trunk, size: 291298
2009-03-03
13:57
Fix cosmetic keyboard-interactive issue: at the end of a normal k-i session, some servers (Debian in particular seems prone to this) send a k-i packet with no prompts and nothing to display. We were printing an extra "Using keyboard-interactive authentication" message in this case. (Introduced by me in r8172, I think.) file: [80ea37c505] check-in: [2229b9d9c3] user: jacob branch: trunk, size: 291281
2009-01-05
16:53
Be prepared for x11_setup_display() to return NULL (for instance, if DISPLAY has invalid contents). Simply refuse to try X forwarding in this circumstance. file: [edb15fdaae] check-in: [09b6bc2c14] user: jacob branch: trunk, size: 290889
2009-01-04
15:43
Log reason for failure to create a connection to a local X display. file: [38c24b926d] check-in: [ec4e3d53bd] user: jacob branch: trunk, size: 290879
2008-12-02
12:18
At some point recently, Unix PuTTY started suffering build errors using -DNO_GSSAPI. Move some ifdefs around so it stops. file: [12246f5635] check-in: [449718590d] user: simon branch: trunk, size: 290780
2008-11-26
08:30
Jacob correctly points out that I accidentally lost a clearing of s->gss_sndtok in r8326. I'm not sure it was strictly necessary, since even if there's no send token, gss_init_sec_context() is meant to explicitly make it empty, but it wasn't an intentional change. file: [67b99ee6e3] check-in: [c9729f111e] user: ben branch: trunk, size: 290680
06:49
Mitigation for VU#958563: When using a CBC-mode server-to-client cipher under SSH-2, don't risk looking at the length field of an incoming packet until we've successfully MAC'ed the packet. This requires a change to the MAC mechanics so that we can calculate MACs incrementally, and output a MAC for the packet so far while still being able to add more data to the packet later. file: [e538ac60bd] check-in: [4c69183b8d] user: ben branch: trunk, size: 290643
2008-11-24
17:44
Change how we handle the Ssh_gss_buf type. Previously, we defined it ourselves, but on Unix then assumed it was compatible with the system's gss_buffer_desc, which wasn't the case on LP64 systems. Now, on Unix we make Ssh_gss_buf into an alias for gss_buffer_desc, though we keep something similar to the existing behaviour on Windows. This requires renaming a couple of the fields in Ssh_gss_buf, and hence fixing all the references. Tested on Linux (MIT Kerberos) and Solaris. Compiled on NetBSD (Heimdal). Not tested on Windows because neither mingw32 nor winegcc worked out of the box for me. I think the Windows changes are all syntactic, though, so if this compiles it should work no worse than before. file: [c0331b3eb0] check-in: [68eb6751c6] user: ben branch: trunk, size: 287628
11:51
New option to allow use of the local OS username for login to the remote side if we have no better ideas, with UI shamelessly stolen from Quest PuTTY. Off by default, which effectively reverts the change to using the local username by default that came in with GSSAPI support in r8138. Anyone wanting seamless single sign-on will need to set the new option. (The previous default behaviour was getting in the way in ad-hoc scenarios.) Note that the PSCP and Unix-Plink behaviour of using the local username by default have remained unchanged throughout; they are not affected by the new option. Not sure if that's the Right Thing. file: [9089652589] check-in: [ce33b58a4d] user: jacob branch: trunk, size: 287513
2008-11-17
12:38
Revamp of the local X11 connection code. We now parse X display strings more rigorously, and then we look up the local X authority data in .Xauthority _ourself_ rather than delegating to an external xauth program. This is (negligibly) more efficient on Unix, assuming I haven't got it wrong in some subtle way, but its major benefit is that we can now support X authority lookups on Windows as well provided the user points us at an appropriate X authority file in the standard format. A new Windows-specific config option has been added for this purpose. file: [70a07a4fbe] check-in: [8eda1bb259] user: simon branch: trunk, size: 287651
2008-11-11
01:47
In SSH packet logging mode, log SSH-2 packet sequence numbers, in both directions. We had a bug report yesterday about a Cisco router sending SSH2_MSG_UNIMPLEMENTED and it wasn't clear for which packet; logging the sequence numbers should make such problems much easier to diagnose. (In fact this logging fix wouldn't have helped in yesterday's case, because the router also didn't bother to fill in the sequence number field in the SSH2_MSG_UNIMPLEMENTED packet! This is a precautionary measure against the next one of these problems.) file: [3ae6d66f81] check-in: [e2d3df5243] user: simon branch: trunk, size: 287739
2008-09-09
15:36
If we got a keyboard-interactive INFO_REQUEST with an "instruction" string but no actual prompts, we weren't displaying the former, which was wrong. We should now (although I haven't found a server to test it against). file: [a533321135] check-in: [223743ea02] user: jacob branch: trunk, size: 287660
2008-08-10
08:10
Initial commit of GSSAPI Kerberos support. file: [4c03135b2a] check-in: [483e1ff871] user: owen branch: trunk, size: 287607
2008-07-18
16:39
Another, subtly different version string for ssh2-bug-maxpkt, from Tim Kosse. file: [b5f15ebc58] check-in: [9b020a65b0] user: jacob branch: trunk, size: 281458
2008-06-01
06:16
Been meaning to do this for years: introduce a configuration option to manually tweak the host name and port number under which the SSH host key is read and written. I've put it in the cross-platform Connection panel. Partly under the flimsy pretext that other backends _can_ use it if they so wish (and in fact it overrides the host name for title-bar purposes in all network backends, though it has no other effect in anything but SSH); but mostly because the SSH panel was too full already :-) file: [294da3586c] check-in: [8d27b54607] user: simon branch: trunk, size: 281403
2008-05-31
12:22
Apparently Vista's printf-like functions don't support %n by default. We could explicitly re-enable %n, but we only use it in one place, so take the path of least resistance and remove that single instance. This stops dupvprintf() getting stuck in a loop (a behaviour that's caused by a workaround for a broken libc). <http://msdn.microsoft.com/en-us/library/ms175782(VS.80).aspx> file: [565a5092be] check-in: [d8ce60fff0] user: jacob branch: trunk, size: 280872
2007-12-04
18:02
Add a new bug-compatibility mode that limits the window size we'll advertise so that the server can't exceed our maximum packet size. Enable it for "1.36_sshlib GlobalSCAPE" which apparently sends oversize packets otherwise. file: [5b4be37ecd] check-in: [9d67c9cd70] user: ben branch: trunk, size: 280888
2007-10-03
16:21
Replace mentions of SSH-2 I-Ds with references to the corresponding RFCs. file: [c7638cd9f2] check-in: [b858df6074] user: ben branch: trunk, size: 280256
16:06
snew() always returns non-NULL, so checking if its return value is NULL is pointless. file: [62bcd50726] check-in: [d6878a67b7] user: ben branch: trunk, size: 280265
16:04
Factor out the increasingly complicated SSH-2 channel structure initialisation into its own function. Maintaining four copies was getting boring. file: [9a04d8a620] check-in: [88fdee8c45] user: ben branch: trunk, size: 280269
15:29
Take the code that does flow control in SSH-1, and make it work in SSH-2 as well. This won't be triggered in the usual case, but it's useful if the remote end ignores our window, or if we're in "simple" mode and setting the window far larger than is necessary. file: [68ae0d0216] check-in: [b54b9c2617] user: ben branch: trunk, size: 281198
2007-10-01
16:11
Rather than rejecting spurious SSH_MSG_CHANNEL_SUCCESSes, and ignoring spurious SSH_MSG_CHANNEL_FAILUREs, treat them as the protocol errors they are and forcibly disconnect. Inspired by recent traffic on comp.security.ssh. file: [ce8b94020a] check-in: [d719c8cbfb] user: ben branch: trunk, size: 280210
2007-09-30
14:42
Merge the looking up of channel numbers for SSH-2 channel messages into a single function which also handles checking that channels exist and are properly open. This should make PuTTY a little less tolerant of servers that send bogus messages. file: [2795bdc6a6] check-in: [6018bf7894] user: ben branch: trunk, size: 279312
2007-09-24
10:18
Add support for automatically tuning the SSH-2 window size for decent performance. The theory behind this is fairly simple, though the implementation turns out to be a little trickier than it looks. The basic idea is that when the connection isn't being limited by our ability to process data, we want to ensure that the window size _as seen by the server_ never drops to zero. Measuring the server's view of the window size is done by arranging for it to acknowledge every SSH_MSG_CHANNEL_WINDOW_ADJUST, or rather an SSH_MSG_CHANNEL_REQUEST sent just before it. That way we can tell when it its outgoing data stream it received the window adjustment, and thus how small the server's view of the window got. At present, we only ever increase the window size. In theory, we could arrange to reduce it again if the server's view of it seemed to be persistently too large, but my experiments suggest that getting this right will be tricky. file: [2ab4652258] check-in: [b331d3a1cc] user: ben branch: trunk, size: 279600
2007-09-20
16:33
Don't try SSH-1 RSA authentication unless the server has advertised support for it. It's possible that this obsoletes BUG_CHOKES_ON_RSA. Certainly the one SSH-1.5-Cisco-1.25 server I found was correctly not advertising RSA auth. For now, leave it in, because I'm not feeling entirely confident. file: [422873f950] check-in: [af3b8d40a9] user: ben branch: trunk, size: 275342
16:07
In SSH-1, don't attempt password authentication unless the server has announced support for it. Instead exit with a fatal error (since password auth is our last resort). file: [cc9181354f] check-in: [04c6df563b] user: ben branch: trunk, size: 275228
2007-09-03
14:09
ssh->mainchan can be NULL; try not to segfault in that situation. file: [860ce6c110] check-in: [757a472316] user: simon branch: trunk, size: 274827
2007-08-06
15:56
Use "int" rather than "unsigned" as the argument to ssh2_set_window, not because it can ever be negative, but because we'll be comparing it with another int. This way, C's promotion rules don't bite us and we should stand slightly more chance of coping with broken servers that overrun our window. file: [91e3631ec1] check-in: [126f2ed4f1] user: ben branch: trunk, size: 274799
2007-08-05
17:18
May as well reference an RFC rather than an Internet Draft where we can. file: [6b6b8e0a64] check-in: [24a823b68f] user: ben branch: trunk, size: 274809
09:18
Small window-handling tweaks. Set the default big window to 0x7fffffff bytes, and tweak ssh2_set_window() so it can cope with that. Also arrange to send a private channel message in simple mode to tell the server that it can safely use a large window too. file: [fe75ed4b5f] check-in: [7975f8a4ec] user: ben branch: trunk, size: 274828
2007-08-04
17:14
In the file-transfer applications, which only ever use the main channel, arrange to set the SSH-2 window size to something very large. This prevents the connection stalling when the window fills up, and means that PSCP receives data _much_ faster. file: [93be7c86d8] check-in: [0ce59e00b7] user: ben branch: trunk, size: 274276
11:04
Tweak window handling so that we send a window adjust if the window is half used up, rather than over half. That this increases the throughput of PSCP by 50% indicates just how broken our window handling is. file: [6ae7d94b7f] check-in: [6d0869b7d6] user: ben branch: trunk, size: 273909
10:48
When omitting session data from logs, don't omit the length of the session data string. This isn't strictly necessary, but it makes the logs easier to use. file: [6135e33c07] check-in: [abde6881f2] user: ben branch: trunk, size: 273908
09:32
Tweak to window handling: Keep the local window in a signed integer, and arrange to handle usefully the case where the server sends us more data than it's allowed to. There's no danger of overflow, since the maximum is OUR_V2_WINSIZE and the minimum is -OUR_V2_MAXPKT (at least if the server is nice). file: [77c64bc752] check-in: [ad4c0912dd] user: ben branch: trunk, size: 273912
2007-07-21
16:39
Split pkt_ctx into a separate enumeration for each of kex and userauth instead of a bitfield for both. This doesn't gain much here, but it should make it easier to make things other than logging use the context. file: [b6dc41c1d5] check-in: [57e427127a] user: ben branch: trunk, size: 273739
08:43
Arrange that log_packet() isn't called for raw data logging if logctx is null. This allows us to send data in ssh_init(), albeit at the expense of its not being properly logged, so arrange to send the version string then if that's sensible, which should reduce the number of round-trips required to bring up an SSH-2 connection. file: [a1f822c9c4] check-in: [0c80a9a49b] user: ben branch: trunk, size: 273799
2007-07-19
18:53
Separate out the code for creating and sending SSH version strings so that in the SSH-2-only case, we can send it as soon as we connect rather than waiting for the server's one. Unfortunately, actually doing so will take a little more effort -- there are subtleties to do with having a working log context at the right moment that need to be sorted out. file: [7c385a9430] check-in: [3341a0fb7c] user: ben branch: trunk, size: 273892
2007-07-18
17:54
Update an outdated comment. file: [924a946094] check-in: [bec140c810] user: ben branch: trunk, size: 273612
2007-06-30
16:56
Rationalise access to, and content of, backends[] array. Should be no significant change in behaviour. (Well, entering usernames containing commas on Plink's command line will be a little harder now.) file: [4d97f35cff] check-in: [8b1d299a90] user: jacob branch: trunk, size: 273610
13:18
Fix a couple of signedness compiler warnings, presumably due to me using a different version of gcc from before. file: [d93739f7a2] check-in: [97c7062940] user: simon branch: trunk, size: 273585
13:17
Tong Ho points out a missing ssh_pkt_ensure(). file: [5d5032772a] check-in: [b0ce384018] user: simon branch: trunk, size: 273577
2007-05-01
07:26
Reindent the section that was marked `XXX The lines below should be reindented before this is committed'. Unfortunately not before it was committed, but you can't have everything :-) file: [e40c293a71] check-in: [ea1538e924] user: simon branch: trunk, size: 273505
2007-04-30
17:09
Add support for RFC 4432 RSA key exchange, the patch for which has been lying around in my home directory for _years_. file: [d8f66199d2] check-in: [ba69804eab] user: ben branch: trunk, size: 272940
2007-02-17
16:33
Use preprocessor trickery to make the signal translation mechanism a little less hideous. The output of the preprocessor should be basically unchanged. file: [32a975c668] check-in: [491721f229] user: ben branch: trunk, size: 268862
16:15
ssh2_set_window checks whether the channel is being closed, so there's no need to check that before calling it. file: [7fc2407cf2] check-in: [b91d8b1269] user: ben branch: trunk, size: 269813
2007-02-06
07:57
When emitting SSH_MSG_IGNORE to protect against known-IV attacks on CBC, remember to put an empty string in it rather than sending a completely empty packet. This should help with those servers (notably RomSShell) that actually check the contents of SSH_MSG_IGNORE. file: [0c52c0150b] check-in: [bcc614254b] user: ben branch: trunk, size: 269867
2007-01-20
14:05
Fix compiles on GCC 3.3, which doesn't know about assert(0); file: [a1b1842c95] check-in: [fe98cc1cc0] user: ben branch: trunk, size: 269834
2007-01-17
12:38
Flag user cancellation of authentication as a clean exit, so that it will close the window even in `close window only on clean exit' mode. Also, while I'm here, arrange a suitable exit code for "exit-signal". file: [ea3cf20467] check-in: [b95f1de6c0] user: simon branch: trunk, size: 269777
2007-01-09
12:24
Get rid of all the MSVC warnings. file: [ea02ea8730] check-in: [1ef7a9aa1d] user: simon branch: trunk, size: 267592
2007-01-07
08:30
Fix ssh2-cisco-pw-pad by reverting r5122. However, I've kept the ability to easily re-enable the r5122 behaviour, in case we need to conditionally switch between the two at a later date. file: [7280af2d21] check-in: [a5397b1479] user: simon branch: trunk, size: 267546
2006-12-30
17:00
Patch from Colin Watson intended to give a clean Unix compile with GCC 4. (Since we choose to compile with -Werror, this is particularly important.) I haven't yet checked that the resulting source actually compiles cleanly with GCC 4, hence not marking `gcc4-warnings' as fixed just yet. file: [b63918a0a2] check-in: [ef14243dce] user: jacob branch: trunk, size: 265625
2006-10-22
14:51
Minor semantic tweak to bug-compatibility modes: make BUG_NEEDS_SSH1_PLAIN_PASSWORD do exactly what it says on the tin, independent of whether BUG_CHOKES_ON_SSH1_IGNORE is set. This is invisible in the default configuration, as all servers marked as having the second bug have the first one too, but it would allow one to manually configure PuTTY to cope with a SSH-1 server that got upset by ignore messages during authentication, but was fine with their use as keepalives. file: [29fb3ea598] check-in: [d0102515d4] user: jacob branch: trunk, size: 265609
2006-09-05
16:41
I seem to have slightly funted Plink's display of banners etc in r6437, oops. Fixed. file: [ca2f295619] check-in: [93bc517218] user: jacob branch: trunk, size: 265285
16:39
Slight change to password expiry UI for the benefit of Cisco servers, which are as usual slightly odd. file: [6dcc6f85bd] check-in: [2887f76e0f] user: jacob branch: trunk, size: 265265
2006-08-29
14:07
New logging mode, which records the exact bytes sent over the wire in an SSH connection _in addition_ to the decrypted packets. This will hopefully come in useful for debugging wire data corruption issues: you can strace the server, enable this mode in the client, and compare the sent and received data. I'd _like_ to have this mode also log Diffie-Hellman private exponents, session IDs, encryption and MAC keys, so that the resulting log file could be used to independently verify the correctness of all cryptographic operations performed by PuTTY. However, I haven't been able to convince myself that the security implications are acceptable. (It doesn't matter that this information would permit an attacker to decrypt the session, because the _already_ decrypted session is stored alongside it in the log file. And I'm not planning, under any circumstances, to log users' private keys. But gaining access to the log file while the session was still running would permit an attacker to _hijack_ the session, and that's the iffy bit.) file: [29b7b2563a] check-in: [5b5937160f] user: simon branch: trunk, size: 264136
2006-08-28
12:47
Minor tweaks to -nc: - log host:port in event log - add -nc to Plink usage message file: [828ecdc8a8] check-in: [6310d3d2a4] user: jacob branch: trunk, size: 263873
10:12
New command-line option in Plink (and PuTTY, though it's less useful there): `plink host -nc host2:port' causes the SSH connection's main channel to be replaced with a direct-tcpip connection to the specified destination. This feature is mainly designed for use as a local proxy: setting your local proxy command to `plink %proxyhost -nc %host:%port' lets you tunnel SSH over SSH with a minimum of fuss. Works on all platforms. file: [313cd0e109] check-in: [3171b7e2b9] user: simon branch: trunk, size: 263996
2006-08-27
03:03
The `socket' function in the backends is only ever checked to see if it's NULL. Since we already have one back end (uxpty) which doesn't in fact talk to a network socket, and may well have more soon, I'm replacing this TCP/IP-centric function with a nice neutral `connected' function returning a boolean. Nothing else about its semantics has currently changed. file: [46fba4821b] check-in: [32affe9699] user: simon branch: trunk, size: 261776
2006-08-26
04:21
Return a non-zero exit code in the event of a fatal-error SSH session termination. `Close window only on clean exit' was not working properly on Unix in the absence of this: notify_remote_exit() was being called and ssh_return_exitcode was returning zero, causing gtk_main_quit() to be called, _before_ connection_fatal() happened. file: [34fb29ff7f] check-in: [da0b093aaa] user: simon branch: trunk, size: 261765
2006-04-23
13:26
Sprinkle some header comments in various files in an attempt to explain what they're for. file: [cb22c2e2a8] check-in: [7932188e51] user: jacob branch: trunk, size: 261739
2006-03-12
13:24
Dimitry Andric spotted that DH gex with SHA-256 was overflowing a buffer. Fixed, and added paranoia so that this shouldn't happen again. file: [cf07375ac4] check-in: [ff7555e2cd] user: jacob branch: trunk, size: 261715
09:39
Log the hash used for DH kex (now there's a choice). file: [e27c194689] check-in: [160e173d94] user: jacob branch: trunk, size: 260706
2006-02-19
16:37
Daniel Meidlinger points out a redundant test :-) file: [8883d47ab2] check-in: [f643efedb0] user: simon branch: trunk, size: 260647
06:05
Introduce a new checkbox and command-line option to inhibit use of Pageant for local authentication. (This is a `don't use Pageant for authentication at session startup' button rather than a `pretend Pageant doesn't exist' button: that is, agent forwarding is independent of this option.) file: [5a57a556f0] check-in: [312df617cd] user: simon branch: trunk, size: 260668
2005-12-07
12:01
Apparently some SSH servers object to our claiming port-forwarded connections to be from IP "client-side-connection". Claiming "0.0.0.0" instead seems to work. Spotted by Brant Thomsen. file: [5eb30a6331] check-in: [0cf3aea3e9] user: jacob branch: trunk, size: 260605
2005-11-13
10:06
r6437 broke the case where Pageant is running but contains no SSH-2 keys that the SSH-2 server is happy with. Fixed, and since I'm here, fix `pubkeyfile-and-pageant' as well (for SSH-1 and SSH-2). Also, in SSH-2, we now reexamine "methods that can continue" for every Pageant key offer, which is technically more correct although it seems unlikely that it was causing any real problems. (It's not entirely pretty, but neither was the old code. We could probably do with some sort of abstraction for public/private keys to avoid carting lots of fiddly bits of data around.) file: [b1462acb61] check-in: [5ecfcce6b6] user: jacob branch: trunk, size: 260466
2005-11-09
17:19
I broke the ability to cope with multiple consecutive k-i INFO_REQUESTS in r6437. This ought to be better (but I can't test that case). file: [b922625a7a] check-in: [eefac6dd49] user: jacob branch: trunk, size: 258729
2005-11-04
17:31
Fix minor hiccup in SSH-1 p-k auth. file: [2c55e2072e] check-in: [b965b38836] user: jacob branch: trunk, size: 258117
17:21
Placate a compiler warning introduced in r6437. (I forgot we usually compile with -Werror on Unix, oops.) file: [3ecf5cc308] check-in: [992b547918] user: jacob branch: trunk, size: 258135
08:49
Fix for `ssh2-password-expiry'. Success case tested. (Much easier since r6437, and actually works to boot.) file: [17f0090ca7] check-in: [5033091888] user: jacob branch: trunk, size: 258066
2005-10-31
16:43
(do_ssh2_authconn_state).method is redundant since r6437; remove. Remove FIXMEs from .type assignments, as they look fine. file: [0612fd903b] check-in: [ad1b2a4de9] user: jacob branch: trunk, size: 254070
2005-10-30
14:24
Revamp SSH authentication code so that user interaction is more abstracted out; replace loops structured around a single interaction per loop with less tortuous code (fixes: `ki-multiprompt-crash', `ssh1-bad-passphrase-crash'; makes `ssh2-password-expiry' and `proxy-password-prompt' easier). The new interaction abstraction has a lot of fields that are unused in the current code (things like window captions); this is groundwork for `gui-auth'. However, ssh.c still writes directly to stderr; that may want to be fixed. In the GUI apps, user interaction is moved to terminal.c. This should make it easier to fix things like UTF-8 username entry, although I haven't attempted to do so. Also, control character filtering can be tailored to be appropriate for individual front-ends; so far I don't promise anything other than not having made it any worse. I've tried to test this fairly exhaustively (although Mac stuff is untested, as usual). It all seems to basically work, but I bet there are new bugs. (One I know about is that you can no longer make the PuTTY window go away with a ^D at the password prompt; this should be fixed.) file: [5c21580b70] check-in: [fa1347493a] user: jacob branch: trunk, size: 254323
09:16
Allow rsakey_pubblob() to return the key comment. (like r6433 but for SSH-1) file: [2940652b95] check-in: [4c5674dd5b] user: jacob branch: trunk, size: 253226
07:42
Add ability for ssh2_userkey_loadpub() to return the key comment. (Not actually used currently, but it makes life easier for a patch I'm working on.) file: [f1ed8ca3e4] check-in: [d7d7b6fd7d] user: jacob branch: trunk, size: 253213
2005-10-26
17:18
Fix an error I introduced into SSH packet logging in r5642: some outgoing packets over about 256 bytes would be logged with 12 bytes of preceding garbage. (But the rest of the packet was logged in its entirety. This holds for packets where (int(len/256)%2)==1, with an appropriate fudge factor applied to `len'.) Ahem. file: [77a24f6969] check-in: [b982e695f5] user: jacob branch: trunk, size: 253201
2005-10-13
17:51
Tweak to r6392: spell "MAC" thus. file: [5b981e8773] check-in: [bdcb94cf82] user: jacob branch: trunk, size: 253130
16:51
Make SSH_MSG_DISCONNECT reasons less scary (without removing useful content). file: [58ef025f1f] check-in: [9ad31acae5] user: ben branch: trunk, size: 253130
2005-09-10
11:19
Implement hmac-sha1-96. It's RECOMMENDED in the current transport draft, and we don't have any strong reason not to implement it, for all that it's rather pointless. file: [6a8e01101e] check-in: [07e74def32] user: ben branch: trunk, size: 253355
2005-09-04
09:53
Add support for diffie-hellman-group-exchange-sha256. Tested against a patched OpenSSH server. This is controlled by the same user settings as diffie-hellman-group-exchange-sha1, which may not be optimal, especially given that they're both referred to as dh-gex-sha1 in saved sessions. file: [15b2d978e8] check-in: [fac0751ecf] user: ben branch: trunk, size: 253311
2005-09-03
08:41
Restructure things so that a single entry in the KEX preference list can correspond to multiple SSH-2 KEX algorithms. We already do the equivalent for cipher algorithms. file: [17f0f0782f] check-in: [45f5ec7b5a] user: ben branch: trunk, size: 253311
2005-09-02
05:51
Check ssh->v2_session_id_len _after_ assigning to it. file: [f1992e0130] check-in: [2b3bb67839] user: jacob branch: trunk, size: 253217
2005-08-31
15:43
Add infrastructure for supporting multiple hashes in key exchange. Nothing very surprising here. file: [67cc3cabb0] check-in: [5e476e7efc] user: ben branch: trunk, size: 253217
14:11
Rename ssh_md5 and ssh_sha1 to ssh_hmac_md5 and ssh_hmac_sha1 respectively. This is to make room for a hash abstraction that's likely to want to use ssh_sha1, at least. file: [ab8acc2cb9] check-in: [9afc7f5e94] user: ben branch: trunk, size: 252466
2005-08-30
17:39
Further progress in the direction of variable exchange hashes -- stash the outgoing KEXINIT, and only start generating the exchange hash once we know which KEX method we're using. file: [9e12df6d31] check-in: [d49b79d098] user: ben branch: trunk, size: 252446
15:38
Beginnings of support for multiple exchange hashes in SSH-2: rather than storing a SHA-1 hash of the client and server version strings, store the strings themselves so we can feed them through the appropriate hash when we know what it is. file: [c62c051963] check-in: [9636ea0134] user: ben branch: trunk, size: 252221
2005-08-28
19:34
More versions of WeOnlyDo have the rekey bug (but they've fixed it now). file: [577e068284] check-in: [fb8ffeb494] user: jacob branch: trunk, size: 251965
2005-08-26
16:17
I think this should fix various problems with queued incoming data not being processed and incoming data being processed out of order, which I suspect is the cause of `ssh1-fwd-trouble' as noted by Gevan Dutton. I'm not able to test the failure case, but it doesn't seem to have obviously broken anything in the cases I have tested, anyway. file: [74111eccbf] check-in: [8579417a41] user: jacob branch: trunk, size: 251901
2005-08-22
15:07
Florian Gaab reports that freeSSHd 1.0.7, which claims a "softwareversion" of "WeOnlyDo-1.2.6", mishandles repeat key exchange. Add it to the list. file: [ed279e3aa3] check-in: [6c5b1e2063] user: ben branch: trunk, size: 251467
2005-07-24
08:46
draft-ietf-secsh-transport-24 says that only "SSH-" at the start of a line marks a version string. It's a bit vague about the definition of a line, but I think it's reasonable to assume that they'll end with LF. Change do_ssh_init() to ignore "SSH-" anywhere else. This makes the existing state machine overkill, so replace it with something a little more readable. file: [0420995858] check-in: [4a58cc8686] user: ben branch: trunk, size: 251429
2005-07-05
16:15
Piers Finlayson reports that "DigiSSH_2.0" chokes (in a new and exciting manner) on rekeys. Add it to the list. file: [3d498ed91e] check-in: [1ccaca97e2] user: ben branch: trunk, size: 251588
2005-06-21
15:13
Fix an apparently-harmless error spotted by Ben Rudiak-Gould: do_ssh2_transport() was returning the wrong value for rekeys after the first. This apparent error was introduced in r4901, but we can't see any reason for the change to have been made. If it turns out to be a mistake to revert it, I'm sure we'll find out. Here for posterity is Simon's analysis: | A lot of the return values from do_ssh2_transport appear to be vestigial: it | used to be that a zero return from do_ssh2_transport meant it had handled the | packet internally, and a 1 return meant the packet wasn't a transport-layer | one and needed to pass on to do_ssh2_authconn. Since r4901, however, the | layer discrimination is done based on the message type ranges, and the only | remaining dependency on the return value from do_ssh2_transport is a special | case in ssh2_protocol which detects the first 1 return and makes the | initialisation call to do_ssh2_authconn. | | Therefore, the gratuitous 1 return on every key exchange as a result of the | confusing if statement is simply ignored in ssh2_protocol (because | ssh->protocol_initial_phase_done is already TRUE). So the remaining question | was, why does the _lack_ of that 1 return not cause a problem, if the if's | sense is indeed reversed? | | The answer is that 1 is still returned, just not by the crReturn inside the | if statement. It's returned by the next crReturn, just after | wait_for_rekey(). Which suggests that in fact, the if statement has the | correct sense, but the crReturn inside it has the wrong value - it should be | returning _zero_, to indicate that every NEWKEYS after the first one is | uninteresting to the authconn code, and on the very first run through that | doesn't happen and the NEWKEYS gets all the way to the crReturn(1) later on. file: [4cbb09fe7a] check-in: [d4dea14f10] user: jacob branch: trunk, size: 251553
2005-06-20
08:56
Make the sanity-checks on the size of incoming packets much stricter. We now enforce the following: * Packet must have at least one byte of payload and four bytes of padding. * Total packet length must not exceed 35000 bytes compressed. * Total packet length including length field must be a multiple of cipher block size (or eight bytes). The feebleness of our old checks was noticed by Ben Rudiak-Gould. file: [a48ed817fa] check-in: [be45b43e16] user: ben branch: trunk, size: 251553
2005-06-19
09:17
A major purpose of PuTTY's memory-allocation functions is to succeed or die trying, so there's no need to check their return values for NULL. Spotted by Ben Rudiak-Gould. file: [588c5501a6] check-in: [3e02f6edcc] user: ben branch: trunk, size: 251495
2005-06-14
18:20
Detection of "auth-agent@openssh.com" was too liberal. Spotted by Ben Rudiak-Gould. file: [0a9e803c09] check-in: [a3dc59e09b] user: jacob branch: trunk, size: 251682
2005-05-28
08:46
Remove a couple of mistaken references to Telnet in comments. file: [bed80a844a] check-in: [28407185fe] user: jacob branch: trunk, size: 251681
2005-05-21
11:49
Factor out all local SSH disconnections into a new function ssh_disconnect(), and add the ability to treat a local disconnection as "unclean" -- notably, if we can't agree any authentication methods to even try; someone was complaining that the PuTTY window by default just disappears for no apparent reason in this circumstance. Also, use appropriate disconnect codes for those SSH2_MSG_DISCONNECT messages that we do send. I don't think I've seriously broken any user-visible behaviour, but the way that connection-close distinctions are transmitted to the front-end is shaky (or so it seems to me), so there may be non-ideal changes on some platforms. file: [2025e9904d] check-in: [e6f29ea107] user: jacob branch: trunk, size: 251691
2005-05-16
09:41
connection_fatal() should be called after ssh_closing() and other accesses to `ssh', since it potentially frees it and potentially doesn't return. Only affected a couple of rare circumstances. file: [2b1a44614a] check-in: [cd4cc612f7] user: jacob branch: trunk, size: 252318
03:31
Don't try and set up reconfigured port-forwardings if the connection isn't yet ready for them. Spotted by Martin Dushkov. file: [89a9441214] check-in: [669d063475] user: jacob branch: trunk, size: 252353
2005-05-12
10:09
Use the packet dispatch table to handle USERAUTH_BANNER messages, which should hopefully solve `drop-banner'. I haven't been able to test the failure case, but the behaviour with OpenSSH appears no worse. file: [78caa75a8f] check-in: [c9089df91e] user: jacob branch: trunk, size: 252333
2005-05-05
17:37
Implement `bypass-ssh2-userauth', since from correspondence it sounds like there are servers which could in principle operate in this mode, although I don't know if any do in practice. (Hence, I haven't been able to test it.) file: [5f48780fe6] check-in: [a2682d011b] user: jacob branch: trunk, size: 251430
2005-04-30
12:08
Also blank X authentication data when using SSH-1, and add a comment explaining why this may not be sufficient to hide it. file: [a1170dc35f] check-in: [56037102d7] user: ben branch: trunk, size: 251051
11:13
X11 authentication data are generally sensitive, so blank them from packet logs by default. file: [4b413e8be7] check-in: [8f27c860e7] user: ben branch: trunk, size: 250379
09:26
Fix stupid typo that probably utterly broke SSH-1 support, and caused compiles with GCC to fail. Not sure how it survived long enough to test, really. file: [be5852cc55] check-in: [4e40e32ee3] user: ben branch: trunk, size: 250294
2005-04-27
06:10
In SSH-2 mode, PuTTY wasn't sending KEXINIT until it had received one from the server, which led to stalemate if the server did the same. PuTTY now sends KEXINIT proactively as soon as it's worked out that it's talking SSH-2. file: [4f4e840103] check-in: [d33118fd29] user: ben branch: trunk, size: 250293
2005-04-23
11:22
Now that we've got at least some SDCTR modes working (and aes256-ctr is our default preferred cipher), add code to inject SSH_MSG_IGNOREs to randomise the IV when using CBC-mode ciphers. Each cipher has a flag to indicate whether it needs this workaround, and the SSH packet output maze has gained some extra complexity to implement it. file: [7b84e9283f] check-in: [98cafbbe9b] user: ben branch: trunk, size: 250225
2005-04-21
08:57
First crack at `terminal-modes' in SSH. PuTTY now sends ERASE by default, Unix Plink sends everything sensible it can find, and it's fully configurable from the GUI. I'm not entirely sure about the precise set of modes that Unix Plink should look at; informed tweaks are welcome. Also the Mac bits are guesses (but trivial). file: [15e2d1e08e] check-in: [533d29650c] user: jacob branch: trunk, size: 249110
2005-04-19
08:27
Remove "none" from the MACs we offer to support in SSH-2. (It was at the end, after the REQUIRED "hmac-sha1".) This has been present since SSH-2 support was introduced (r569). file: [fe4e917609] check-in: [40843350e9] user: jacob branch: trunk, size: 243646
2005-04-18
16:09
Add ability to construct SSH-1 packets incrementally (not used yet). I've added this to support `terminal-modes', but since this unifies some SSH-1 and SSH-2 packet construction code, it saves a few hundred bytes. Bonus. file: [4c337ab1e4] check-in: [6ce70c5c20] user: jacob branch: trunk, size: 244221
2005-04-14
17:58
Implement my experimental arcfour modes. The 256-bit version is disabled until I can test it against someone else's implementation. file: [54d26acb15] check-in: [3782733aa1] user: ben branch: trunk, size: 243827
2005-04-12
15:04
Unify GET_32BIT()/PUT_32BIT() et al from numerous source files into misc.h. I've done a bit of testing (not exhaustive), and I don't _think_ I've broken anything... file: [cf96054d0f] check-in: [a434996c3e] user: jacob branch: trunk, size: 243724
2005-03-30
02:27
<1112163342.018492.101240@f14g2000cwb.googlegroups.com> on comp.security.ssh contains a Dr Watson log which looks to me as if `unclean-close-crash' occurred due to a rekey timer going off after the session had closed. Hence, ssh2_timer() now avoids doing anything if the session is already closed, and also ssh_do_close() proactively calls expire_timer_context(). Between those I think they ought to solve the problem. file: [5c31a71a3a] check-in: [a38745f290] user: simon branch: trunk, size: 244173
2005-03-29
07:10
After we receive EOF on stdin, we should clear ssh->send_ok so that we stop trying to read anything further from stdin. Otherwise we send a continuous stream of SSH2_MSG_CHANNEL_EOF. file: [a1312f132d] check-in: [b8c79bfc5c] user: simon branch: trunk, size: 244092
2005-03-17
13:49
The structural reorganisation of ssh.c (r4909) caused ssh2_try_send() to no longer be run after receiving WINDOW_ADJUSTs. I believe this is likely to have been the cause of recent PSCP hanging issues. file: [e41fdf27f0] check-in: [5851365fea] user: simon branch: trunk, size: 244012
2005-03-11
09:24
Make it clearer which protocol version various bugs apply to. file: [a689ac8791] check-in: [154887e340] user: jacob branch: trunk, size: 243880
2005-03-10
10:36
Consistently use a single notation to refer to SSH protocol versions, as discussed. Use Barrett and Silverman's convention of "SSH-1" for SSH protocol version 1 and "SSH-2" for protocol 2 ("SSH1"/"SSH2" refer to ssh.com implementations in this scheme). <http://www.snailbook.com/terms.html> file: [c14924b6e9] check-in: [59a5e883d1] user: jacob branch: trunk, size: 243874
2005-03-06
10:38
Add notification when using the various auth methods with server-supplied prompts, to make it more obvious if a server is attempting to spoof a local passphrase prompt. I believe an alert user could have spotted this in all cases in SSH-2, although perhaps not in SSH-1. (But they'd have to have enabled TIS/CryptoCard.) file: [5b0318f4dc] check-in: [723767177f] user: jacob branch: trunk, size: 243822
2005-03-05
12:14
Over-enthusiastic assertions in the port forwarding code removed. Port forwardings are set up before initialising the last few details of the main shell session, so ssh->state can reasonably hold values other than SSH_STATE_SESSION and SSH_STATE_CLOSED during calls to sshfwd_*. file: [4f1c7bc349] check-in: [cb0a6e9c46] user: simon branch: trunk, size: 243639
11:56
Make sure we do notify_remote_exit(ssh->frontend) _before_ connection_fatal(), since the latter is entitled to destroy the backend so `ssh' may no longer be valid once it returns. For the Unix port, switch exit(0) to gtk_main_quit() in notify_remote_exit(), so that we don't exit before the subsequent connection_fatal()! file: [02195c6ae4] check-in: [695d639fd8] user: simon branch: trunk, size: 243789
2005-03-03
19:20
rm some magic numbers in ssh_setup_portfwd() file: [9c107b7290] check-in: [d2ef568fb3] user: jacob branch: trunk, size: 243788
2005-02-20
15:00
Another failure to crStop(0) on user abort, this time for SSH-1 cipher askalg(). That should be the last one. file: [91c3d5802b] check-in: [5d6cd77882] user: jacob branch: trunk, size: 243754
2005-02-19
08:48
Oops; missed out a crStop in the new host key verification code. file: [b038850488] check-in: [db594ef974] user: simon branch: trunk, size: 243741
2005-02-18
12:19
A few more fixes in the new asynchronous-alert-box mechanism. file: [cb3e9f21e4] check-in: [a5d370224a] user: simon branch: trunk, size: 243725
2005-02-17
13:31
Adjust the semantics of cfg.remote_cmd_ptr: it is now NULL when cfg.remote_cmd is to be used, rather than actually pointing at cfg.remote_cmd. This change restores the ability to structure-copy Configs without breaking them. (Though of course this is only a temporary solution: really what wants doing is to fix `config-struct'.) file: [af42c37524] check-in: [ac54c8cf58] user: simon branch: trunk, size: 243673
12:56
Ahem. Actually _checking_ that asynchronous askalg() worked would have been helpful. Since async verify_ssh_host_key() worked, I didn't think anything else could go wrong. How wrong I was. file: [db86a15f75] check-in: [e84ffae719] user: simon branch: trunk, size: 243592
12:34
Revamp interface to verify_ssh_host_key() and askalg(). Each of them now returns an integer: 0 means cancel the SSH connection and 1 means continue with it. Additionally, they can return -1, which means `front end has set an asynchronous alert box in motion, please wait to be called back with the result', and each one is passed a callback function pointer and context for this purpose. I have not yet done the same to askappend() yet, because it will take a certain amount of reorganisation of logging.c. Importantly, this checkin means the host key dialog box now works on OS X. file: [7bd22c00ef] check-in: [2b45db1342] user: simon branch: trunk, size: 243517
2005-02-16
20:00
ssh_do_close() should close any listening sockets associated with port-forwardings. file: [70f20b68f1] check-in: [8934c0e310] user: jacob branch: trunk, size: 238449
19:47
ssh_do_close() was only closing about half the channels. Fixed. file: [d52f1bfe06] check-in: [835f964689] user: jacob branch: trunk, size: 238055
05:56
Fix a minor valgrind issue in dynamic port-forwarding. file: [fb6ee85a26] check-in: [16a0978eb7] user: jacob branch: trunk, size: 238027
2005-02-15
11:05
The terminal window can now indicate that PuTTY is busy in various ways, by changing its mouse pointer. Currently this is only used in the (slightly- arbitrarily-defined) "heavy" bits of SSH-2 key exchange. We override pointer hiding while PuTTY is busy, but preserve pointer-hiding state. Not yet implemented on the Mac. Also switch to frobbing window-class cursor in Windows rather than relying on SetCursor(). file: [2014a53c88] check-in: [14b560857a] user: jacob branch: trunk, size: 237989
2005-02-09
19:03
ssh_setup_portfwd() should usually be looking at the new cfg, not the old one, so that changes to port visibility are honoured in new forwardings. file: [add6ba9dfe] check-in: [2f298ec6aa] user: jacob branch: trunk, size: 237631
18:16
Slightly gratuitous logeventf() crusade and purge of fixed-length buffers. Also a bonus sfree(). file: [42a2d4d3af] check-in: [0e48334e09] user: jacob branch: trunk, size: 237504
2005-01-26
12:11
Make a few things static file: [7148de03da] check-in: [4c389d057e] user: owen branch: trunk, size: 238043
2005-01-22
10:06
Don't abuse a remote channel number of (unsigned)(-1) to indicate a channel for which we don't yet have a remote number, and instead add a flag to indicate this fact. Fixes bug ssh-remoteid-minusone. file: [8cefdba313] check-in: [6039240c89] user: ben branch: trunk, size: 238015
07:32
Probable support for first_kex_packet_follows in KEXINIT. Not significantly tested since none of the common key-exchange protocols starts with a packet from the server, so I don't have a server that implements this. file: [c2eaf8f691] check-in: [834d6a4042] user: ben branch: trunk, size: 237837
2005-01-19
11:41
While we're here, pad USERAUTH_INFO_RESPONSEs to 256 bytes too. file: [46c4735db5] check-in: [b1da03aeda] user: ben branch: trunk, size: 236631
06:34
Make the outgoing SSH2 sequence number unsigned, so as to avoid depending on overflow behaviour of signed integers. file: [d14996c5d3] check-in: [9ab372a1fe] user: ben branch: trunk, size: 236598
2005-01-18
13:09
Yes we do mean assignment. Bah. file: [dc11e90e37] check-in: [a4d7543bf7] user: owen branch: trunk, size: 236588
03:38
ssh_pkt_getstring wants a boring int rather than an unsigned int. Let's give it one. file: [e5f91dab92] check-in: [e1b90bc8b9] user: owen branch: trunk, size: 236582
2005-01-17
04:07
Change some function arguments to void * to placate picky compilers. file: [b28cfa7f62] check-in: [e8bda63d8d] user: owen branch: trunk, size: 236600
2005-01-16
18:50
In SSH2, rather than sending an SSH_MSG_IGNORE after every password, just pad the packet out to 256 bytes. Much simpler. This leavs ssh2_pkt_defer() unused, so ifdef it out. file: [bb0e5cc701] check-in: [175fa7a092] user: ben branch: trunk, size: 236521
08:43
Be a little less enthusiastic about sending SSH_MSG_CHANNEL_WINDOW_ADJUST: only send it when it will significantly increase the server's idea of our window. This avoids the slew of one-byte WINDOW_ADJUSTs that an interactive shell typically generates. file: [2f7cf25ef6] check-in: [0268510fc1] user: ben branch: trunk, size: 237574
08:29
Support for falling back through the list of addresses returned from a DNS lookup, whether they're IPv4, v6 or a mixture of both. file: [97a99e870a] check-in: [d774282d73] user: simon branch: trunk, size: 237270
08:14
Make our SSH2 maximum packet size into a constant, since it's used in several places. file: [4627c9002c] check-in: [bb2febbcff] user: ben branch: trunk, size: 236987
2005-01-11
13:33
Fix `disconnect': arrange that we keep track of when we're expecting to see the server slam the TCP connection shut (i.e. almost never, unless it's just sent us an SSH_MSG_DISCONNECT), and treat an unexpected closure as a non-clean session termination. Previously any server-initiated connection closure was being treated as a clean exit, which was a hangover from the good old Telnet-only days. file: [b240478f28] check-in: [cffc0c078a] user: simon branch: trunk, size: 236943
10:33
Versions of OpenSSH before 2.5.4 kill the connection if the client attempts to rekey. Extend the description of SSH2_BUG_REKEY to cover this situation and apply it to the relevant OpenSSH versions. file: [91542f1c6b] check-in: [7b589f12f9] user: ben branch: trunk, size: 236290
09:33
Bah, I left a rogue event log entry lying around. file: [4187db6f24] check-in: [885c74ec18] user: simon branch: trunk, size: 236222
07:24
Sun_SSH_1.0.1 also has BUG_SSH2_REKEY. file: [a29c21327c] check-in: [a46b1af183] user: ben branch: trunk, size: 236256
04:37
Servers announcing themselves as `Sun_SSH_1.0' apparently cannot deal with rekeys at all: they totally ignore mid-session KEXINIT sent by the client. Hence, a new bug entry so we don't try it. file: [53f73460d3] check-in: [ed28fd9a5d] user: simon branch: trunk, size: 236217
2005-01-08
07:28
Clear the kex-specific context in ssh->pkt_ctx for every new key exchange. Without doing this, after we have done one specific-group DH exchange (group1 or group14), ssh2_pkt_type _always_ translates 30 and 31 as KEXDH_INIT and KEXDH_REPLY, making a subsequent group-exchange kex look rather strange in an SSH packet log. file: [e38265bad8] check-in: [779096703f] user: simon branch: trunk, size: 235181
2005-01-07
10:55
Simon points out that r5068 broke keyboard-interactive with multiple INFO_REQUESTs, and for some reason Debian OpenSSH is sending INFO_REQUESTs containing no prompts after a normal password authentication, so this should fix Shai's problem. file: [7a13d49d0b] check-in: [8f61fc5781] user: jacob branch: trunk, size: 235094
03:24
Use sk_set_frozen() to ensure that no data will be accepted from an SSH connection when we're in the middle of asking the user a dialog-box-type question. Fixes `unix-kex-packet', which has just bitten me when connecting to one of the work Suns. file: [8730ae1a77] check-in: [65b1240966] user: simon branch: trunk, size: 235067
2005-01-06
11:05
Add an explicit message about lack of support for PASSWD_CHANGEREQ in a half-hearted attempt to flush out any uses of it. file: [85a53ae167] check-in: [a79322b17b] user: jacob branch: trunk, size: 234583
07:23
`kbdint-failure': we now offer keyboard-interactive auth to the user for as long as the server offers it, rather than only once, unless the server responds to our initial USERAUTH_REQUEST("keyboard-interactive") with FAILURE, in which case we give up on it entirely. file: [3617c43197] check-in: [3f7f4f0136] user: jacob branch: trunk, size: 234405
2004-12-31
04:51
Allow reconfiguration of compression and cipher settings in mid-session in SSH2: this forces an immediate rekey to activate the new settings. I'm not sure exactly what this will be useful for (except possibly it might make comparative performance testing easier?), but it has wonderful James Bond value for being able to switch to a more secure cipher before doing anything sensitive :-) If, that is, you weren't using the most secure one to begin with... file: [c735b4378c] check-in: [6bca0a2afd] user: simon branch: trunk, size: 234402
2004-12-30
11:53
Reinstate the textual service name in port forwarding Event Log messages where specified. (I had removed this in the previous revision through forgetfulness.) file: [30d31a69ae] check-in: [084642d5c1] user: simon branch: trunk, size: 233433
11:48
Jacob points out that when we reconfigure port forwarding, we ought to be destroying old ones _before_ creating new ones, so that we can reuse a port for a new purpose without colliding with ourselves. Also fixed port forwarding, which my IPv6 checkin had completely funted :-) file: [443ddf61ef] check-in: [3e59d470f1] user: simon branch: trunk, size: 233026
10:45
Integrate unfix.org's IPv6 patches up to level 10, with rather a lot of polishing to bring them to what I think should in principle be release quality. Unlike the unfix.org patches themselves, this checkin enables IPv6 by default; if you want to leave it out, you have to build with COMPAT=-DNO_IPV6. I have tested that this compiles on Visual C 7 (so the nightlies _should_ acquire IPv6 support without missing a beat), but since I don't have IPv6 set up myself I haven't actually tested that it _works_. It still seems to make correct IPv4 connections, but that's all I've been able to verify for myself. Further testing is needed. file: [0eb425b572] check-in: [99d7fec46d] user: simon branch: trunk, size: 232881
09:29
Stray // comments. file: [f5d23fad04] check-in: [a7351a8274] user: simon branch: trunk, size: 232027
2004-12-29
06:32
Loose end from r5031: the Kex panel should only be displayed in mid-session if we are not using SSHv1. I've done this by introducing a generic `cfg_info' function which every back end can use to communicate an int's worth of data to setup_config_box; in SSH that's the protocol version in use, and in everything else it's currently zero. file: [66a5540a4e] check-in: [8cec6d493a] user: simon branch: trunk, size: 232023
2004-12-28
11:12
The latest unfix.org IPv6 patch contains these apparently IPv6-unrelated changes, which convert ints into unsigned in a few key places in ssh.c. Looks harmless at worst, possibly terribly useful, so I think we'll have these no matter what the real IPv6 stuff is up to! file: [435748952e] check-in: [23840b0529] user: simon branch: trunk, size: 231786
10:18
Forgot to initialise ssh->portfwds to NULL. Unusually, this was pointed out by the MSVC debugger, not by valgrind :-) file: [eeb6dc1ee3] check-in: [8a11a858c7] user: simon branch: trunk, size: 231732
08:10
Support reconfiguration of key exchange in mid-session. The fiddly bit is working out when to reschedule the next rekey for when the timeout or data limit changes; sometimes it will be _right now_ because we're already over the new limit. Still to do: the Kex panel should not appear in mid-session if we are using SSHv1. file: [dc2faae688] check-in: [25f79c1e9a] user: simon branch: trunk, size: 231706
08:07
SSH port forwarding is now configurable in mid-session. After doing Change Settings, the port forwarding setup function is run again, and tags all existing port forwardings as `do not keep'. Then it iterates through the config in the normal way; when it encounters a port forwarding which is already in the tree, it tags it `keep' rather than setting it up from scratch. Finally, it goes through the tree and removes any that haven't been labelled `keep'. Hence, editing the list of forwardings in Change Settings has the effect of cancelling any forwardings you remove, and adding any new ones. The SSH panel now appears in the reconfig box, and is empty apart from a message explaining that it has to be there for subpanels of it to exist. Better wording for this message would be welcome. file: [7a1c062576] check-in: [771c5deefb] user: simon branch: trunk, size: 230725
08:04
Abstracted out the rather large port-forwarding setup code into a routine which is common between SSH1 and SSH2. Since this routine is not part of the coroutine system, this means it can't sit and wait to get its various success/failure responses back. Hence, I've introduced a system of queued packet handlers, each of which waits for exactly one of a pair of messages (SSH1_SMSG_{SUCCESS,FAILURE} or SSH2_MSG_REQUEST_{SUCCESS,FAILURE}), handles it when it arrives, and automatically de-registers itself. Hence the port-forwarding setup code can be called once, and then subsequent packets related to it will automatically be handled as they arrive. The real purpose of all this is that the infrastructure is now there for me to arrange mid-session configurability of port forwarding. However, a side benefit is that fewer round trips are involved in session startup. I'd quite like to move more of the connection setup (X forwarding, agent forwarding, pty allocation etc) to using the new queued handler mechanism for this reason. file: [2e67c97615] check-in: [5c871b121e] user: simon branch: trunk, size: 226346
2004-12-24
07:39
Basic configurability for client-initiated rekeys. file: [87acf1a8ee] check-in: [10eff8e7d3] user: jacob branch: trunk, size: 227930
04:04
Don't offer repeat key exchange as a special command in SSH-1. file: [8172e00c0a] check-in: [7730aea1d9] user: jacob branch: trunk, size: 227770
2004-12-22
20:24
Add a preference list for SSH-2 key exchange algorithms, on a new "Kex" panel (which will gain more content anon). Retire BUG_SSH2_DH_GEX and add a backwards-compatibility wart, since we never did find a way of automatically detecting this alleged server bug, and in any case there was only ever one report (<3D91F3B5.7030309@inwind.it>, FWIW). Also generalise askcipher() to a new askalg() (thus touching all the front-ends). I've made some attempt to document what SSH key exchange is and why you care, but it could use some review for clarity (and outright lies). file: [00f658ca31] check-in: [c0c1b1745c] user: jacob branch: trunk, size: 227588
04:53
Support diffie-hellman-group14-sha1 group exchange. Tested against locally built OpenSSH 3.9, and seems to work fine. file: [fc5acf1587] check-in: [1716598298] user: simon branch: trunk, size: 226802
2004-12-16
09:38
Fix obviously stupid segfault. Ahem. file: [7e59e9caff] check-in: [95d7fcd0a1] user: simon branch: trunk, size: 226685
2004-12-02
07:37
NULL a couple of members after freeing them in ssh_free(). In particular, should stop ssh_do_close() accessing freed ssh->channels when invoked later from ssh_free(). Spotted by Fred Sauer. (Perhaps this is the cause of the crashes people have been reporting on abnormal closures such as `Software caused connection abort'? I've not been able to test this.) file: [c450a901da] check-in: [f3f0eafa38] user: jacob branch: trunk, size: 226685
2004-12-01
09:34
Bah. Ben points out that SSH_1_ version strings should still end in \n, and also that `\r' and `\n' don't mean what I think they mean on all compilers (Mac reverses them). file: [7b91ff1d99] check-in: [5cfe4be596] user: simon branch: trunk, size: 226638
07:42
And now I look at it, the latest draft also says version strings should be followed by \r\n, not just \n. file: [fb91c8d60f] check-in: [138a06123c] user: simon branch: trunk, size: 226618
07:37
Kimmo Parviainen points out that SSH software version strings have restrictions on the use of hyphens and spaces. file: [c075d39807] check-in: [9b824c14f2] user: simon branch: trunk, size: 226554
2004-11-29
03:27
typo in comment file: [560c415c07] check-in: [c12759e021] user: jacob branch: trunk, size: 225481
2004-11-27
13:56
Loose end from timing shakeup: sshrand.c is now a client of timing.c, and hence takes its own responsibility for calling noise_regular() at regular intervals. Again, this means it will be called consistently in _all_ the SSH-speaking tools, not just those in which I remembered to call it! file: [fc8b3adcd1] check-in: [4150c7ebb8] user: simon branch: trunk, size: 225482
09:32
Almost _all_ of the final connection-layer loop, in both SSH1 and SSH2, is now handled by the packet dispatch table. Dispatch table entries are enabled as soon as possible, so that if anyone tries to (for example) start using a forwarded port before the main shell session setup has finished, things should work sensibly. The SSH code is now a hybrid of coroutine-based sequential logic and table-driven event dispatch, each where it makes the most sense. I'm rather pleased with it. Should fix: ext-data-at-start, portfwd-at-start. file: [bbf2369e35] check-in: [b15612d1c4] user: simon branch: trunk, size: 225481
08:29
Implement client-initiated rekeys after an hour, or after 1Gb of data transfer in either direction (whichever comes first), or at explicit client request (nice idea Jacob). Have tested by lowering the limits, and it all seems solid enough; in particular, this has also allowed me to test the behaviour when connection-level data is received during rekey, and that looks fine too (at least it does _now_ :-). file: [ce0eb8ccda] check-in: [a58a9529c0] user: simon branch: trunk, size: 225126
07:20
New timing infrastructure. There's a new function schedule_timer() which pretty much any module can call to request a call-back in the future. So terminal.c can do its own handling of blinking, visual bells and deferred screen updates, without having to rely on term_update() being called 50 times a second (fixes: pterm-timer); and ssh.c and telnet.c both invoke a new module pinger.c which takes care of sending keepalives, so they get sent uniformly in all front ends (fixes: plink-keepalives, unix-keepalives). file: [82d91810b5] check-in: [683ee6bed3] user: simon branch: trunk, size: 221841
2004-11-24
14:35
Re-architected the top level of the SSH protocol handlers. ssh1_protocol() and ssh2_protocol() are now high-level functions which see _every_ SSH packet and decide which lower-level function to pass it to. Also, they each support a dispatch table of simple handler functions for message types which can arrive at any time. Results are: - ignore, debug and disconnect messages are now handled by the dispatch table rather than being warts in the rdpkt functions - SSH2_MSG_WINDOW_ADJUST is handled by the dispatch table, which means that do_ssh2_authconn doesn't have to explicitly special-case it absolutely every time it waits for a response to its latest channel request - the top-level SSH2 protocol function chooses whether messages get funnelled to the transport layer or the auth/conn layer based on the message number ranges defined in the SSH architecture draft - so things that should go to auth/conn go there even in the middle of a rekey (although a special case is that nothing goes to auth/conn until initial kex has finished). This should fix the other half of ssh2-kex-data. file: [ca65dc5df3] check-in: [3ffc78a463] user: simon branch: trunk, size: 221501
13:23
Now that Packet structures are dynamically allocated, it means we can keep several of them in parallel. In particular, this allows us to queue outgoing packets during repeat key exchange, to be actually sent after the rekey completes. (This doesn't fully fix ssh2-kex-data; also required is the ability to handle _incoming_ connection-layer packets during rekey without exploding.) file: [6b9b63b27e] check-in: [be91e5a407] user: simon branch: trunk, size: 221498
12:45
Minor refactoring: the fields `pktin' and `pktout' in the Ssh structure have been retired. Now all Packet structures are dynamically allocated. Each rdpkt function allocates one, and it's freed after being used; and the packet construction functions allocate them too, and they're freed by the send functions. `pktin' and `pktout' were ugly. They were _morally_ still global variables; even though they were replicated per SSH session to comply with the Mac no-globals requirement, they weren't really in the _spirit_ of `dynamically allocate your data'. As a side effect of this change, the `pktout_blanks' and `pktout_nblanks' fields in the Ssh structure have been moved into the Packet structure. file: [44dcc5a1e1] check-in: [55fff29d00] user: simon branch: trunk, size: 218037
2004-11-20
11:47
XXX comment in the logic which sends failed password auth back to username prompt for keyboard-interactive. I suspect we should do the same with that method (especially given the apparent number of systems that use it for regular password auth), but in the absence of systems to test against I've not actually made the change. (I'm worried that the `partial success' field might not be set correctly in a multi-stage authentication, for instance.) file: [6f2bf57b4b] check-in: [1de0f52527] user: jacob branch: trunk, size: 216063
11:11
As a result of the policy allowing changes of username to reset the authentication state, a failed `password' authentication in SSH-2 was sending us back to trying `none' and `keyboard-interactive' each time round, which uses up OpenSSH's quota of authentication attempts rather quickly. Added a check for `cfg.change_username' to the logic which sends us back to the start. file: [6d2a007c94] check-in: [ad08d145bf] user: jacob branch: trunk, size: 215975
2004-11-19
14:57
Remove FLAG_INTERACTIVE test from "login as:" prompt. Kelly John Carney pointed out that Plink would attempt to use a zero-length username iff a remote command was specified (because the FLAG_INTERACTIVE test was erroneously combined with the no-username test). I don't think this will break non-interactive use; in the cases which behave differently, Plink would be attempting to use the empty username, which was almost certainly wrong, whereas now it will give a prompt (which can be avoided with -batch as usual). (Although perhaps we should attempt to use a local username as a guess for the remote username, as PSCP does? I've not done this.) file: [72a37eac3c] check-in: [052f19dc36] user: jacob branch: trunk, size: 215874
2004-11-01
08:18
Argh, I messed up SSH1 remote tunnels too (same mistake). file: [772e6bd36b] check-in: [6ef518b9a5] user: jacob branch: trunk, size: 215934
2004-10-31
18:47
Ahem, let's not try initialising a static with a non-constant initialiser. Also, I'm pretty sure that adding a source address to a remote SSH-2 forwarding can never have worked, since we added an address string to the packet twice in that case. OpenSSH 3.4p1 certainly doesn't like it (`Server has disabled port forwarding' debug message). Fixed (and OpenSSH is happier now). file: [4405f36da4] check-in: [fb4b938df2] user: jacob branch: trunk, size: 215914
18:17
Argh. Failure to make a variable static to get round coroutine mechanics means that each SSH-2 remote tunnel will sfree() something random and thus have a chance of crashing or doing something else bad, although it won't otherwise affect execution. Introduced in 1.319 [r4529] (some of my improved diagnostics). One day I'll make a checkin to ssh.c without forgetting about the coroutines... file: [19cc1ac9e5] check-in: [b5c42f2525] user: jacob branch: trunk, size: 215881
2004-10-27
19:23
Malcolm Rowe spotted that we broke display of SSH2_MSG_DEBUG messages while fixing `vuln-ssh2-debug', by missing out a field. In most cases (always_display = 0) we would log a zero-length or truncated message. (Also add a prototype for ssh2_pkt_getbool().) file: [2dc8df3696] check-in: [911eda30fa] user: jacob branch: trunk, size: 215874
2004-10-22
11:50
Better bounds checking in the exit-signal handler. file: [6ccabccf93] check-in: [b0f77e81a6] user: simon branch: trunk, size: 215699
11:47
We ought to be using the ssh_pkt_* routines for the messages which we process at any time in the rdpkt routines, as well as everywhere else. file: [9a08214b07] check-in: [dcee5dd92a] user: simon branch: trunk, size: 215671
2004-10-17
19:41
Add support for logging "exit-signal", why not. This is disgustingly huge because old versions of OpenSSH got the message format wrong, so we have to infer which format is in use. Tested with Debian stable OpenSSH (3.4p1), with `uint32' packet, and lshd, which uses the correct `string' packet, and also let me test "core dumped" and the explanatory message. file: [462b67bbbf] check-in: [4b7166ef39] user: jacob branch: trunk, size: 216189
16:22
Support the SSH-2 mechanism for sending signals to a running session. Neither of the SSH servers I conveniently have access to (Debian stable OpenSSH -- 3.4p1 -- and lshd) seem to take a blind bit of notice, but the channel requests look fine to me in the packet log. I've included all the signals explicitly defined by draft-ietf-secsh-connect-19, but I've put the more obscure ones in a submenu of the specials menu; there's therefore been some minor upheaval to support such submenus. file: [9290e16ece] check-in: [e613d9b7a0] user: jacob branch: trunk, size: 213898
10:32
We shouldn't offer the Break special when we don't have a session to send it down. (A side effect of fixing this is that ssh->mainchain is set to NULL when it closes, which might avoid other sorts of trouble.) While we're here, don't bother offering SSH1_MSG_IGNORE if we believe the remote will barf on it. file: [bd408b6c08] check-in: [48e6df5b2f] user: jacob branch: trunk, size: 212175
2004-10-16
05:56
Moved the environment variables config block out of the Telnet panel into the Connection panel, and implemented support for the SSH2 "env" request. (I haven't yet found a server which accepts this request, so although I've visually checked the packet log and it looks OK, I haven't yet been able to do a full end-to-end test.) Also, the `pty' backend reads this data and does a series of `putenv' commands before launching the shell or application. This is mostly because in last week's UTF-8 faffings I got thoroughly sick of typing `export LANG=en_GB.UTF-8' every time I started a new testing pterm, and it suddenly occurred to me that this would be precisely the sort of thing you'd want to have pterm set up for you, particularly since you can configure it alongside the translation settings and so you can ensure they match up properly. file: [dafbd457a6] check-in: [a859123a17] user: simon branch: trunk, size: 211247
2004-10-13
08:43
Implement part of `ssh2-generality': introduce the ability to tell PuTTY / Plink not to run a remote shell/command at all. Supported in the GUI configuration and via the (OpenSSH-like) -N command-line option. No effort is currently made to arrange `nice' UI properties. If you do this in GUI PuTTY, a full-size terminal window will still be created, and will sit there with almost nothing in it throughout your session. If you do it in Plink, Plink will not accept any kind of request to terminate gracefully; you'll have to ^C or kill it. Nonetheless, even this little will be useful to some people... file: [acd11f96c5] check-in: [ec1afd9c5e] user: simon branch: trunk, size: 209114
2004-10-01
19:33
`ssh-log-pw-blank': known password fields are now omitted from SSH packet logs by default (although they can be included). There's also an option to remove session data, which is good both for privacy and for reducing the size of logfiles. file: [e7555f46a5] check-in: [a52cfa28f7] user: jacob branch: trunk, size: 208831
2004-09-29
18:57
Mention the negotiated SSH-2 MAC algorithm(s) in the Event Log. (It should be possible to at least see what MAC is in use without going to a SSH packet log.) file: [2e354bdc25] check-in: [c7e8751c9d] user: jacob branch: trunk, size: 204535
07:38
Report details in Event Log when receiving SSH2_MSG_CHANNEL_OPEN_FAILURE. file: [057530b0d5] check-in: [860ea1bd0c] user: simon branch: trunk, size: 204333
2004-09-21
16:04
Add `OSU_1.5alpha4' to BUG_CHOKES_ON_SSH1_IGNORE; this is apparently enough to enable login with this version. (I'd suspected as much -- see ssh.c CVS log 1.299 [r3359] -- and Geoffrey Hughes has now confirmed this.) file: [53475ca7ab] check-in: [00d9c804fc] user: jacob branch: trunk, size: 203426
2004-09-03
08:46
Improved diagnostics in port-forwarding: we now log any error returned by pfd_addforward() rather than just ignoring it. file: [48803605ab] check-in: [7ab101a451] user: jacob branch: trunk, size: 203393
07:28
In SSH-2, list each compression algorithm only once. (No particular reason for this change, just tidiness.) file: [85ac0ad238] check-in: [60397c817a] user: jacob branch: trunk, size: 202875
2004-08-28
11:51
More sensible error handling when we receive an SSH1 public key modulus of zero (!!), and also a robustness fix in ssh1_rdpkt which I happened to notice while debugging that. file: [e3103c5d98] check-in: [bea2fe89de] user: simon branch: trunk, size: 202765
2004-08-17
09:08
Someone complained that their keyboard-interactive password prompt was being truncated - it was from OpenSSH on HP/UX and had all sorts of stuff in it ("last successful login" etc). Bodged it by bumping up the space allocated in the fixed array for a password prompt. Also added an indication that the prompt is being truncated, as required by draft-ietf-secsh-auth-kbdinteract-06. (NB that before this checkin, there was a more-or-less harmless buffer overread where if we ever received a keyboard-interactive prompt with echo=1, we'd probably spew goo on the terminal; fixed now.) file: [bd9ce42f76] check-in: [4614439a8b] user: jacob branch: trunk, size: 202606
2004-08-14
07:24
ssh_free() should not call log_free(); it's for the front end to decide whether the logctx is finished with or not. file: [2be3827d5b] check-in: [f83300ea9e] user: simon branch: trunk, size: 202417
2004-08-12
20:08
Extra logging in SSH-2 port-forwarding. Most obviously, the opening of a forwarded X11 connection is now logged as well as the closing; but we also log the peer IP/port in case it's interesting, and log the reason for refusing to honour a channel open. file: [2796ee9ea9] check-in: [8c739cf713] user: jacob branch: trunk, size: 202491
2004-08-03
18:43
When using remote forwarding with SSH-1, you'd get bogus 'SSH1 cannot handle source address spec ":10023"; ignoring' type errors in the Event Log. The forwarding would go ahead as normal so this is cosmetic. Fixed. file: [cebe9a5a22] check-in: [d385f8c410] user: jacob branch: trunk, size: 202169
2004-08-01
07:07
Merged SSH1 robustness changes from 0.55 release branch on to trunk. file: [ef97f8fa1c] check-in: [461113bfb0] user: simon branch: trunk, size: 202168
2004-06-20
12:07
Add a configuration option for TCP keepalives (SO_KEEPALIVE), default off. No very good reason, but I've occasionally wanted to frob it to see if it makes any difference to problems I'm having, and it was easy. Tested that it does actually cause keepalives on Windows (with tcpdump); should also work on Unix. Not implemented on Mac (does nothing), but then neither is TCP_NODELAY. Quite a big checkin, much of which is adding `keepalive' alongside `nodelay' in network function calls. file: [506c85ebae] check-in: [d6cbea6730] user: jacob branch: trunk, size: 199774
2004-06-15
04:50
`Authenticating with key' message when using a local key file in SSH2 was not contained within a test for FLAG_VERBOSE. Thanks to Paul Gotch for pointing this out. file: [0d1add8538] check-in: [916230d9e9] user: simon branch: trunk, size: 199715
2004-06-03
05:36
Spotted by Dimitry Andric: `ssh-termspeed' implementation was not taking account of coroutines and used local variables over a crFoo. I believe the impact was cosmetic, affecting the speeds reported in the Event Log only. I've put the variables `ispeed' and `ospeed' in the main ssh_tag structure, even though they're only live for a short duration; I did this rather than create a new state struct for ssh1_protocol() (since ssh_tag already has short-duration junk like portfwd_strptr). file: [4485f9c6e7] check-in: [dc2e4b9a58] user: jacob branch: trunk, size: 199682
2004-04-24
15:05
In SSH, we now send terminal speeds to the server when requesting a pty (we didn't before) - `ssh-termspeed'. In the process, I've removed the individual controls on the Telnet and Rlogin panels and replaced them with one on the Connection panel (since they were backed by the same storage anyway). The terminal speeds sent in SSH are logged in the Event Log. file: [26767234d7] check-in: [fd231b00d9] user: jacob branch: trunk, size: 199553
2004-01-21
13:41
Two small memory leaks, also noticed by Martin Prikryl. file: [0564eb8465] check-in: [086da3a301] user: simon branch: trunk, size: 198633
13:33
Martin Prikryl points out that need_pw may be used uninitialised. file: [4c70b30da0] check-in: [e13b2bf694] user: simon branch: trunk, size: 198597
2004-01-18
03:14
Memory management fixes. Fixed a segfault in SSH1 compression cleanup noticed by Gerhard Wiesinger, and also fixed some memory leaks spotted by valgrind while debugging same. file: [1ebe83fe7d] check-in: [ce29cbc0c9] user: simon branch: trunk, size: 198572
2004-01-01
10:42
Joe Yates's memory leak patch was overenthusiastically freeing things; it called freebn on the DH gex values even if DH gex had not taken place. Bug was trivially reproducible as a NULL-dereference segfault by making any SSH2 connection with DH gex disabled. Should now be fixed. file: [c8b6a5385b] check-in: [698fe6e51d] user: simon branch: trunk, size: 198360
2003-12-19
06:44
Joe Yates's memory leak patches. file: [ea8adf7b78] check-in: [e9b1098ae1] user: simon branch: trunk, size: 198314
2003-11-22
08:50
Trivial braino in parsing of the port forwarding config data. Was causing all port forwardings after the first dynamic one to be ignored. file: [1b4f27ee44] check-in: [4295b1eb03] user: simon branch: trunk, size: 197549
2003-08-29
17:52
Work towards wish `keyfile-diagnostic'. Many sshpubk.c keyfile-loading functions have sprouted `**errorstr' arguments, which if non-NULL can return a textual error message. The interface additions are patchy and ad-hoc since this seemed to suit the style of the existing interfaces. I've since realised that most of this is masked by sanity-checking that gets done before these functions are called, but it will at least report MAC failures and the like (tested on Unix), which was the original point of the exercise. Note that not everyone who could be using this information is at the moment. file: [39502e78c6] check-in: [3623e79240] user: jacob branch: trunk, size: 197421
2003-08-07
11:04
Control of 'addr' is now handed over to {platform_,}new_connection() and sk_new() on invocation; these functions become responsible for (eventually) freeing it. The caller must not do anything with 'addr' after it's been passed in. (Ick.) Why: A SOCKS5 crash appears to have been caused by overzealous freeing of a SockAddr (ssh.c:1.257 [r2492]), which for proxied connections is squirreled away long-term (and this can't easily be avoided). It would have been nice to make a copy of the SockAddr, in case the caller has a use for it, but one of the implementations (uxnet.c) hides a "struct addrinfo" in there, and we have no defined way to duplicate those. (None of the current callers _do_ have a further use for the SockAddr.) As far as I can tell, everything _except_ proxying only needs addr for the duration of the call, so sk_addr_free()s immediately. If I'm mistaken, it should at least be easier to find the offending free()... file: [7f225d8584] check-in: [d318104cf5] user: jacob branch: trunk, size: 197190
2003-07-12
08:45
Add SSH-1 password camouflage bug detection for version OSU_1.4alpha3 of the OSU VMS SSH server <http://kcgl1.eng.ohio-state.edu/~jonesd/ssh/>. The changelog appears to indicate that the server was fixed for pwplain1 at 1.5alpha4, and for IGNORE and DEBUG messages at 1.5alpha6. However I'm going to go on the reports we've had as I haven't tested this; and they indicate only that 1.5alpha6 is known not to require any bug compatibility modes. (I wasn't sure whether to add this at all, given that upgrading to version OSU_1.5alpha6 is an easy way to fix the problem. However, there is precedent for adding detection for old versions of servers which have since been fixed.) file: [cdadabd187] check-in: [2cf32ed275] user: jacob branch: trunk, size: 197214
2003-06-26
08:41
Fix a segfault (non-security-critical - null dereference for reading) in the zlib code when fed certain kinds of invalid data. As a result, ssh.c now needs to be prepared for zlib_decompress_block to return failure. file: [58605ad006] check-in: [0d2defefe0] user: simon branch: trunk, size: 197145
2003-06-14
13:27
Fix a couple of memory leaks pointed out by Adam Bernstein. file: [b8fa609939] check-in: [f251013cab] user: ben branch: trunk, size: 197060
2003-05-24
14:03
Add exceptions for "VShell" to the ssh.com bug compatibility modes (which are just numbers) in an attempt to fix `vshell-no-bug-compat'. Not even tested a little bit. file: [a368a87b20] check-in: [07103bef21] user: jacob branch: trunk, size: 197007
2003-05-13
13:23
Rename crc32() to crc32_compute(), to avoid clashing catastrophically with the crc32() function in the zlib interface. (Not that PuTTY itself _uses_ zlib, but on Unix it's linked against libgtk which uses libpng which uses zlib. And zlib has poor namespace management so it defines this ridiculously intrusive function name. Arrrrgh.) file: [f3c35ab646] check-in: [3bdddd4aca] user: simon branch: trunk, size: 196943
2003-05-10
07:54
Make ssh_agent_callback() and ssh_agentf_callback() static. file: [f4bce315cb] check-in: [4e8c6bdb81] user: ben branch: trunk, size: 196927
2003-05-04
09:18
Colin's const-fixing Patch Of Death. Seems to build fine on Windows as well as Unix, so it can go in. file: [96cd8f327d] check-in: [c9f1945192] user: simon branch: trunk, size: 196913
09:14
Colin's and my fixes to connection_fatal(). file: [9f563cc66c] check-in: [1bf6f94877] user: simon branch: trunk, size: 196829
2003-04-28
06:41
First half of `pageant-async' work. agent_query() is now passed a callback function; it may return 0 to indicate that it doesn't have an answer _yet_, in which case it will call the callback later on when it does, or it may return 1 to indicate that it's got an answer right now. The Windows agent_query() implementation is functionally unchanged and still synchronous, but the Unix one is async (since that one was really easy to do via uxsel). ssh.c copes cheerfully with either return value, so other ports are at liberty to be sync or async as they choose. file: [ad05b1f28e] check-in: [038bb0a77e] user: simon branch: trunk, size: 196823
2003-04-25
12:44
The new ssh_do_close() function itself causes a segfault if the connection goes foom before ssh->channels is set up. Oops. Fixed. file: [e1154a6127] check-in: [899cb52b70] user: simon branch: trunk, size: 194855
06:48
Robustness in the face of sudden connection closures: we now make a credible effort to shut down open forwardings cleanly when the owning SSH connection terminates abruptly (for whatever reason). file: [8dd669a4aa] check-in: [26f97a0d19] user: simon branch: trunk, size: 194817
2003-04-23
08:48
Unix makefile now uses -O2, which massively cuts down key exchange time. This gives rise to a whole bunch of spare warnings, one or two of which might have been actual bugs; now all resolved. file: [d4aa40388f] check-in: [6c10570c0b] user: simon branch: trunk, size: 194070
2003-04-18
04:06
Oops; we _do_ need to set dport even when doing dynamic forwarding, because otherwise the `if (sport && dport)' statement runs the risk of not working. file: [3c316ebbff] check-in: [f3060f0139] user: simon branch: trunk, size: 194112
04:00
Fix obvious foulup in X forwarding: my recent `how did this ever work' change to port forwarding completely broke it, by failing to set peeraddr{,len} before reading them. Oops. file: [2254c5304c] check-in: [58503ab138] user: simon branch: trunk, size: 194084
2003-04-09
06:19
Remote-to-local port forwarding in SSH2 was apparently completely broken! We were expecting the peer address/port in the incoming packet _before_ the connected address/port, which is just wrong. I wonder how I managed to mess that up. file: [e656b52f13] check-in: [ccc0edfdd6] user: simon branch: trunk, size: 194068
2003-04-05
05:45
Dynamic port forwarding by means of a local SOCKS server. Fully supports SOCKS 4, SOCKS 4A and SOCKS 5 (well, actually IPv6 in SOCKS 5 isn't supported, but it'll be no difficulty once I actually get round to it). Thanks to Chas Honton for his `stone soup' patch: I didn't end up actually using any of his code, but it galvanised me into doing it properly myself :-) file: [d812fdb51b] check-in: [9c2b8c4c52] user: simon branch: trunk, size: 193894
2003-04-04
14:21
Turned the old `Telnet Command' System-submenu into a more general `Special Command' menu, in which any backend can place its own list of magical things the user might want to ask the backend to do. In particular I've implemented the recently proposed "break" extension in SSH2 using this mechanism. NB this checkin slightly breaks the Mac build, since it needs to provide at least a stub form of update_specials_menu(). file: [0ded870164] check-in: [53746610b8] user: simon branch: trunk, size: 192936
2003-03-31
07:15
Make sure the socket is closed properly in the various SSH exit paths. file: [69d8a61eed] check-in: [951d79cdac] user: simon branch: trunk, size: 191765
05:22
Ahem; fix `bombout' so it passes the correct frontend handle to connection_fatal(). file: [5edae4fc1c] check-in: [e2d4e935f5] user: simon branch: trunk, size: 191518
2003-03-29
17:05
In a couple of places, snewn() was being asked for an array of char which was then assigned to an unsigned char * variabe. This fixes that. file: [6c30adc632] check-in: [8f705367ec] user: ben branch: trunk, size: 191579
10:14
Introduced wrapper macros snew(), snewn() and sresize() for the malloc functions, which automatically cast to the same type they're allocating the size of. Should prevent any future errors involving mallocing the size of the wrong structure type, and will also make life easier if we ever need to turn the PuTTY core code from real C into C++-friendly C. I haven't touched the Mac frontend in this checkin because I couldn't compile or test it. file: [022ada4fd6] check-in: [48c3c19745] user: simon branch: trunk, size: 191570
2003-03-14
15:20
While I'm adding explanatory comments by the coroutine macros, it occurs to me that would also be a good place to put a copy of the instructions for disabling Edit and Continue debugging. Nobody _actually_ reads the README, after all... file: [64cc0049e5] check-in: [1838c429d8] user: simon branch: trunk, size: 191315
2003-03-03
10:35
I've been meaning to get round to this for _ages_: in front of my coroutine macros, I now include a comment linking to my web article that explains what they do. file: [a4a2de0b97] check-in: [d1fbd328fa] user: simon branch: trunk, size: 190831
2003-02-28
14:28
In merging the username and password input functions I inadvertently removed the support for control characters in passwords. Replaced. file: [7848d2ec44] check-in: [9c58e8f454] user: simon branch: trunk, size: 190621
2003-02-22
18:13
Work around an SC bug that causes it to try to use the same register for two purposes in s_wrpkt_prepare(). This makes SSH1 work on 68K Macs, at least until I deactivate the terminal window... file: [bd54573f84] check-in: [0d1b151319] user: ben branch: trunk, size: 190399
2003-02-18
14:10
Fix `ssh2.0.11-keyderive-nonbug' on the strength of Ben's analysis. Not tested it myself. file: [ab41bb0e5c] check-in: [dbeef9d5a7] user: jacob branch: trunk, size: 190091
2003-02-04
07:02
Add another bug workaround, this one for old OpenSSH (<2.3) servers which have a strange idea of what data should be signed in a PK auth request. This actually got in my way while doing serious things at work! :-) file: [d7e47903e0] check-in: [2a3598e202] user: simon branch: trunk, size: 190094
07:00
Further fallout from the introduction of the Filename type. (Memo to self: if you change the type of a variable and everything compiles without type-checking errors, that doesn't mean it's all fixed, because variadic functions aren't type-checked! Oops.) file: [109e86c06e] check-in: [c83f62d857] user: simon branch: trunk, size: 189026
2003-02-01
11:24
Oops, Ben is quite right about the rather appalling design of filename_from_str. Here's a better fix, with some const repercussions too. file: [f92e82a15d] check-in: [f8d33b50cd] user: simon branch: trunk, size: 188949
06:54
Created new data types `Filename' and `FontSpec', intended to be opaque to all platform-independent modules and only handled within per-platform code. `Filename' is there because the Mac has a magic way to store filenames (though currently this checkin doesn't support it!); `FontSpec' is there so that all the auxiliary stuff such as font height and charset and so on which is needed under Windows but not Unix can be kept where it belongs, and so that I can have a hope in hell of dealing with a font chooser in the forthcoming cross-platform config box code, and best of all it gets the horrid font height wart out of settings.c and into the Windows code where it should be. The Mac part of this checkin is a bunch of random guesses which will probably not quite compile, but which look roughly right to me. Sorry if I screwed it up, Ben :-) file: [954d32be56] check-in: [497dc397e7] user: simon branch: trunk, size: 188930
2003-01-27
12:02
Remove all `enum'-typed variables from the Config structure. Everything in there which is integral is now an actual int, which means my forthcoming revamp of the config box will be able to work with `int *' pointers without fear of doom. file: [b082db57d5] check-in: [b7a1f42e84] user: simon branch: trunk, size: 188850
2003-01-18
16:02
Remove stray debugging code that got in with the last commit. file: [489e633c9e] check-in: [454cf38c50] user: ben branch: trunk, size: 188860
15:56
Clear kex_ctx in a new session so we can safely free an ssh session without one. file: [e6e3a37534] check-in: [72ba35c7bb] user: ben branch: trunk, size: 188912
2003-01-15
17:30
Add the ability to close sessions. This adds *_free() functions to most areas of the code. Not all back-ends have been tested, but Telnet and SSH behave reasonably. Incidentally, almost all of this patch was written through Mac PuTTY, admittedly over a Telnet connection. file: [afcf87beda] check-in: [c4f9059891] user: ben branch: trunk, size: 188835
2003-01-12
09:26
proxy.c now no longer refers to `cfg'. Instead, each of the three proxy-indirection network functions (name_lookup, new_connection, new_listener) takes a `const Config *' as an argument, and extracts enough information from it before returning to handle that particular network operation in accordance with the proxy settings it specifies. This involved {win,ux}net.c due to a `const' repercussion. file: [10dff3188d] check-in: [894cb1e750] user: simon branch: trunk, size: 187250
08:56
There's no real need for portfwd.c to reference `cfg' directly, when it only needs one item from it and that can easily be passed in from the call site in ssh.c. file: [10a12a5f74] check-in: [e5b0235ad5] user: simon branch: trunk, size: 187197
08:48
The back ends now contain their own copies of the Config structure, and have a function to pass in a new one. (Well, actually several back ends don't actually bother to do this because they need nothing out of Config after the initial setup phase, but they could if they wanted to.) file: [cf61350026] check-in: [f4d72755c1] user: simon branch: trunk, size: 187145
08:11
Support for XDM-AUTHORIZATION-1 at the SSH server end, making use of the remote IP/port data provided by the server for forwarded connections. Disabled by default, since it's incompatible with SSH2, probably incompatible with some X clients, and tickles a bug in at least one version of OpenSSH. file: [99765c2e91] check-in: [55fa8e003a] user: simon branch: trunk, size: 185875
2003-01-11
04:05
Yet _another_ `received data for nonexistent channel' bug. This time it was because we received WINDOW_ADJUST on a channel we'd already sent CLOSE on, and reflexively attempted to continue sending the buffered data in response. Should now be fixed. file: [3c59b87928] check-in: [98f54831b9] user: simon branch: trunk, size: 185535
2003-01-10
12:33
Introduce framework for authenticating with the local X server. Windows and Mac backends have acquired auth-finding functions which do nothing; Unix backend has acquired one which actually works, so Plink can now do X forwarding believably. (This checkin stretches into some unlikely parts of the code because there have been one or two knock-on effects involving `const'. Bah.) file: [a51d8a82e7] check-in: [5ec7a0298b] user: simon branch: trunk, size: 185423
2003-01-09
11:33
Yikes! Forgot to zero the password after SSH2 PW authentication. file: [a0e61afe0d] check-in: [aa17fae5a8] user: simon branch: trunk, size: 185307
2003-01-07
17:05
Use '\012' as the end of the SSH banner line, not '\n'. Mac compilers default to making '\n' == '\015'. file: [90fdc019b7] check-in: [d44d168232] user: ben branch: trunk, size: 185260
16:45
Initialise the "protocol" field of a new ssh_tag to NULL so Bad Things don't happen if we try to type things before the SSH banner has been received. file: [8f818c8c3e] check-in: [b61b55710e] user: ben branch: trunk, size: 185254
2003-01-05
17:01
Make ssh1_pkt_type(), ssh2_pkt_type, logeventf(), setup_userpass_input(), process_userpass_input(), and ssh_unthrottle() static, since they're not referenced outside this file. file: [5063b16830] check-in: [0fbb2d9948] user: ben branch: trunk, size: 185227
16:53
Move x11fwd and portfwd prototypes from ssh.c into ssh.h so they can be seen by (and checked against) the definitions. file: [5ec2a7c1e3] check-in: [f286ce2a32] user: ben branch: trunk, size: 185185
07:46
Deal with "possible unintended assignment" warnings. file: [3b494ce9cd] check-in: [616c91e0f9] user: ben branch: trunk, size: 185917
07:43
Attack char * vs unsigned char * conversions. In most cases, I've just gone for replacing the implicit casts with explicit ones. Where there was something obviously better that I could do, I've done it, though. file: [1a7301e6c1] check-in: [768d1ae040] user: ben branch: trunk, size: 185901
2003-01-02
04:41
Propagate the screen number from a local X display to the remote forwarded one. Fixes `x11-default-screen'. file: [2252139a27] check-in: [dc76e6731e] user: simon branch: trunk, size: 185535
2002-12-19
08:24
Move the stderr output of event log messages in verbose mode to the general logging module rather than localising it in ssh.c. This means it should work in other protocols as well (notably Telnet, where it might actually be useful for debugging negotiations). file: [603b7b5500] check-in: [9ea3dc8f8a] user: simon branch: trunk, size: 185436
05:51
logeventf() shouldn't throw stuff at stderr, since it invokes the ssh.c logevent _macro_ which has already done so! Duhh. file: [2343d3d3fc] check-in: [919330be30] user: simon branch: trunk, size: 185581
2002-12-18
10:23
Support for doing DNS at the proxy end. I've invented a new type of SockAddr, which just contains an unresolved hostname and is created by a stub function in *net.c. It's an error to pass this to most of the real-meat functions in *net.c; these fake addresses should have been dealt with by the time they get down that far. proxy.c now contains name_lookup(), a wrapper on sk_namelookup() which decides whether or not to do real DNS, and the individual proxy implementations each deal sensibly with being handed an unresolved address and avoid ever passing one down to *net.c. file: [dd26e8d644] check-in: [8d3480376f] user: simon branch: trunk, size: 185694
05:39
Implement `portfwd-loopback-choice'. Works on local side in Unix as well, though it's a lot less useful since you still can't bind to low-numbered ports of odd loopback IPs. Should work in principle for SSH2 remote forwardings as well as local ones, but OpenSSH seems unwilling to cooperate. file: [0b4ba5824c] check-in: [dbd436ea57] user: simon branch: trunk, size: 185690
04:06
BUG_SSH2_DERIVEKEY is apparently only present in SSH 2.0.11 and before, not in 2.0.13. Verified on at least one host. Fixes bug `ssh2-keyderive-nonbug'. file: [fcbded294e] check-in: [ae5af25955] user: simon branch: trunk, size: 184092
03:47
logeventf()'s first argument is ssh, not ssh->frontend! This is what I get for making the latter a `void *' - type checking deserts me in my hour of need. Should fix Andrey Borzenkov's bug. file: [f33d1286ce] check-in: [d0d528cb50] user: simon branch: trunk, size: 184059
2002-12-08
10:54
Modify bug-compatibility checks to use wildcards. Should have exactly the same behaviour as before (tested a little bit), but should be easier to expand. (This is the easy bit -- work still needs to be done to fix ssh2-keyderive-nonbug, vshell-no-bug-compat, etc -- but should be easier now.) file: [aae0556a18] check-in: [2a30734076] user: jacob branch: trunk, size: 184092
2002-11-20
13:56
Interchange two parameters in a printf, to prevent a silly segfault. file: [0273269591] check-in: [f3b8077033] user: simon branch: trunk, size: 184172
2002-11-07
13:49
Robustness fixes for KEXINIT handling and others. In particular, I've created a self-mallocing variant of sprintf, to obviate any future need for paranoid %.100s type stuff in format strings. file: [da8ac6dffd] check-in: [c58e86fe39] user: simon branch: trunk, size: 184172
2002-11-01
06:59
valgrind has caught two more uninitialised elements in the SSH context structure. I knew the Unix port would be a good idea! file: [3bc8fb2ecc] check-in: [f50e29cc8f] user: simon branch: trunk, size: 184516
06:53
Move an output newline to make username entry in Plink/SSH2 look more sensible. file: [a74c89e12c] check-in: [e58385f685] user: simon branch: trunk, size: 184453
06:53
Pass int rather than char to va_arg (the latter gets promoted). file: [1b86bbdac6] check-in: [811ba17fbe] user: simon branch: trunk, size: 184456
2002-10-30
11:57
More preparatory work: remove the <windows.h> include from lots of source files in which it's no longer required (it was previously required in anything that included <putty.h>, but not any more). Also moved a couple of stray bits of exposed WinSock back into winnet.c (getservbyname from ssh.c and AF_INET from proxy.c). file: [12049fa328] check-in: [28f44ea3f8] user: simon branch: trunk, size: 184451
2002-10-29
10:54
Yikes - put back a #include I accidentally removed two revs ago! That'd have been embarrassing. Mind you I'd like to remove this particular #include for good anyway, but the time is not now... file: [e42a4959db] check-in: [8742d8ab57] user: simon branch: trunk, size: 184697
08:41
Hmm. Probably best initialise mainchan as well; oops. file: [9fe9f895df] check-in: [67b3ab0447] user: simon branch: trunk, size: 184676
07:05
Try actually initialising ssh->v1_compressing. With any luck this will be what was causing Owen's crash report today. file: [db3ed97625] check-in: [ba0e8fb0ef] user: simon branch: trunk, size: 184650
2002-10-26
07:58
Yet more global-removal. The static variables in logging.c are now absent, and also (I think) all the frontend request functions (such as request_resize) take a context pointer, so that multiple windows can be handled sensibly. I wouldn't swear to this, but I _think_ that only leaves the Unicode stuff as the last stubborn holdout. file: [9d84fa36b6] check-in: [8fba443d8c] user: simon branch: trunk, size: 184638
06:23
X forwarding authentication is now invented on a per-SSH-connection basis, so the statics are gone from x11fwd.c. file: [9af6fbf7e7] check-in: [f79eb3364d] user: simon branch: trunk, size: 183956
06:08
Reorganised the Unicode layer somewhat: moved luni_send and lpage_send out into the line discipline, making them _clients_ of the Unicode layer rather than part of it. This means they can access ldisc->term, which in turn means I've been able to remove the temporary global variable `term'. We're slowly getting there. file: [91c039c4f9] check-in: [457ce6905a] user: simon branch: trunk, size: 183815
05:33
Port forwarding module now passes backend handles around properly. As a result I've now been able to turn the global variables `back' and `backhandle' into module-level statics in the individual front ends. Now _that's_ progress! file: [a04fe5a328] check-in: [06cff2eb6c] user: simon branch: trunk, size: 183841
05:16
Line discipline module now uses dynamically allocated data. Also fixed one or two other minor problems. file: [29c7da3305] check-in: [d16199ae68] user: simon branch: trunk, size: 183829
2002-10-25
08:26
The Zlib module now uses dynamically allocated contexts. I think that completes the static-removal in the crypto library. Ooh. file: [87754146b9] check-in: [d666740d70] user: simon branch: trunk, size: 183609
08:08
Diffie-Hellman key exchange now uses a dynamically allocated context. file: [3d83034a07] check-in: [28d1810cc5] user: simon branch: trunk, size: 182628
07:58
SSH CRC attack detector now uses a dynamically allocated context. file: [e295b29228] check-in: [45540e784d] user: simon branch: trunk, size: 182539
07:51
SSH2 MACs now use dynamically allocated contexts. file: [00bc903f2c] check-in: [fb0d4d686d] user: simon branch: trunk, size: 182361
07:35
SSH ciphers now use dynamically allocated contexts. file: [235ccc10ea] check-in: [f12024de9a] user: simon branch: trunk, size: 181762
06:30
Major destabilisation, phase 2. This time it's the backends' turn: each backend now stores all its internal variables in a big struct, and each backend function gets a pointer to this struct passed to it. This still isn't the end of the work - lots of subsidiary things still use globals, notably all the cipher and compressor modules and the X11 forwarding authentication stuff. But ssh.c itself has now been transformed, and that was the really painful bit, so from here on it all ought to be a sequence of much smaller and simpler pieces of work. file: [a5ff560ba3] check-in: [92e8b2cec5] user: simon branch: trunk, size: 180700
2002-10-23
09:03
Fixes for (Backend)->size() changes -- internal declarations didn't include new arguments and neither did internal calls. file: [3121c074d5] check-in: [f41c1604fd] user: jacob branch: trunk, size: 171941
07:41
Cleanups from yesterday's destabilisation: lots of stuff in terminal.c was apparently relying on implicit initialisation to zero, and also I've removed the backends' dependency on terminal.h by having terminal sizes explicitly passed in to back->size(). file: [9a0b28597a] check-in: [4bdb37398f] user: simon branch: trunk, size: 171862
2002-10-22
11:11
Major destabilisation, phase 1. In this phase I've moved (I think) all the global and function-static variables out of terminal.c into a dynamically allocated data structure. Note that this does not yet confer the ability to run more than one of them in the same process, because other things (the line discipline, the back end) are still global, and also in particular the address of the dynamically allocated terminal-data structure is held in a global variable `term'. But what I've got here represents a reasonable stopping point at which to check things in. In _theory_ this should all still work happily, on both Unix and Windows. In practice, who knows? file: [b006cb9ab0] check-in: [c56a5fa8ee] user: simon branch: trunk, size: 171709
2002-10-01
13:30
Remove last vestiges of `buggymac' in the Config structure. Might have been cause of a Plink bug since it no longer got initialised. file: [abe635daf2] check-in: [53f6591e2e] user: simon branch: trunk, size: 171441
2002-09-26
13:37
Add a new SSH2 bug: some servers apparently claim to be able to do DH group exchange, but choke when you actually try it. Never automatically enabled; manual control only. file: [f59941e947] check-in: [1f07089633] user: simon branch: trunk, size: 171459
2002-09-15
08:31
Be proactively pedantic about channel-close irregularities: we no longer just sit there like a lemon if we can't find the channel in question, we bomb out and complain. With any luck, remaining problems of this type should be easier to catch under this policy. file: [c9374d6544] check-in: [ab762b8245] user: simon branch: trunk, size: 170993
08:24
Improvements to SSH1 channel close handling: track sending and receiving of CLOSE and CLOSE_CONFIRMATION separately rather than taking short cuts. I believe ssh-1.2.33 sending CLOSE_CONFIRMATION before CLOSE was causing the remaining incidences of bug `nonexistent-channel'. (ssh-1.2.33 appears to have unilaterally decreed that CLOSE and CLOSE_CONFIRMATION are respectively renamed INPUT_EOF and OUTPUT_CLOSING, hence there is no longer an ordering constraint on them. Bah.) file: [5520497782] check-in: [973da1f5cd] user: simon branch: trunk, size: 170676
2002-09-12
11:05
Semi-bug "long-usernames": Bump username storage from 32 to 100 chars. Also replaced a couple of magic numbers with sizeof in ssh.c. I don't believe this is going to startle any of the protocols PuTTY talks. file: [7c24e534f2] check-in: [1a39e619f8] user: jacob branch: trunk, size: 170165
2002-09-08
08:28
Introduce the Bugs control panel, for overriding PuTTY's server version number checks to determine the presence or absence of server bugs. file: [fb69f1b453] check-in: [748d581331] user: simon branch: trunk, size: 170105
2002-09-07
07:27
Increase length limit on SSH1_MSG_DEBUG; 70 chars is short enough to lose vital information in some existing servers' messages. file: [fa33b8a512] check-in: [d6aae5e38d] user: simon branch: trunk, size: 169606
2002-08-18
04:27
Add BUG_SSH2_DERIVEKEY, present (according to OpenSSH) in ssh.com versions 2.0.*, and causing the shared secret not to be included in key derivation hashes. (This doesn't quite cause a blatant security hole because the session ID - _derived_ from the shared secret - is still included.) file: [c2b2b031da] check-in: [3926a303ff] user: simon branch: trunk, size: 169589
04:10
In SSH2, if decrypting the packet length gave us a negative value, subsequent packet-receiver code would fail to notice anything was wrong and segfault. Since this is clearly a silly packet length anyway, we now explicitly reject it as a daft encryption error. file: [5a7465859e] check-in: [c4a931b9c1] user: simon branch: trunk, size: 169145
2002-08-11
08:02
Final fixes to keyboard-interactive so it now works with packets containing more than one prompt instead of less than one, and also correctly enables echo on prompts that the server requests it for. In the process I've moved the whole username/password input routine out into its own function, where it's called independently of which SSH protocol we're using, so this should even have _saved_ code size. Rock! file: [02a433305b] check-in: [24d0aa25e9] user: simon branch: trunk, size: 168892
2002-08-07
12:57
Oops. Didn't quite get the new SSH protocol selection code right. *blush* file: [f70129687c] check-in: [d5f0c03954] user: simon branch: trunk, size: 168432
12:48
Add an option to force SSH1 protocol only. Partly for symmetry; mostly because I'm about to want it for the -1 command line option. file: [14c737bfe0] check-in: [a87a66409f] user: simon branch: trunk, size: 168431
2002-08-04
16:18
Revamp of command-line handling. Most command line options should now be processed in cmdline.c, which is called from all utilities (well, not Pageant or PuTTYgen). This should mean we get to standardise almost all options across almost all tools. Also one major change: `-load' is now the preferred option for loading a saved session in PuTTY proper. `@session' still works but is deprecated. file: [e7ed5104c9] check-in: [6e2207da2f] user: simon branch: trunk, size: 168141
2002-08-03
11:22
Fix culpable lack of generality in keyboard-interactive authentication: a k-i request packet can contain any number of auth prompts (including zero!) and we must ask the user all of them and send back a packet containing the same number of responses. FreeBSD systems were sending a zero-prompts packet which was crashing us; this now appears fixed (we correctly return a zero-responses packet) but I haven't tested a multiple-prompts packet because I can't immediately think of a server that generates them. file: [7406d73ecf] check-in: [2678a20dff] user: simon branch: trunk, size: 167978
2002-06-15
11:52
One of the recent port forwarding crash reports contained details which suggested bufchain_prefix() was finding an improperly initialised bufchain structure. Looking at the code, this may indeed have been able to happen, since the bufchain in a SOCKDATA_DORMANT channel was not initialised until CHANNEL_OPEN_CONFIRMATION was received. This seems utterly daft, so I now call bufchain_init() when the channel structure is actually created. With any luck the crash will mystically disappear now (I wasn't able to reproduce it myself). file: [a0e59f0cae] check-in: [6e2c2cce2c] user: simon branch: trunk, size: 166896
2002-05-31
12:39
Workaround for the SSH2 RSA padding bug in OpenSSH 2.5 - 3.2 inclusive. Padding is accomplished by rewriting the signature blob rather than at the point of generation, in order to avoid having to move part of the workaround into Pageant (and having to corrupt the agent wire protocol to allow PuTTY to specify whether it wants its signatures padded!). file: [38700e2221] check-in: [7a4afe7b5e] user: simon branch: trunk, size: 166897
2002-05-17
07:33
ieof-for-nonexistent-channel problem: avoid comparing an unsigned with -1 file: [5c39fabf9f] check-in: [9832c81afd] user: simon branch: trunk, size: 164425
2002-05-11
08:08
SSH2 only support file: [daea1ea429] check-in: [9cc8742e75] user: owen branch: trunk, size: 164418
07:13
Improved error messages if you use the wrong key type: you should now be told that the key is the wrong type, _and_ what type it is, rather than being given a blanket `unable to read key file' message. file: [cfedb67ecc] check-in: [9f93ab88b5] user: simon branch: trunk, size: 164283
2002-03-27
15:58
Remember to wait for SSH1_MSG_SUCCESS after enabling remote port forwardings in SSH1. Was causing several MSG_SUCCESS to be queued up unread, which was wrong-but-benign in most cases but caused a hard crash with compression enabled (one of those uncompressed MSG_SUCCESSes was fed to the zlib decompressor with spectacular results). file: [ea0ac36c2f] check-in: [c610b016d1] user: simon branch: trunk, size: 163464
15:43
Matt Harden's (modified) patch to do getservbyname() lookups on port- forwarding port numbers. file: [c6085fbb79] check-in: [35e08ba4b4] user: simon branch: trunk, size: 163065
2002-03-23
12:04
Attempt to ensure that everything passed to connection_fatal() is also logged to the Event Log, so that it's easy to cut-and-paste the error message afterwards. file: [4c06c44f0e] check-in: [c6a325e8ff] user: simon branch: trunk, size: 161169
11:47
Justin Bradford's proxy support patch. Currently supports only HTTP CONNECT, but contains an extensible framework to allow other proxies. Apparently SOCKS and ad-hoc-telnet-proxy are already planned (the GUI mentions them already even though they don't work yet). GUI includes full configurability and allows definition of exclusion zones. Rock and roll. file: [8f63298116] check-in: [dea04539ac] user: simon branch: trunk, size: 160796
2002-03-20
16:34
Pedantic little patch to ensure blank usernames work vaguely as expected, in case anyone really wants to use one file: [6fe8160432] check-in: [4bc68efeeb] user: simon branch: trunk, size: 160777
2002-03-06
14:13
Ensure our network layer is properly cleaned up before PuTTY exits. Specifically, we explicitly closesocket() all open sockets, which appears to be necessary since otherwise Windows sends RST rather than FIN. I'm _sure_ that's a Windows bug, but there we go. file: [2b8085bd64] check-in: [c483e38b9f] user: simon branch: trunk, size: 160697
2002-02-27
16:45
Set SSH socket variable to NULL if connect() fails. Failure to do this was causing PSCP to hang indefinitely after reporting Connection Refused. file: [af46dc2971] check-in: [fbc95c5557] user: simon branch: trunk, size: 160766
16:41
Cisco routers apparently have yet another bug: they can't handle RSA auth attempts at all without panicking and bombing out. Workaround added. file: [06d174a81d] check-in: [d973d3ee29] user: simon branch: trunk, size: 160747
2002-01-10
13:50
Add support for sending SSH2_MSG_UNIMPLEMENTED for unrecognised messages; also do something with the debugging messages sent as SSH2_MSG_DEBUG. file: [352d83ba67] check-in: [877b8e74ee] user: simon branch: trunk, size: 160233
10:42
Support SSH2_MSG_GLOBAL_REQUEST (just return failure) file: [df81f42175] check-in: [a03d782645] user: simon branch: trunk, size: 157161
07:29
Extra safety feature to avoid sending SSH2_MSG_WINDOW_ADJUST on a nonexistent channel. I don't quite know why this was happening, but whatever it was this ought to fix it. file: [df1075ba83] check-in: [3947916546] user: simon branch: trunk, size: 156591
2002-01-08
05:57
Add the CRC32 compensation attack detector that all other SSH clients have had for ages and I forgot about. Of course I've got the version with the buffer overflow fixed! file: [e1ed729eb0] check-in: [b36f8f4376] user: simon branch: trunk, size: 156367
2001-12-30
10:27
I have no brain at all. The SSH1 auth loop was trying all Pageant keys before _every_ other authentication; so if you tried a local pubkey _and_ a password, for example, you'd also try Pageant twice. Now fixed. file: [4e815be4d9] check-in: [dc7ec88000] user: simon branch: trunk, size: 156208
10:20
PuTTY can now detect when one of the Pageant keys it tries matches the private key file given in the config; if it spots this then it avoids trying it again (and in particular avoids needing to ask for the passphrase when it knows perfectly well it won't work). file: [48e806aec0] check-in: [5cc6289f02] user: simon branch: trunk, size: 156143
2001-12-29
09:31
Add a new back-end function to return the exit code of the remote process. This is functional in SSH, and vestigial (just returns 0) in the other three protocols. Plink's Windows exit code is now determined by the remote process exit code, which should make it more usable in scripting applications. Tested in both SSH1 and SSH2. file: [4077ab0bb0] check-in: [f5ca005b7e] user: simon branch: trunk, size: 155182
2001-12-15
06:15
Add the remote counterpart for the `local port forwardings accept connections from outside localhost' switch. Interestingly OpenSSH 3.0 appears to ignore this (though I know it works because ssh.com 3.0 gets it right, and the SSH packet dump agrees that I'm doing the right thing). file: [fbafd07ddf] check-in: [0f9f757a26] user: simon branch: trunk, size: 154297
2001-12-14
08:57
Retired the #ifdef DUMP_PACKETS stuff in ssh.c because I'm utterly sick of recompiling to enable packet dumps. SSH packet dumping is now provided as a logging option, and dumps to putty.log like all the other logging options. While I'm at it I cleaned up the format so that packet types are translated into strings for easy browsing. POSSIBLE SIDE EFFECT: in the course of this work I had to re-enable the SSH1 packet length checks which it turns out hadn't actually been active for some time, so it's possible things might break as a result. If need be I can always disable those checks for the 0.52 release and think about it more carefully later. file: [cb4bd3495c] check-in: [94f359321d] user: simon branch: trunk, size: 154219
2001-12-11
15:00
Disable username switching between SSH2 auth attempts, and add a configurable option so users can re-enable the feature _if_ they know they have an SSH2 server that isn't going to get shirty about it. Inspired by a spectacular increase in OpenSSH's shirtiness. file: [91e884a6ce] check-in: [bbebf7bd6d] user: simon branch: trunk, size: 150638
2001-12-10
12:12
Apparently sending DISCONNECT on a normal SSH2 connection close is actually _less_ polite than just closing the connection, rather than more polite as I'd believed. So we now just close. file: [bd0b31d576] check-in: [1aab7505ba] user: simon branch: trunk, size: 150413
2001-11-29
16:26
Make the nonstandard "des-cbc" cipher disabled by default file: [b9c291248f] check-in: [3c0fa57097] user: simon branch: trunk, size: 149786
15:47
Configurable TCP_NODELAY option on network connections file: [274cce6db2] check-in: [8daaf4c09d] user: simon branch: trunk, size: 149816
14:34
Make keyboard-interactive authentication configurable off. (This is a stopgap until we get round to a proper authentications preference list.) file: [ec59224abb] check-in: [f723110def] user: simon branch: trunk, size: 149772
14:27
Remember to terminate the prompt string in keyboard-interactive file: [d5ce698870] check-in: [4fca606ec7] user: simon branch: trunk, size: 149754
2001-11-21
17:06
Add single-DES support in SSH2 file: [dc4d40b905] check-in: [f30ca2d0e9] user: simon branch: trunk, size: 149658
16:48
Primitive protection against SSH2 not actually agreeing a cipher in either direction. file: [529f4ed791] check-in: [6f9d4e869c] user: jacob branch: trunk, size: 149817
16:06
Send SSH2_MSG_NEWKEYS _before_ expecting to receive it, rather than after. Shouldn't make a difference for any server that previously worked, but we should now interoperate sensibly with servers that wait to receive our NEWKEYS before sending their own. Apparently Unisphere produce one such. file: [23fa55f597] check-in: [4463361467] user: simon branch: trunk, size: 149569
2001-11-13
16:06
Handle incoming SSH2_MSG_CHANNEL_REQUEST (by refusing all requests). Should have done this ages ago; the OpenSSH 3.0 ClientAliveInterval mechanism requires it so now it's really necessary. file: [cd4954e546] check-in: [8499811133] user: simon branch: trunk, size: 149569
2001-11-10
11:09
Oops - one missing set of the ssh1 throttling indicator file: [3e30d975b4] check-in: [0f98131cf5] user: simon branch: trunk, size: 148517
2001-10-30
14:57
Tidy up the SERIOUS NETWORK ERROR fixes file: [b49cb72af6] check-in: [a36d0f7bf5] user: simon branch: trunk, size: 148487
14:35
Tidy up SSH packet-level debugging file: [69def8a7b8] check-in: [20af56aea3] user: simon branch: trunk, size: 147484
2001-10-27
06:06
Add remaining comments to the last checkin (gah, remember to hit Save in the editor _before_ running cvs commit). file: [6bded563b9] check-in: [6830d061c8] user: simon branch: trunk, size: 147565
05:39
Update to password length traffic analysis: one Cisco router can apparently not deal with SSH1_MSG_IGNORE _or_ padded passwords, so we must fall back to sending an undefended password. file: [ff0b7f1adf] check-in: [c0c42ff5c1] user: simon branch: trunk, size: 147289
2001-09-26
15:29
`Server got confused by' error messages now quote a packet type, so I can start debugging as soon as I get one sent to me. file: [c801d590d2] check-in: [8a15380719] user: simon branch: trunk, size: 146126
2001-09-19
15:07
Fix pasting of newlines in local line editing mode. Possibly not a very _good_ fix; something might want doing after the release. file: [23a3a77e81] check-in: [a8202e3593] user: simon branch: trunk, size: 145947
2001-09-18
13:16
SSH back end should now be tolerant of garbage appearing in the data stream after the actual SSH connection is finished. Some firewalls add this for no good reason. file: [39a3bc1033] check-in: [04b776bff9] user: simon branch: trunk, size: 145941
2001-09-09
09:47
Be more careful of bombouts at the s_rdpkt level: if these happen (for example SSH_MSG_DISCONNECT) we should avoid even calling ssh_protocol. file: [6f46237dae] check-in: [be8d17560a] user: simon branch: trunk, size: 145809
2001-09-08
07:50
Jacob's TIS / CCard authentication tweaks. file: [2e146c4c0f] check-in: [7122565be1] user: simon branch: trunk, size: 145724
06:57
Fix error message: couldn't load _private_ key, not public. file: [b12481da25] check-in: [39df7148e8] user: simon branch: trunk, size: 145180
05:33
When we receive SSH_MSG_DISCONNECT, say so in an error box because it's likely to be more helpful than `Strange packet received' or whatever. file: [aacad67b38] check-in: [eb53e5ee1f] user: simon branch: trunk, size: 145179
2001-09-07
17:39
Robert de Bath's asynchronous-connect patch. Helps a lot in port forwarding; improves Event Log; and causes the PuTTY window to appear earlier in the setup process. file: [dde884ce1a] check-in: [30ca2ba730] user: simon branch: trunk, size: 144908
17:04
Fix gratuitous assertion failure in Plink (ssh1_throttle_count was being decremented far too many times). file: [a9f83d2b4d] check-in: [96bc3b496f] user: simon branch: trunk, size: 144660
2001-08-28
03:43
D'oh! Putting keyboard-interactive authentication _before_ publickey causes password login to occur on a server that supports password- through-k-i. Of course when we use the new preference list mechanism for selecting the order of authentications this will all become much more sane, but for the moment I've put publickey back up to the top and things seem to be happier. file: [a0927e06e1] check-in: [3cb4b5568a] user: simon branch: trunk, size: 144584
03:08
Fix various small compiler warnings, mostly unused local variables file: [7de50246e9] check-in: [0a5751b809] user: simon branch: trunk, size: 144655
2001-08-27
11:58
Fix handling of SSH2_MSG_CHANNEL_CLOSE, which was breaking in port forwarding talking to ssh.com's ssh-3.0.1. file: [6ae74f2312] check-in: [e28e899e99] user: simon branch: trunk, size: 144665
10:13
Port forwarding bug fix: we were unable to handle receiving CHANNEL_OPEN_FAILURE messages, which occur when the remote side is unable to open a forwarded network connection we have requested. (It seems they _don't_ show up if you get something mundane like Connection Refused - the channel is cheerfully opened and immediately slammed shut - but they do if you try to connect to a host that doesn't even exist. Try forwarding a port to frogwibbler:4800 and see what you get.) file: [998fc19e91] check-in: [f7b3ee5549] user: simon branch: trunk, size: 144484
2001-08-26
13:32
PSCP now uses the modern SFTP protocol if it can, and falls back to scp1 if it can't. Currently not very tested - I checked it in as soon as it completed a successful recursive copy in both directions. Also, one known bug: you can't specify a remote wildcard, because by the nature of SFTP we'll need to implement the wildcard engine on the client side. I do intend to do this (and use the same wildcard engine in PSFTP as well) but I haven't got round to it yet. file: [b6be145d02] check-in: [0d8a92d58d] user: simon branch: trunk, size: 143598
2001-08-25
14:33
Jacob's patch for a drag-list to select SSH ciphers. Heavily hacked by me to make the drag list behaviour slightly more intuitive. WARNING: DO NOT LOOK AT pl_itemfrompt() IF YOU ARE SQUEAMISH. file: [0e672eb2ba] check-in: [fb691d08cf] user: simon branch: trunk, size: 142322
12:09
Extensive changes that _should_ fix the socket buffering problems, by ceasing to listen on input channels if the corresponding output channel isn't accepting data. Has had basic check-I-didn't-actually- break-anything-too-badly testing, but hasn't been genuinely tested in stress conditions (because concocting stress conditions is non- trivial). file: [6ae9e3664c] check-in: [e84a3c910c] user: simon branch: trunk, size: 141189
2001-08-22
15:23
Oops - fix that fix :-/ file: [181ae464a2] check-in: [1ca082b7a7] user: simon branch: trunk, size: 134943
14:47
Fix to allow more than one challenge/response pair during keyboard-interactive authentication. UNTESTED except that I checked it compiles. Will ask for testing from the user who complained. file: [3490c26805] check-in: [74c9730afc] user: simon branch: trunk, size: 134944
2001-08-15
13:23
Trivial port forwarding fixes from Jacob file: [2213b36ab6] check-in: [60c2a03bbb] user: simon branch: trunk, size: 134426
2001-08-09
16:22
Stop yelling about Access Denied if the server refuses even to attempt keyboard-interactive authentication. We can yell about it if we make a creditable attempt and are rejected, but if the server just refuses to even consider it then the user won't really want to know (and if they do there's the Event Log). file: [a2fd37c41b] check-in: [1b859669ff] user: simon branch: trunk, size: 134427
16:17
Port forwarding now works in SSH 2 as well as SSH 1. file: [a634252e45] check-in: [8309fd3a31] user: simon branch: trunk, size: 134263
15:13
Keyboard-interactive authentication, thanks to Paul Sokolovsky. file: [61f26391a1] check-in: [ae0e59a01d] user: simon branch: trunk, size: 127946
2001-08-08
15:44
SSH port forwarding! How cool is that? Only currently works on SSH1; SSH2 should be doable but it's late and I have other things to do tonight. The Cool Guy award for this one goes to Nicolas Barry, for doing most of the work and actually understanding the code he was adding to. file: [299d19ff2d] check-in: [c9959c44e1] user: simon branch: trunk, size: 125771
2001-08-04
07:37
Fix segfault if the server maliciously sends the wrong type of key after a different type has been agreed. file: [847e1ae8b4] check-in: [b0f7665fed] user: simon branch: trunk, size: 120182
2001-07-31
09:23
Yet another possible segfault path in the backends fixed. I don't _believe_ I'm still finding these. I have no idea what I was thinking when I wrote this stuff. file: [7417319ab0] check-in: [d92d20c31c] user: simon branch: trunk, size: 120146
2001-05-13
09:02
Placate gcc's `-Wall' warnings. file: [ff88e3f5af] check-in: [e91a557356] user: simon branch: trunk, size: 120119
06:44
Control characters are now allowed as part of the password, if they're not special control characters processed by the line input routines. file: [556c028950] check-in: [6f7e910d13] user: simon branch: trunk, size: 120110
06:15
Attempt to report the error condition right when an SCP connection with a pre-supplied password fails to authenticate. file: [e1db0e8234] check-in: [1d8cec3ee3] user: simon branch: trunk, size: 120200
2001-05-09
09:01
`realhost', passed back from all the backend init functions, was scoped within those functions. It's now dynamically allocated. file: [91ffa29901] check-in: [b0b7726ce6] user: simon branch: trunk, size: 119851
2001-05-06
09:35
Run entire source base through GNU indent to tidy up the varying coding styles of the various contributors! Woohoo! file: [04d4a320b1] check-in: [18fcbbf5a2] user: simon branch: trunk, size: 119808
2001-04-28
12:35
Debugging improvements. Started using Dave Hinton's dmemdump function (woohoo!), improved that function so it provides an ASCII dump as well as hex (whee!), removed all remaining spurious \r in debug statements (ooh!), and made enabling of packet debugging in SSH a matter of one ifdef rather than lots (phew!). file: [e757f17734] check-in: [78ce267f58] user: simon branch: trunk, size: 135821
06:25
Fix completely stupid agent_exists test. (Hint to self: you have to actually _call_ a boolean-returning function, not just test its address for nonzerohood.) Thanks Jacob. file: [be27be12ab] check-in: [10b7803a78] user: simon branch: trunk, size: 136620
03:42
Add some fflushes to make it easier for piped programs to talk to plink and pscp file: [c8543d89cb] check-in: [3ca35402c6] user: simon branch: trunk, size: 136618
2001-04-17
03:24
Having now compiled the last few days' changes with MSVC, it's turned up a bunch of warnings, mostly unused variables. All fixed. file: [f7b37610a1] check-in: [24eb277009] user: simon branch: trunk, size: 136598
2001-04-16
12:18
Replace PuTTY's 2-3-4 tree implementation with the shiny new counted one, in preparation for using it to speed up scrollback. file: [f16d2132ea] check-in: [eaf375d551] user: simon branch: trunk, size: 136676
06:16
Pageant interface changes. You can now do `pageant -c command' to spawn another command after starting Pageant. Also, if Pageant is already running, `pageant keyfile' and `pageant -c command' will do the Right Thing, that is, add the key to the _first_ Pageant and/or run a command and then exit. The only time you now get the `Pageant is already running' error is if you try to start the second copy with no arguments. NB the affected files in this checkin are rather wide-ranging because I renamed the not really SSH1-specific `ssh1_bignum_bitcount' function to just `bignum_bitcount'. file: [5914d0e5af] check-in: [64fef963cc] user: simon branch: trunk, size: 136349
04:10
Log the text message in SSH_MSG_DISCONNECT (both protocols) so that when people submit Event Logs for diagnosis it's a little easier to work out what's up. file: [62ba8f3cd9] check-in: [7b0a25342b] user: simon branch: trunk, size: 136359
02:49
After we fall back to 3DES, double-check the server really does support it, and bomb out with a complaint if not. file: [32f2db0a53] check-in: [a19cc07470] user: simon branch: trunk, size: 134283
2001-04-11
07:29
Experimental checkin to see if we can prevent multiple closes ever being sent on an SSH1 forwarding (or indeed primary) channel. file: [52d4834eb5] check-in: [38fbf062db] user: simon branch: trunk, size: 134109
2001-03-29
07:40
Fix the detect_bugs routine, which was failing to find the right bit of the version string :-) file: [295ac254da] check-in: [187803a9b3] user: simon branch: trunk, size: 134055
2001-03-23
04:28
Fix the SSH protocol version exchange, which had a weird stack trash in it which for some reason didn't show up when built with VC++6 but blew up the nightlies. Should be OK now. file: [7d7be15faa] check-in: [ff0d0a3692] user: simon branch: trunk, size: 134013
2001-03-22
11:32
Remove the length limit on protocol version strings. (In principle, I could have got away with upping it to 256, but I didn't want a repeat of the chaos when some server accidentally breaks that limit too...) file: [09ac1d4210] check-in: [e6c77ffa94] user: simon branch: trunk, size: 134038
2001-03-19
04:27
Plink in noninteractive-script mode should not show the `Authenticated with public key' message in SSH2 (it already doesn't in SSH1). It shouldn't show the login banner either, since its output is probably redirected to something which will choke on it. file: [5a1e552541] check-in: [0a38f11c5d] user: simon branch: trunk, size: 133760
04:24
Add Norman Brandinger's suggested `-m' option in plink, to read the remote command from a local file. Advantage: you can have more than one line in it, so you can remotely run what's effectively a small script. file: [e86ae69495] check-in: [1aa859782c] user: simon branch: trunk, size: 133096
2001-03-16
06:09
SSH2 channel fix: received WINDOW_ADJUSTs were always applied to the primary (shell session) channel, rather than the one they were aimed at. This _despite_ me having deliberately gone and looked the channel ID up in the B-tree - I was ignoring the result by accident :-/ X forwarding should now work in SSH2 even on non-trivial clients (ie things other than xdpyinfo). file: [bd79317e1a] check-in: [dd506852aa] user: simon branch: trunk, size: 133076
05:58
Correct handling of SSH1 protocol flags, in particular PROTOFLAG_SCREEN_NUMBER, without which OpenSSH 2.5.1 was objecting to my gratuitous inclusion of a screen number in the SSH1 X forwarding request. Ahem. file: [e1849e5c1c] check-in: [63e041800b] user: simon branch: trunk, size: 133083
2001-03-15
11:14
Add support for SSH2 userauth banners. We currently can't deal with printing them _before_ the username prompt. This apparently isn't very serious because OpenSSH doesn't _send_ it before the username prompt, but only in response to USERAUTH_REQUEST "none". Good job we do that! file: [2e58f5dfd6] check-in: [1170b92531] user: simon branch: trunk, size: 132146
06:15
At long last: PuTTY will now report its version to the server sensibly, as a release or a snapshot or a local build. With any luck this should make bug reporting easier to handle, because anyone who sends their Event Log should automatically include the version :-) file: [8c192bb125] check-in: [8291e66ea6] user: simon branch: trunk, size: 131757
05:39
Fix a few trivial compiler warnings file: [560b471690] check-in: [68118804a2] user: simon branch: trunk, size: 131701
05:38
Bit more robustness when talking to Pageant file: [2a016e01ae] check-in: [0abac01e0f] user: simon branch: trunk, size: 131737
05:32
Oops - don't invent an X authorisation when doing agent forwarding! Overenthusiastic c'n'p breaks the world. file: [0994efb383] check-in: [a2542209d8] user: simon branch: trunk, size: 131563
05:19
Fix a segfault on abrupt X connection shutdown. file: [7c736b4c59] check-in: [4c83fcb2bd] user: simon branch: trunk, size: 131630
2001-03-13
04:22
Dave Hinton's modifications to the network layer interface, which should make it possible to add SSL support later. file: [acd39eac2c] check-in: [0c3b3070c4] user: simon branch: trunk, size: 131616
2001-03-12
09:31
ssh_get_password has become ssh_get_line, so it can handle usernames as well. This should fix the multiple-reads-on-stdin bug in plink. file: [6b4acf0185] check-in: [fa069c172a] user: simon branch: trunk, size: 131462
09:12
Zero length passwords no longer cause an assertion failure :-) file: [2f8a57858e] check-in: [b982530d97] user: simon branch: trunk, size: 129157
2001-03-10
05:04
Add support for using Diffie-Hellman with short exponents (sshdh.c contains a reference to a paper on the subject). Reduces time taken for DH group exchange to the point where it's viable to enable it all the time, so I have. :-) file: [45594d2dd1] check-in: [d67b4799b9] user: simon branch: trunk, size: 129114
2001-03-08
04:07
Having introduced a new function into the SSH2 compression structure, it would help if I implemented it in the dummy no-compression case! file: [382c2aa6e2] check-in: [6b991175b2] user: simon branch: trunk, size: 129139
2001-03-06
04:32
Introduce the ability to distinguish remote SSH implementations by their version strings and enable bug compatibility modes. file: [a28cd41eb3] check-in: [f363cd4fcd] user: simon branch: trunk, size: 129059
03:29
Update a couple of messages to be clearer to users who don't have access to complete documentation (ie all of them at the moment :-) file: [e5b7b14f5e] check-in: [21fd39c25b] user: simon branch: trunk, size: 126367
2001-03-05
10:38
Make the SSH2 traffic analysis defence robust in the face of Zlib compression. This involves introducing an option to disable Zlib compression (that is, continue to work within the Zlib format but output an uncompressed block) for the duration of a single packet. file: [7023ccca39] check-in: [b3e5c90b5b] user: simon branch: trunk, size: 126357
04:32
Further traffic analysis defences file: [9d0d0dacd2] check-in: [5a6aa0319a] user: simon branch: trunk, size: 125583
2001-03-03
10:38
Implement OpenSSH's private agent forwarding extension. I believe we now interoperate with OpenSSH/SSH2 to _exactly_ the same level as we interoperate with SSH1. Which is pretty cool really. file: [6a4e5d0632] check-in: [3851216d60] user: simon branch: trunk, size: 122295
10:05
Remove a spurious \r\n from an Event Log message file: [17b8fa6833] check-in: [95b45d0cd5] user: simon branch: trunk, size: 118373
09:56
SSH2 can now use Pageant to obtain keys from file: [65ee7ea696] check-in: [3ae72a462d] user: simon branch: trunk, size: 118377
07:53
The authentication diagnostics in SSH2 should now be better. Additionally, the ability to switch usernames if you mistype the first one has been restored (although it didn't actually work because OpenSSH didn't feel like playing; patch submitted :-). file: [9aa9742496] check-in: [e1aa7ffa13] user: simon branch: trunk, size: 115410
05:54
Preliminary support for RSA user authentication in SSH2! Most of the error messages are currently wrong, and Pageant doesn't yet support the new key type, and I haven't thoroughly tested that falling back to password authentication and trying invalid keys etc all work. But what I have here has successfully performed a public key authentication, so it's working to at least some extent. file: [b76360e1db] check-in: [0761a1ad90] user: simon branch: trunk, size: 112877
2001-03-02
11:13
Added support for RSA host keys (not user keys yet) file: [5d8c7add2a] check-in: [e92b8a0de1] user: simon branch: trunk, size: 108221
07:55
Support for selecting AES from the GUI. In the process, I've had to introduce another layer of abstraction in SSH2 ciphers, such that a single `logical cipher' (as desired by a user) can equate to more than one `physical cipher'. This is because AES comes in several key lengths (PuTTY will pick the highest supported by the remote end) and several different SSH2-protocol-level names (aes*-cbc, rijndael*-cbc, and an unofficial one rijndael-cbc@lysator.liu.se). file: [5316fea250] check-in: [6c598766ba] user: simon branch: trunk, size: 108170
05:44
Add AES support in SSH2. Not yet complete: there's no way to select it in the GUI (or even in the registry). file: [0edd83b7b7] check-in: [4640d5ae4b] user: simon branch: trunk, size: 107564
2001-03-01
11:55
Diffie-Hellman group exchange in SSH2. Currently #ifdeffed out (change the sense of #ifdef DO_DIFFIE_HELLMAN_GEX in ssh.c) because it's _far_ too slow. Will be re-enabled once the bignum routines work a bit faster (or rather a _lot_ faster). file: [94e7110c37] check-in: [886d6012e2] user: simon branch: trunk, size: 107342
11:41
Remove the last lingering knowledge, outside sshbn.c, of the internal structure of the Bignum type. Bignum is now a fully opaque type unless you're inside sshbn.c. file: [33d3437722] check-in: [92ac2a679e] user: simon branch: trunk, size: 105405
2001-02-24
10:08
psftp now works as part of the PuTTY suite file: [d13d65ff1c] check-in: [4ce457b44f] user: simon branch: trunk, size: 105682
2001-02-23
07:15
Add a traffic analysis defence to SSH2 password authentication file: [41efe26087] check-in: [ea984bef10] user: simon branch: trunk, size: 105514
2001-02-20
07:55
Attempt to fix the remaining key re-exchange bug file: [0428bb8805] check-in: [5d29e6606b] user: simon branch: trunk, size: 102523
2001-02-01
08:11
Yet another attempt at OOB handling in the network abstraction. This version allows you to specify, per socket, which sockets receive OOB data in-line (so that you know what was before the mark and what was after) and which receive it out of line (so it's really a one-byte out-of-band facility rather than discard-to-mark). This reflects the fact that rlogin appears to make more sense in the latter mode, and telnet in the former. This patch makes rlogin work right for me. file: [8d8c90912a] check-in: [a766f640f1] user: simon branch: trunk, size: 102527
2001-01-29
08:30
Prevent duplicate sk_close() calls on the same socket when the connection dies unexpectedly (CONNABORTED / CONNRESET) file: [2b9ebb5c8d] check-in: [edd16e834d] user: simon branch: trunk, size: 102524
07:19
Remove a segfault in bombout() macro: don't sk_close() the socket if it's already NULL. The `Incorrect MAC' problem was causing ssh2_rdpkt to bombout(), setting s to NULL, and then a secondary bombout() was happening at the next level up, causing a segfault. file: [997c49a87b] check-in: [51b9f5b532] user: simon branch: trunk, size: 102501
2001-01-26
12:50
Fix the SSH2 key re-exchange bug. Session id != exchange hash, because the session id is the exchange hash from the _first_ key exchange, so in subsequent key exchanges they're different. file: [8332414fab] check-in: [8ff44d5b9d] user: simon branch: trunk, size: 102454
06:22
Ensure all backends _remember_ the connection has closed after receiving a network error. Should prevent the cascading-error-box bug. file: [2c3857dac9] check-in: [6942ae0f1a] user: simon branch: trunk, size: 101959
2001-01-24
08:08
Rethink the whole line discipline architecture. Instead of having multiple switchable line disciplines, we now have a single unified one which changes its behaviour based on option settings. Each option setting can be suggested by the back end and/or the terminal handler, and can be forcibly overridden by the configuration. Local echo and local line editing are separate, independently switchable, options. file: [50828f4f41] check-in: [d2a045d8e1] user: simon branch: trunk, size: 101903
04:11
Improve socket error handling so that a socket error isn't an automatic fatalbox(). Instead, the error is passed to the receiver routine, which can decide just how fatal the problem really is. file: [587760a488] check-in: [d2802d2956] user: simon branch: trunk, size: 101361
2001-01-23
05:02
Remove the entirely pointless fourth parameter from x11_init(). file: [593ce4f80d] check-in: [5be6940dc1] user: simon branch: trunk, size: 101242
2001-01-22
09:36
Bring the SSH2 channel architecture up to scratch, enabling X forwarding to work under SSH2. Also - surprise! - implement X forwarding under SSH2. file: [5f2c5c84e4] check-in: [eaa1421496] user: simon branch: trunk, size: 101322
05:34
Add X11 forwarding, mainly thanks to Andreas Schultz file: [a22e959f3d] check-in: [ac34515183] user: simon branch: trunk, size: 94891
2001-01-19
04:10
Experimental Rlogin support, thanks to Delian Delchev. Local flow control is unsupported, and server-to-client comms may fail for want of working TCP Urgent. file: [35447ea85d] check-in: [da6b4093b4] user: simon branch: trunk, size: 91327
2001-01-17
10:57
Trivial fix for when the two directions select different encryption algorithms file: [25e58787e9] check-in: [c5de262295] user: simon branch: trunk, size: 91324
2001-01-09
11:16
Oops - accidentally undid rev 1.82 [r844] file: [5f8ac72ec0] check-in: [d817959ee0] user: simon branch: trunk, size: 91324
2001-01-08
07:57
Ensure ssh specials (EOF and PING) don't occur except in connection states where they're meaningful. In case Plink misses an EOF by attempting to send it before reaching SSH_STATE_SESSION, it is buffered and sent later. PINGs can be sent during any part of the initialisation phase _except_ before deciding whether to use protocol 1 or 2. file: [8804849c7b] check-in: [d9a5cfe18b] user: simon branch: trunk, size: 91293
2001-01-07
11:18
Adam D Ligas's segfault: one form of connection closure was failing to set SSH_STATE_CLOSED, causing subsequent resize events to go foom. file: [2244a97c64] check-in: [9bf6fbf735] user: simon branch: trunk, size: 90662
2000-12-18
03:20
Attempt to get repeated key exchange working in SSH2. Still under test - might not be 100%. I think it _ought_ to work though. file: [16c4abab8e] check-in: [1cf3831915] user: simon branch: trunk, size: 90631
2000-12-12
05:07
Fix an intermittent segfault that prevented the new Zlib compression from being very useful. (Thanks to Minefield for catching it.) file: [920dd49aaa] check-in: [b5b8638aa8] user: simon branch: trunk, size: 90076
04:33
Make memory management uniform: _everything_ now goes through the smalloc() macros and thence to the safemalloc() functions in misc.c. This should allow me to plug in a debugging allocator and track memory leaks and segfaults and things. file: [95e6596d0f] check-in: [6f56ef599a] user: simon branch: trunk, size: 90025
2000-12-02
06:48
Improve SSH2 host key abstraction into a generic `signing key' abstraction, so as to be able to re-use the same abstraction for user authentication keys and probably in the SSH2 agent (when that happens) as well. file: [5b84068c1d] check-in: [be763a8b3a] user: simon branch: trunk, size: 89984
05:43
Fix bugtraq 1949: server could open an agent forwarding channel even if agent forwarding had not been negotiated on, and more particularly even if it had been deliberately disabled by the user. file: [3519910f17] check-in: [947325c657] user: simon branch: trunk, size: 89882
2000-11-21
04:53
Fix segfault when you press a key before the SSH protocol decides whether it's doing SSH1 or SSH2. Only visible on slow servers :-) file: [f0a6779b7c] check-in: [84fe71154e] user: simon branch: trunk, size: 89800
2000-11-01
15:34
Implement Zlib compression, in both SSH1 and SSH2. file: [5fe28ac484] check-in: [7db26db390] user: simon branch: trunk, size: 89776
2000-10-27
04:24
Stop the "Sent username %s" message coming up twice in pscp -v file: [2f9223b594] check-in: [bae801d3a5] user: simon branch: trunk, size: 85696
04:17
Misc bugfixes file: [03d752d7df] check-in: [194fd0cfeb] user: simon branch: trunk, size: 85700
2000-10-26
08:10
Format SSH2_MSG_DISCONNECT correctly (with reason code, reason string, and language tag). file: [60122540d4] check-in: [4e229e82b1] user: simon branch: trunk, size: 85698
2000-10-24
16:43
Fix another bignum formatting problem. This one hit Diffie-Hellmann file: [ec59644ce5] check-in: [79bb8babda] user: simon branch: trunk, size: 84773
04:55
SSH2 connections weren't closing cleanly after socket revamp. Fixed. file: [59a5c8bfd7] check-in: [70d31a0ebd] user: simon branch: trunk, size: 84728
04:49
Window resizing wasn't working in SSH2 file: [048bd30802] check-in: [90820ba887] user: simon branch: trunk, size: 84567
2000-10-23
05:32
Created a shiny new abstraction for the socket handling. Has many advantages: - protocol modules can call sk_write() without having to worry about writes blocking, because blocking writes are handled in the abstraction layer and retried later. - `Lost connection while sending' is a thing of the past. - <winsock.h> is no longer needed in most modules, because "putty.h" doesn't have to declare `SOCKET' variables any more, only the abstracted `Socket' type. - select()-equivalent between multiple sockets will now be handled sensibly, which opens the way for things like SSH port forwarding. file: [2a186d6d3b] check-in: [a2baae931e] user: simon branch: trunk, size: 83958
2000-10-20
08:51
Introduce a sane interface function, from_backend(), for backends to use when they have data from the network. Replaces the utterly daft inbuf / inbuf_head / term_out() interface, which only made sense when feeding to terminal.c. (terminal.c now implements from_backend() as a small function that gateways to the old interface.) As a side effect, from_backend() also has an `is_stderr' parameter, so scp can once again separate the server's pronouncements on stderr from the actual protocol progress on stdout. file: [dd756c62c3] check-in: [07725a2915] user: simon branch: trunk, size: 86729
2000-10-19
10:43
PuTTYgen initial version. Still to do are basic user-friendliness features (prompt for passphrase twice, prompt before overwriting a file, check the key file was actually saved OK), testing of the generated keys to make sure I got the file format right, and support for a variable key size. I think what's already here is basically sound though. file: [f9fbbba89f] check-in: [6ca7ca4b41] user: simon branch: trunk, size: 86739
2000-10-18
10:33
Add some more commented-out diagnostics for ssh1 file: [99f011bd46] check-in: [d06b20ce5f] user: simon branch: trunk, size: 86733
2000-10-12
09:24
Implement MD5 MAC for the benefit of old SSH2 servers file: [3a914afc1e] check-in: [9343a578d9] user: simon branch: trunk, size: 86347
08:34
Miscellaneous fixes for better interoperation with commercial SSH 2 file: [63a7385602] check-in: [8481f684cf] user: simon branch: trunk, size: 86295
07:39
Add a config option to emulate the HMAC bug in commercial SSH v2.3.x and earlier (namely, it uses only 16 bytes of key rather than 20). file: [68dcf01cb6] check-in: [1c4e477710] user: simon branch: trunk, size: 86174
2000-10-09
07:53
Robert de Bath's big patch: - cope with strange WinSock wrappers not supporting SIOCATMARK - define yet more terminal compatibility modes - support UK-ASCII (just like US-ASCII but # is a sterling sign) - support connection keepalives at a configurable interval file: [b4be75961d] check-in: [dacc5f4049] user: simon branch: trunk, size: 85843
2000-10-06
06:42
Tighten up use of "static" throughout. Module-internal things should NOT be exported willy-nilly. It encourages people to use them. file: [3eecbbd9d0] check-in: [39b5dda1d1] user: simon branch: trunk, size: 85573
2000-10-04
09:35
Store default port number in each back end file: [b6e2887fb7] check-in: [aa9735db7e] user: simon branch: trunk, size: 85440
2000-09-29
10:56
Further restructuring file: [4edef356f3] check-in: [a8fad32e72] user: simon branch: trunk, size: 85432
10:53
Fix ssh2 after the rev 1.54 [r649] reorg broke it file: [23d48db6e4] check-in: [5fa56c8f05] user: simon branch: trunk, size: 85084
07:04
Make sure a locally entered login name still comes up in the pw prompt file: [4877e33878] check-in: [7e03c47c01] user: simon branch: trunk, size: 85090
03:56
Add -pw and -P options, and usage/version message, to plink file: [286aedb9ba] check-in: [b7b9c438f2] user: simon branch: trunk, size: 85095
03:43
Minor restructuring to ssh.c in preparation for portability drive file: [3aeffc7ff9] check-in: [19989375f0] user: simon branch: trunk, size: 85117
2000-09-28
03:37
While we're doing a hostkey reorg, store port numbers as well file: [7e5ab59810] check-in: [730c1dee4e] user: simon branch: trunk, size: 84459
2000-09-27
10:21
Rationalised host key storage. Also started code reorg: persistent-state routines have been moved out into a replaceable module winstore.c. file: [96c51356e7] check-in: [0483920aa1] user: simon branch: trunk, size: 84369
04:36
Remove the special hooks in ssh.c for pscp. pscp now uses the standard interface to the outside of the ssh module. This means pscp now works without change in SSH2. file: [3e0e161f8f] check-in: [8fc7f9ff56] user: simon branch: trunk, size: 84070
2000-09-26
09:26
Implement OpenSSH-compatible RSA key fingerprints and use them throughout file: [2c5c5c3706] check-in: [17b8b5895e] user: simon branch: trunk, size: 87846
06:16
Fix a segfault in agent forwarding code file: [5db68ccb47] check-in: [54891bde65] user: simon branch: trunk, size: 88071
05:06
The "Authenticated using key from agent" message is a verbose-only one file: [899af6c774] check-in: [21e51ebc1d] user: simon branch: trunk, size: 88034
2000-09-25
05:14
Rationalise ordering of authentication operations. Still some work to do, but at least pscp no longer hangs when prompting for a passphrase file: [b65a5b275f] check-in: [8a1e546ec2] user: simon branch: trunk, size: 87916
2000-09-22
08:16
Enable better build-time flexibility over which WinSock to include file: [907c0af9ad] check-in: [710e30e69c] user: simon branch: trunk, size: 87567
08:10
Bug fix: line discipline selection is not enabled until after ssh authentication phase to stop user/password prompts behaving oddly file: [17d676c91c] check-in: [6a62bd814c] user: simon branch: trunk, size: 87485
06:04
Prevent network errors from summarily closing the window when CoE is off file: [c8a0245c78] check-in: [9a812d08ee] user: simon branch: trunk, size: 87443
2000-09-21
09:34
Miscellaneous ssh2 fixes. plink is now relatively sane file: [b42ab8b278] check-in: [95ba42915d] user: simon branch: trunk, size: 86432
2000-09-20
10:15
Fix Blowfish-with-SSH2 combination, and enable user cipher selection for SSH2 file: [bfe6a812ca] check-in: [d9a5271cd4] user: simon branch: trunk, size: 85607
09:29
SSH2 is now more plausible - window sizes listened to, basic non-crashing file: [4d033a5f47] check-in: [8c5d667bcc] user: simon branch: trunk, size: 84712
05:59
A couple of SSH2 fixes file: [db88364e0c] check-in: [5c68403ec1] user: simon branch: trunk, size: 79073
2000-09-15
06:26
Configuration option for agent forwarding file: [8fddb2d9d2] check-in: [98e7e211ec] user: simon branch: trunk, size: 79053
05:57
A couple of small cleanups file: [3eaa1d4923] check-in: [554d36098b] user: simon branch: trunk, size: 79082
05:48
Pageant now accepts an initial key list on the command line file: [1ea438569b] check-in: [8cc0645020] user: simon branch: trunk, size: 78595
2000-09-14
10:02
Added Pageant, a first-attempt PuTTY authentication agent file: [31c7b61e0a] check-in: [73ed12aa69] user: simon branch: trunk, size: 72252
2000-09-12
03:44
Add CryptoCard authentication file: [d87c921437] check-in: [fdee375aeb] user: simon branch: trunk, size: 68058
2000-09-11
04:37
Add switch to choose SSH v1-versus-v2 protocol preference where both are available file: [2ea77d0cd3] check-in: [588a02a9cc] user: simon branch: trunk, size: 66758
2000-09-09
03:21
Oops - remove SHA debugging from ssh2 file: [9df4491921] check-in: [885cafd0c2] user: simon branch: trunk, size: 66614
2000-09-08
11:42
Stop plink losing data at start of session file: [5112f71eb9] check-in: [d38c485e7c] user: simon branch: trunk, size: 66757
10:24
plink can now execute a specific command instead of just a shell session file: [7ae554165e] check-in: [de6e68c7a0] user: simon branch: trunk, size: 66594
09:45
Added a fourth application: plink, a command line connection utility file: [aa765ad7b6] check-in: [851ef355bf] user: simon branch: trunk, size: 65918
03:33
Public key authentication now works in pscp too - oops file: [d66edf35a9] check-in: [173ff281f1] user: simon branch: trunk, size: 65617
2000-09-07
11:33
RSA key authentication in ssh1 works; SSH2 is nearly there file: [3b09bc8d2a] check-in: [13f290eba8] user: simon branch: trunk, size: 65576
2000-09-06
04:55
SSH2 transport layer now enables encryption and MAC successfully for 3DES file: [171c26f2e4] check-in: [198ff9cc46] user: simon branch: trunk, size: 51775
2000-09-05
11:23
Second attempt. Can successfully decrypt the _first block_ of a packet. file: [a767cecdef] check-in: [30c9e5ddcd] user: simon branch: trunk, size: 51399
09:28
SSH 2 support, phase 1, debugging. Currently does Diffie-Hellman and gets the same results as the server, which is a pretty good start. file: [5fabc46d13] check-in: [bc6bddff97] user: simon branch: trunk, size: 49490
2000-07-26
07:13
Robert de Bath's Big Patch, part 1 file: [9e7e6479fe] check-in: [e340190952] user: simon branch: trunk, size: 30621
2000-07-21
04:17
PSCP: After a password supplied with `-pw' fails to authenticate, we should _not_ fall back to console input for a second attempt, because this hangs batch files. file: [2cbe9ce55f] check-in: [0c4c59b935] user: simon branch: trunk, size: 30840
2000-06-22
07:18
Joris van Rantwijk's unified SSH code suitable for PuTTY and PSCP file: [0225ae22cc] check-in: [61d07303f8] user: simon branch: trunk, size: 29944
2000-06-06
03:57
Security improvement: check that string length field in SSH_SMSG_{STDOUT,STDERR}_DATA packets is consistent with length field in packet header. (Helps prevent insertion attack.) file: [5410e42e1f] check-in: [0922f6a451] user: simon branch: trunk, size: 24085
2000-05-31
05:18
Security improvement: check CRC on incoming packets file: [ebfd34617c] check-in: [dae8565892] user: simon branch: trunk, size: 23955
2000-05-09
03:56
Ahem. This time high-half characters really _do_ work in username and password... file: [01e160447f] check-in: [27fcb12e7b] user: simon branch: trunk, size: 23629
2000-04-11
05:39
Enable high-half characters (>=160) in usernames and passwords file: [841ad4c658] check-in: [2461e9f12d] user: simon branch: trunk, size: 23553
2000-03-24
03:45
Peter Schellenbach's patch: re-implement the PuTTY cryptographic functions as calls to the MS Crypto API. Not integrated into the Makefile yet, but should eventually allow building of an SSH-enabled PuTTY which contains no native crypto code, so it can be used everywhere (and anyone who can get the MS encryption pack can still use the SSH parts). file: [46de560c6f] check-in: [b248ce49d9] user: simon branch: trunk, size: 23517
2000-03-15
09:08
First stab at the ability to compile puttytel.exe, an SSH-free variant which is patent-safe in the US and legal in France and Russia. This is a horrible hack in some ways: it's shown up serious deficiencies in the module boundaries. Needs further work, probably once the SSH implementations are recombined. file: [8ade4c2c41] check-in: [a4afd0589b] user: simon branch: trunk, size: 22976
1999-11-30
04:52
Robert de Bath's multi-purpose patch, slightly modified. - ^E answerback is now `PuTTY'. - The framework is now in place for the scrollback to reset to bottom on display _or_ keyboard events _or_ both. An actual configurable option isn't yet present, but most of the code is in place. - Try to deal with the problems where incoming data gets dropped after decoding but before display. - Scrollback behaviour has changed: instead of keying it off `scroll' versus `delete top line', things now go into the scrollback from _either_ of those but only if the primary screen is selected. Should fix problems with `less' and talkers. - must_update variable has gone because rdb correctly observed that it didn't seem to be doing a great deal :-) file: [e4530b1154] check-in: [763c0e4547] user: simon branch: trunk, size: 22653
1999-11-09
05:34
Fix unexpected network error 5000 file: [1003489215] check-in: [cae3ce78f1] user: simon branch: trunk, size: 22557
05:10
Changes from executor: - NetHack keypad mode (Shift only works with NumLock off) - Alt-Space handling (best I could manage; not too bad considering) - Event Log rather than Telnet Negotiation Log file: [3d73c8c171] check-in: [8280c29e1f] user: simon branch: trunk, size: 22365
1999-11-08
11:42
Add TIS authentication option file: [870ba89e55] check-in: [4b304bc66c] user: simon branch: trunk, size: 20511
11:36
Switch to using SSH_MSG macros file: [1e86c62dc3] check-in: [fe1c4a3d79] user: simon branch: trunk, size: 19071
1999-10-25
09:27
Fix versioncmp file: [8f0b48bc12] check-in: [051a4fe43c] user: simon branch: trunk, size: 18369
03:59
Single-DES encryption, patch courtesy of Murphy Lam file: [600fad92ce] check-in: [263fe0db81] user: simon branch: trunk, size: 18353
1999-09-10
10:35
We failed to ignore SSH_MSG_IGNORE :-) file: [ef79ed4e19] check-in: [3c445c51dd] user: simon branch: trunk, size: 17829
1999-07-20
08:01
Jimen Ching's patches to remove compiler warnings file: [4d1c263ab8] check-in: [bd48c6b3f9] user: simon branch: trunk, size: 17753
1999-07-06
14:42
Add encryption selection, and Blowfish as second option file: [155f214d4e] check-in: [2cefd5cfc4] user: simon branch: trunk, size: 17849
1999-03-23
11:21
Add SSH_STATE_CLOSED to prevent accidentally sending resizes down a closed connection; was causing process hangs under NT and whole- system hangs under '95 file: [a4040437b4] check-in: [a28de1805b] user: simon branch: trunk, size: 17191
1999-02-09
09:39
Fix various segfaults and heap trashes. Thanks to Andrew Mobbs. file: [bc7864e87f] check-in: [34fe4441bc] user: simon branch: trunk, size: 17068
1999-01-15
05:30
Add SSH don't-allocate-pty option, and corresponding LF-implies-CR terminal setting file: [a8f1e9327c] check-in: [1d64604a83] user: simon branch: trunk, size: 17064
1999-01-08
07:10
John Sullivan's patches plus more fixes: - Stop using the identifier `environ' as some platforms make it a macro - Fix silly error box at end of connection in FWHACK mode - Fix GPF on maximise-then-restore - Use SetCapture to allow drag-selecting outside the window - Correctly update window title when iconic and in win_name_always mode file: [b2d6351a90] check-in: [58b2a07677] user: simon branch: trunk, size: 16751
07:02
Added: Initial checkin: beta 0.43 file: [b2171dffea] check-in: [948f3f876e] user: simon branch: trunk, size: 16571