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'.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9927 cda61777-01e9-0310-a592-d414129be87e
Fix a build failure: r9924 thoughtlessly put an assert before some
declarations, and gcc didn't complain but VC did.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9928 cda61777-01e9-0310-a592-d414129be87e
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.)


git-svn-id: svn://svn.tartarus.org/sgt/putty@9930 cda61777-01e9-0310-a592-d414129be87e
Add a missing error check in pterm's child-process setup. Shouldn't
really fail, but might as well be careful.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9931 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9932 cda61777-01e9-0310-a592-d414129be87e
Add proper error reports in write_random_seed, via the new 'nonfatal'
error reporting function.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9933 cda61777-01e9-0310-a592-d414129be87e
Report errors in store_host_key too.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9934 cda61777-01e9-0310-a592-d414129be87e
Run the random pool setup and teardown functions with random_active
nonzero rather than zero.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9935 cda61777-01e9-0310-a592-d414129be87e
Add some missing calls to cleanup_exit.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9936 cda61777-01e9-0310-a592-d414129be87e
Better error reporting when failing to save a session.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9937 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9938 cda61777-01e9-0310-a592-d414129be87e
Add an error check to every setsockopt call in uxnet.c.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9939 cda61777-01e9-0310-a592-d414129be87e
Centralise calls to fcntl into functions that carefully check the
error returns.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9940 cda61777-01e9-0310-a592-d414129be87e
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.)


git-svn-id: svn://svn.tartarus.org/sgt/putty@9941 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9942 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9943 cda61777-01e9-0310-a592-d414129be87e
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.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9944 cda61777-01e9-0310-a592-d414129be87e
Fix leak of 'fname' introduced by the rewrite of write_random_seed in
r9933.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9945 cda61777-01e9-0310-a592-d414129be87e
Fix a null-dereference introduced by another mis-fix in r9919.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9946 cda61777-01e9-0310-a592-d414129be87e
Two more memory leak fixes, on error paths I didn't spot in r9919.


git-svn-id: svn://svn.tartarus.org/sgt/putty@9948 cda61777-01e9-0310-a592-d414129be87e