Timeline

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

81 check-ins using file config.c version aecdc01b83

2013-08-18
05:56
Don't run toplevel callbacks in modal dialogs. Because some of them can call gtk_main_quit(), which completely confuses the dialog box system. check-in: d89571a733 user: simon tags: trunk
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. check-in: cb5323bd7c user: simon tags: trunk
2013-08-17
11:06
Make calling term_nopaste() a cross-platform feature. It was one of those things that went in ages ago on Windows and never got replicated in the Unix front end. And it needn't be: ldisc.c is a perfect place to put it, since it knows which of the data it's sending is based on a keystroke and which is automatically generated, and it also has access to the terminal context. So now a keypress can interrupt a runaway paste on all platforms. check-in: 98e29c499b user: simon tags: trunk
11:06
Revamp Windows pending_netevent using toplevel callbacks. This greatly simplifies the process of calling select_result() from the top level after receiving WM_NETEVENT. check-in: c50a760764 user: simon tags: trunk
11:06
Revamp net_pending_errors using toplevel callbacks. Again, I've removed the special-purpose ad-hockery from the assorted front end message loops that dealt with deferred handling of socket errors, and instead uxnet.c and winnet.c arrange that for themselves by calling the new general top-level callback mechanism. check-in: 441fc5a4dd user: simon tags: trunk
11:06
Revamp GTK's session close handling using toplevel callbacks. Instead of having a special GTK idle function for dealing with session closing, I now use the new top-level callback mechanism which is slightly simpler for calling a one-off function. Also in this commit, I've arranged for connection_fatal to queue a call to the same session close function after displaying the message box, with the effect that now all the same processing takes place no matter whether the session closes cleanly or uncleanly - e.g. the SSH specials submenu is cleaned out, as it should be. check-in: 030eccd1a1 user: simon tags: trunk
11:06
Revamp Windows's close_session() using toplevel callbacks. Instead of setting a must_close_session flag and having special code in the message loop to check it, we'll schedule the call to close_session using the new top-level callback system. check-in: f66bde9fae user: simon tags: trunk
11:06
Revamp the terminal paste mechanism using toplevel callbacks. I've removed the ad-hoc front-end bodgery in the Windows and GTK ports to arrange for term_paste to be called at the right moments, and instead, terminal.c itself deals with knowing when to send the next chunk of pasted data using a combination of timers and the new top-level callback mechanism. As a happy side effect, it's now all in one place so I can actually understand what it's doing! It turns out that what all that confusing code was up to is: send a line of pasted data, and delay sending the next line until either a CR or LF is returned from the server (typically indicating that the pasted text has been received and echoed) or 450ms elapse, whichever comes first. check-in: e18f3877ae user: simon tags: trunk
11:06
Add a general way to request an immediate top-level callback. This is a little like schedule_timer, in that the callback you provide will be run from the top-level message loop of whatever application you're in; but unlike the timer mechanism, it will happen _immediately_. The aim is to provide a general way to avoid re-entrance of code, in cases where just _doing_ the thing you want done is liable to trigger a confusing recursive call to the function in which you came to the decision to do it; instead, you just request a top-level callback at the message loop's earliest convenience, and do it then. check-in: 0345763d47 user: simon tags: trunk
2013-08-15
01:42
Sebastian Kuschel reports that pfd_closing can be called for a socket error with pr->c NULL, in which case calling sshfwd_unclean_close on it will dereference NULL and segfault. Write an alternative error handling path for that possibility. (I don't know if it's the only way, but one way this can happen is if you're doing dynamic forwarding and the socket error occurs during SOCKS negotiation, in which case no SSH channel has been set up yet because we haven't yet found out what we want to put in the direct-tcpip channel open message.) check-in: 88d8a274b3 user: simon tags: trunk
2013-08-13
01:46
It turns out I was a little over-strict in my handling of EOF in pscp.c when I did the big revamp in r9279: I assumed that in any SCP connection we would be the first to send EOF, but in fact this isn't true - doing downloads with old-SCP, EOF is initiated by the server, so we were spuriously reporting an error for 'unexpected' EOF when everything had gone fine. Thanks to Nathan Phelan for the report. check-in: dbbbe4df65 user: simon tags: trunk
2013-08-08
12:22
sbcsgen.pl uses 'select' to point Perl at a different default output handle. Revert that when we hackily call it from mkfiles.pl, so that if I have a need to insert diagnostics in the latter they won't go into the end of sbcsdat.c. check-in: 7c257e8f47 user: simon tags: trunk
2013-08-07
01:22
Revert the default for font bolding style back to using colours rather than fonts. I broke this in r9559 when I added the option for 'both', because the internal representation got offset by one so as to change from a boolean to two bitfields and I must have confused myself about what the default should be. check-in: 31522c3eb3 user: simon tags: trunk
2013-08-06
12:09
Bump version number prior to tagging 0.63. check-in: ff340ac572 user: simon tags: trunk
11:45
One more defensive assert, just to be sure. check-in: d6125310dc user: simon tags: trunk
2013-08-05
14:50
The bignum code has two representations of zero, since bn_restore_invariant (and the many loops that duplicate it) leaves a single zero word in a bignum representing 0, whereas the constant 'Zero' does not have any data words at all. Cope with this in bignum_cmp. (It would be a better plan to decide on one representation and stick with it, but this is the less disruptive fix for the moment.) check-in: 87e71d1709 user: simon tags: trunk
14:50
Add some more precautionary assertions, just in case anything wildly out of range manages to get past other recent fixes. check-in: 165e9c6988 user: simon tags: trunk
10:15
Belatedly update the copyright year to 2013. check-in: f12ca7dab6 user: jacob tags: trunk
2013-08-04
17:33
Fix memory leaks in the new error return from modinv. check-in: 831e4c58e8 user: simon tags: trunk
14:34
Spot when we didn't successfully create an RSA public key from a public blob, and return a proper error in that situation rather than a struct with unhelpful NULLs in. check-in: 6f71c3af5a user: simon tags: trunk
14:34
Make modinv able to return NULL if its inputs are not coprime, and check for that return value everywhere it is used. check-in: 81126a7cf8 user: simon tags: trunk
14:34
Avoid trying to take the modular inverse of zero in response to a sufficiently silly DSA signature. check-in: ea82957c5a user: simon tags: trunk
14:33
Another couple of memory leaks. check-in: e901ff1b64 user: simon tags: trunk
14:33
More consistently defend against division by zero with assertions. We now check that all the modular functions (modpow, modinv, modmul, bigdivmod) have nonzero moduli, and that modinv also has a nonzero thing to try to invert. check-in: 1d79e0227d user: simon tags: trunk
14:33
Validate newly created DSA keys more carefully. Don't want a structure half-filled with null pointers. check-in: c783761d06 user: simon tags: trunk
14:33
Remove some redundant null-pointer checks from code that must have been written before I wrote a never-failing snew. check-in: ee86c225d3 user: simon tags: trunk
14:33
Sanitise freeing of DSA keys. check-in: ff56f110f0 user: simon tags: trunk
14:32
Reinstate a piece of code accidentally removed in r9214, where Windows PuTTY does not trim a colon suffix off the hostname if it contains _more than one_ colon. This allows IPv6 literals to be entered. (Really we need to do a much bigger revamp of all uses of hostnames to arrange that square-bracketed IPv6 literals work consistently, but this at least removes a regression over 0.62.) check-in: 6a08410fec user: simon tags: trunk
2013-08-02
17:33
Raise the default scrollback from 200 to 2000 lines. The former was not so silly in the 1990s and before I implemented scrollback compression, but it's been a ridiculously low default for a while now. check-in: 9dde867cfc user: simon tags: trunk
14:51
Found a lot of places in sshbn.c where for-loops zeroing out memory just before freeing it really ought to be smemclrs. check-in: 911c0d2c25 user: simon tags: trunk
01:28
Verify RSA keys created by rsa2_openssh_createkey. check-in: d3496c3c83 user: simon tags: trunk
01:28
Replace some 'sfree' calls of bignums with the proper 'freebn'. check-in: 1dd02ecbaf user: simon tags: trunk
01:27
Add some missing bounds checks in signature verification routines. check-in: 0b92b855f5 user: simon tags: trunk
01:27
Fix an array-size bug in modmul, and add some tests for it. check-in: 9061bc28f3 user: simon tags: trunk
2013-07-29
12:47
Remove one of the frees added in r9916. stat_name points to somewhere within the same string that destfname points to the start of, so freeing it causes at best a double-free of destfname and more likely a free of something that isn't even the start of an allocated block. check-in: f6693a7219 user: simon tags: trunk
2013-07-27
13:35
Add an assortment of missing consts I've just noticed. check-in: 9388e0e1ae user: simon tags: trunk
2013-07-24
14:18
Get rid of the variable 'advapi' in Pageant's WinMain, which was never actually used for anything sensible and could have been freed while containing nonsense at program end. check-in: 216d70f276 user: simon tags: trunk
2013-07-22
14:56
Back out r9964. I wasn't paying attention: every control is in the byid tree but not all of them are in the byctrl tree. check-in: 3eb328f003 user: simon tags: trunk
14:56
Add a bob script to do Coverity scanning. check-in: 534a54bd61 user: simon tags: trunk
14:55
Fix a few more memory and resource leaks. check-in: 9b3e8c1465 user: simon tags: trunk
14:55
Remove the variable 'bufused', which came over from winnet.c in mistaken cut and paste and is just a bug. check-in: b3b80590c1 user: simon tags: trunk
02:12
Increase FONT_MAXNO from 0x2f to 0x40, to ensure the fonts[] array includes every possible combination of the font bitfields, in particular ATTR_OEM|ATTR_NARROW. check-in: 6eed22fa7a user: simon tags: trunk
02:12
Correct an inequality sign causing the bounds check in Windows palette_set() to be bogus. Fortunately, this isn't exploitable through the terminal emulator, because the palette escape sequence parser contains its own bounds check before even calling palette_set(). While I'm at it, fix the same goof in the OS X version! That port is more or less abandoned, but that's no excuse for leaving obviously wrong code lying around. check-in: eb7d5a10e2 user: simon tags: trunk
02:12
Missing assert. check-in: 7ab72cb74f user: simon tags: trunk
02:12
Replace the type-checking COMPTR macro with my current idea of best practice in type-check macros. check-in: 6231caddfe user: simon tags: trunk
02:12
Add missing casts in arguments to ctype functions. check-in: 2ca4f7724b user: simon tags: trunk
02:12
Rationalise null pointer checks in both decode_codepage functions, so that decode_codepage(NULL) and decode_codepage("") both return the default character set. check-in: 52a52f87c4 user: simon tags: trunk
02:11
Fix a double error handling goof in the winstore side of the jump list support: transform_jumplist_registry should give its caller dynamically allocated data if and only if it returns JUMPLISTREG_OK, and get_jumplist_registry_entries should test the return value against JUMPLISTREG_OK rather than a value from a totally different enum. check-in: 4308431bba user: simon tags: trunk
02:11
Another big batch of memory leak fixes, again mostly on error paths. The most interesting one is printer_add_enum, which I've modified to take a char ** rather than a char * so that it can both realloc its input buffer _and_ return NULL to indicate error. check-in: c3f3ee12f4 user: simon tags: trunk
02:11
Add a missing null pointer check in one of the dialog box functions. check-in: 3a9b6d22d8 user: simon tags: trunk
02:11
Report an error if deleting a random seed file fails. (This has also required me to add a currently unused nonfatal() to PuTTYgen, since although PuTTYgen won't actually try to delete putty.rnd, it does link in winstore.c as a whole.) check-in: 8954381522 user: simon tags: trunk
02:11
Invent a win_strerror() function which behaves as much like Unix strerror as I can arrange, wrapping up all the ugly FormatMessage nonsense and caching previously looked-up messages for reuse so that callers can treat them as static. check-in: 608a3a3766 user: simon tags: trunk
02:11
Rework keylist_update() to fix both a buffer-size limitation and a memory leak. check-in: 91560392b8 user: simon tags: trunk
2013-07-21
06:01
Initialise 'psa' to NULL on every code path in the Pageant client code, fixing a potential segfault when compiling with -DNO_SECURITY. check-in: 3f060d2ca9 user: simon tags: trunk
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. check-in: 127cf34c50 user: simon tags: trunk
04:16
Add '.so' to the list of file extensions cleared up by 'make clean' in Makefile.cyg, since if you're building against Winelib it will generate one of those alongside each .exe file. check-in: 3c11ddd270 user: simon tags: trunk
02:40
Completely remove the 'frozen_readable' mechanism from uxnet.c. It parallels a similar mechanism in winnet.c and came over by copy and paste, but is pointless in the Unix networking API. On Windows, if you're using a mechanism such as WSAAsyncSelect which delivers readability notifications as messages rather than return values from a system call, you only get notified that a socket is readable once - it remembers that it's told you, and doesn't tell you again until after you've done a read. So in the case where we intentionally stop reading from a socket because our local buffer is full, and later want to start reading again, we do a read from the socket with MSG_PEEK set, and that clears Windows's flag and tells it to start sending us readability notifications again. On Unix, select() and friends didn't do anything so strange in the first place, so the whole mechanism is unnecessary. check-in: 6c0335a94e user: simon tags: trunk
02:40
Fix error checking in uxstore.c: add a missing check, and fix a mis-cut-and-pasted one. check-in: ef3d2b4788 user: simon tags: trunk
02:40
When I turned fcntls into noncloexecs in r9940, I missed one. check-in: c138704d7f user: simon tags: trunk
02:40
Two more memory leak fixes, on error paths I didn't spot in r9919. check-in: fd4c3490f1 user: simon tags: trunk
2013-07-20
08:15
Fix a null-dereference introduced by another mis-fix in r9919. check-in: f1918a54f9 user: simon tags: trunk
08:15
Fix leak of 'fname' introduced by the rewrite of write_random_seed in r9933. check-in: e9b29537b5 user: simon tags: trunk
08:15
Another two mis-fixes from r9919: when we sfree(line) on exit from the ssh.com and OpenSSH key import loops, we should also null it out so that the cleanup path doesn't try to re-free the same pointer. check-in: 987177cbd7 user: simon tags: trunk
08:15
Redo a mis-fix of a memory leak in r9919: I added sfree(data) immediately after conf_deserialise in the Duplicate Session receiver, whereas I should have put it after the subsequent loop that extracts the pty argv if any. check-in: 3f9156f8b5 user: simon tags: trunk
06:31
Switch to translating keystrokes using ToUnicodeEx rather than ToAsciiEx, where possible. This enables support for keys which generate Unicode characters that aren't in the system code page, which seems to me like a perverse way for Windows to have set up the system code page but apparently does happen, e.g. (I'm told) U+0219 and U+021B on Romanian keyboards. Patch mostly due to Andrei Damian-Fekete. check-in: 14d0fea887 user: simon tags: trunk
03:34
Been meaning to get round to this for a while: use CryptGenRandom to gather extra entropy at Windows PuTTY startup time. (It's only used as one of the inputs to PuTTY's internal entropy pool, so nobody is required to trust it.) check-in: 47054fafef user: simon tags: trunk
2013-07-19
13:10
Centralise calls to fcntl into functions that carefully check the error returns. check-in: 04c7a24906 user: simon tags: trunk
12:45
Add an error check to every setsockopt call in uxnet.c. check-in: 9121a6c35f user: simon tags: trunk
12:44
Add some conditionally-compilable diagnostics to the RNG. I got briefly worried that it might not be doing what I thought it was doing, but examining these diagnostics shows that it is after all, and now I've written them it would be a shame not to keep them for future use. check-in: 24255e01ac user: simon tags: trunk
12:44
Better error reporting when failing to save a session. check-in: 2e61d87342 user: simon tags: trunk
12:44
Add some missing calls to cleanup_exit. check-in: 8f4562c3b3 user: simon tags: trunk
12:44
Run the random pool setup and teardown functions with random_active nonzero rather than zero. check-in: 412920de82 user: simon tags: trunk
12:44
Report errors in store_host_key too. check-in: 690915520f user: simon tags: trunk
12:44
Add proper error reports in write_random_seed, via the new 'nonfatal' error reporting function. check-in: 9fe9012e9a user: simon tags: trunk
12:44
Add a nonfatal() function everywhere, to be used for reporting things that the user really ought to know but that are not actually fatal to continued operation of PuTTY or a single network connection. check-in: ad8c919057 user: simon tags: trunk
12:44
Add a missing error check in pterm's child-process setup. Shouldn't really fail, but might as well be careful. check-in: e86c47be22 user: simon tags: trunk
12:44
It suddenly strikes me as probably a good idea to enforce that anyone calling random_byte has previously called random_ref. (I'm not aware of any current code getting this wrong! It just seems to me to be the sort of thing you'd want to be really sure of.) check-in: 001c304e9e user: simon tags: trunk
2013-07-15
01:40
Fix a build failure: r9924 thoughtlessly put an assert before some declarations, and gcc didn't complain but VC did. check-in: 6ced7110ac user: simon tags: trunk
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'. check-in: f0f597f3a9 user: simon tags: trunk
05:46
Remove a redundant while-loop condition when reading RFC822-style header text from a PuTTY key file. (It's silly to have both while (len > 0) at the top of the loop _and_ an if (len == 0) return in the middle, and in fact the former was the erroneous one since it would have prohibited a 39-character header, which I intended to be permitted.) check-in: 09fe2439b4 user: simon tags: trunk
05:46
Remove a pointless assignment in setup_config_box. check-in: 6e56f8bdd7 user: simon tags: trunk