Граф коммитов

51 Коммитов

Автор SHA1 Сообщение Дата
Jacob Nevins bd6eadd196 Improvements to PuTTYgen error reporting:
- will now display a reason when it fails to load a key
 - uses existing error return from native keys
 - import.c had a lot of error descriptions which weren't going anywhere;
   since the strings are probably taking up space in the binary, we
   may as well use them

[originally from svn r5408]
2005-02-27 23:01:11 +00:00
Jacob Nevins eba099d006 Pull out the common compiler-specific workarounds and so on from individual
resource files into windows/rcstuff.h.

[originally from svn r5405]
2005-02-26 17:43:47 +00:00
Jacob Nevins f9363925c6 We weren't correctly discounting "." and ".." when they came from
FindFirstFile(), with hilarious consequences for recursive transfers in
PSFTP. (PSCP appears to behave fine; it does its own "."/".." removal.)

[originally from svn r5398]
2005-02-26 00:41:36 +00:00
Simon Tatham 6d47285462 Fallout from my change in the semantics of cfg.remote_cmd_ptr.
Spotted by Alano na Alania.

[originally from svn r5386]
2005-02-23 09:25:39 +00:00
Jacob Nevins bb874319fb Ahem. Fix my hostkey dialog fix so that storing the host key doesn't
close the connection.

[originally from svn r5379]
2005-02-21 23:34:41 +00:00
Jacob Nevins 38c9737e19 Change "are you sure you want to close this window" default back to what it
was ("yes"). Partly because it was inconsistent with gtkdlg.c, and partly
because it was annoying me.

[originally from svn r5371]
2005-02-20 23:26:47 +00:00
Jacob Nevins 651cedc7fb On Windows, MessageBoxIndirect() was sometimes failing to pop up the host key
dialog and returning an unexpected value (0), causing everything to silently
behave as if the user had said "allow this connection but don't store host
key"!

Initialising (MSGBOXPARAMS).hInstance seems to have cured this (although the
MSDN docs seemed to indicate it wouldn't be used) -- if so, it's been broken
since r5309 on 2004-02-15 -- but since this was something of a Heisenbug, and
the behaviour was so catastrophic when MessageBoxIndirect() behaved oddly, I've
rearranged the code to default to cancelling, and added an assertion for
visibility.

(Windows PuTTY still seems to be broken wrt servers that send NEWKEYS while
we're waiting for the user, which happens to include the "SSH-2.0-2.4.1 SSH
Secure Shell OpenVMS V1.0" I'm testing against. I don't know why. The above bug
may also have been limited to this circumstance.)

[originally from svn r5370]
[r5309 == 99122767f5]
2005-02-20 23:00:17 +00:00
Simon Tatham 97154e55da Bump version numbers. (Forgot to do this _before_ dropping the 0.57
tag, but that's OK because SVN doesn't distinguish tags from
branches anyway...)

[originally from svn r5361]
2005-02-20 10:51:02 +00:00
Simon Tatham f73fcb0424 Add asynchronous callback capability to the askappend() alert box.
This was harder than verify_ssh_host_key() and askalg() put
together, because:
 (a) askappend() can be called at any time, since it's a side effect
     of data-logging functions. Therefore there can be an unfinished
     askappend() alert at any time, and hence the OS X front end has
     to be prepared to _queue_ other alerts which occur during that
     time.
 (b) logging.c has to do something with data that comes in while
     it's waiting for an answer to askappend(). It buffers it until
     it knows what the user wants done with it. This involved
     something of a reorganisation of logging.c.

[originally from svn r5344]
2005-02-18 18:33:31 +00:00
Simon Tatham 8574822b9b 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.

[originally from svn r5330]
2005-02-17 18:34:24 +00:00
Jacob Nevins db19a6aff1 Minor reorganisations to WinHelp support. (Done as part of a - failed -
attempt to fix `winhelp-crash', but we may as well keep them.)

[originally from svn r5314]
2005-02-16 01:47:10 +00:00
Jacob Nevins 99122767f5 The Windows host key dialogs now have a `Help' button that should give
appropriate context help, iff the help file is present. (Shame it's prey to
`winhelp-crash'.)

(I've perpetrated a widening of visibility of `hwnd'; the alternative, putting
it into a frontend handle, seemed too likely to cause maintenance trouble if
we don't also _use_ that frontend handle everywhere we now use the global
`hwnd'.)

[originally from svn r5309]
2005-02-15 22:23:47 +00:00
Jacob Nevins 0fb46d3a0a Add a couple of other sensible button defaults in MessageBox()s.
[originally from svn r5305]
2005-02-15 19:22:47 +00:00
Jacob Nevins e8a4e7e601 Martin Radford points out that the default action for the host key
confirmation dialogs should be "cancel", not "accept".

[originally from svn r5304]
2005-02-15 19:10:44 +00:00
Jacob Nevins c9116974ac 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().

[originally from svn r5303]
2005-02-15 17:05:58 +00:00
Jacob Nevins 63784f3f9a Martin Prikryl points out that we weren't always initialising new "addrinfo"
members of Windows SockAddr_tag; particular in sk_nonamelookup() (proxy
resolution at far end) this was causing trouble.

Make sure they _always_ start out NULL (since the Windows getaddrinfo()
documentation doesn't make any claims about initialisation), and also
initialise 'naddresses' in sk_nonamelookup() for good measure.

[originally from svn r5297]
2005-02-14 11:43:27 +00:00
Jacob Nevins 0259612237 Petri Kero pointed out a FreeLibrary() call that should be guarded by NO_IPV6.
[originally from svn r5268]
2005-02-07 12:23:10 +00:00
Ben Harris 865fbaa8ce Overhaul of client-side XDM-AUTHORIZATION-1:
* Make sk_getxdmdata() return an arbitrary string rather than two integers.
  This better matches the spec, even if the current version always returns
  six bytes
* On Unix, for PF_UNIX sockets, return a counter rather than a constant along
  with the PID.  This should allow multiple clients to connect within one
  second, and is what Xlib does.
* On Unix, interpret AF_INET6 addresses like Xlib does, returning the
  embedded IPv4 address for v4-mapped addresses, and six bytes of zeroes
  otherwise.  The latter is silly, but if I'm going to do anything more sane
  I need to check that X servers won't reject it.

[originally from svn r5219]
2005-01-28 11:39:45 +00:00
Simon Tatham f70efc5cc6 Support for falling back through the list of addresses returned from
a DNS lookup, whether they're IPv4, v6 or a mixture of both.

[originally from svn r5119]
[this svn revision also touched putty-wishlist]
2005-01-16 14:29:34 +00:00
Simon Tatham e7b53c3ad5 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.

[originally from svn r5092]
2005-01-11 10:37:55 +00:00
Owen Dunn 06434ffc71 New function ltime() returns a struct tm of the current local time.
Fixes crashes when time() returns (time_t)-1 on Windows by using the
Win32 GetLocalTime() function.  (The Unix implementation still just 
uses time() and localtime().)

[originally from svn r5086]
2005-01-09 14:27:48 +00:00
Simon Tatham c57e9f0672 For local and dynamic port forwardings (i.e. the ones which listen
on a local port), the `Auto' protocol option on the Tunnels panel
should always produce a port you can connect to in _either_ of IPv4
and v6, because the aim is for the user not to have to know or care
which one they're using. This was not the case on Windows, and now
is. Also, updated the docs to give more detail on issues like this.

[originally from svn r5083]
2005-01-08 14:45:26 +00:00
Simon Tatham 79629c729c Cleanups to sk_namelookup(). In particular, it now doesn't segfault
if you explicitly specify IPv6 and then try to look up a hostname
which doesn't have an IPv6 address.

[originally from svn r5082]
2005-01-08 14:02:06 +00:00
Simon Tatham b93e12d477 It's a new year!
[originally from svn r5061]
[this svn revision also touched putty-website]
2005-01-02 09:19:14 +00:00
Simon Tatham b66b93034d A couple of people have pointed out that the local variable
`reading' in this file is not reliably initialised.

[originally from svn r5054]
2004-12-31 19:06:20 +00:00
Simon Tatham 6daf6faede 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.

[originally from svn r5047]
[this svn revision also touched putty-wishlist]
2004-12-30 16:45:11 +00:00
Simon Tatham 7573f3733f Stray // comments.
[originally from svn r5046]
2004-12-30 15:29:38 +00:00
Simon Tatham b0bf176dfb 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.

[originally from svn r5040]
[r5031 == d77102a8d5]
2004-12-29 12:32:25 +00:00
Simon Tatham 340afa2733 Ability to save in mid-session! Simplest possible resolution to all
the difficult questions about when it's sensible to offer the option
of saving to the slot we loaded from: _we never do_. The user must
always explicitly specify a slot to save to.

[originally from svn r5035]
[this svn revision also touched putty-wishlist]
2004-12-28 16:46:30 +00:00
Jacob Nevins 30896d650e Basic configurability for client-initiated rekeys.
[originally from svn r5027]
2004-12-24 13:39:32 +00:00
Jacob Nevins 3c98d6e60d 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).

[originally from svn r5022]
2004-12-23 02:24:07 +00:00
Jacob Nevins f13f9f6420 Fix potential access of freed data (only if we couldn't create the
second of two registry keys, so pretty unlikely).

[originally from svn r5021]
2004-12-22 23:17:02 +00:00
Jacob Nevins 4cae179ff8 Restore border around terminal to default background colour rather than
something outside colours[] (consistently brown on my system).

(I don't understand why this code was the way it was, but it gave the
correct result before r4917 `256-colours', and now doesn't.)

[originally from svn r5014]
[r4917 == e4e10e494b]
2004-12-19 23:37:30 +00:00
Jacob Nevins 2a69c4e0fa Correct number of configurable colours (NCFGCOLOURS) to match reality
(leftover from `256-colours', r4917).

[originally from svn r5013]
[r4917 == e4e10e494b]
2004-12-19 23:15:17 +00:00
Jacob Nevins a27ce0492b Fix line cursor colours (fallout from `256-colours'), on both Windows and Unix.
[originally from svn r5012]
2004-12-19 22:37:05 +00:00
Simon Tatham 6c81ee6706 General mechanism for ensuring a dodgy SFTP server can't return
malicious filenames via FXP_READDIR.

[originally from svn r4995]
2004-12-16 19:36:47 +00:00
Simon Tatham f1585f8f46 Jacob points out that I introduced a bug in PSFTP when I did the
timing shakeup: just running `psftp' caused the net/stdin select
loop (on both Unix and Windows) to get confused at the lack of any
network connection and give up immediately. Should now be fixed.

[originally from svn r4993]
2004-12-16 19:15:38 +00:00
Jacob Nevins a2e01a5604 Abe Crabtree complains that flushing the log file as often as we do in 0.56
results in unacceptable performance for him on Win2000. Add a checkbox to
revert to the old behaviour.

[originally from svn r4988]
[this svn revision also touched putty-wishlist]
2004-12-16 15:22:36 +00:00
Simon Tatham 89f4cf6a0a Rename scp.* to pscp.*, because I always misspell it that way. Also
it's more consistent with PSFTP like this: scp.c/pscp.c is more
similar to psftp.c (the main application framework) than it is to
sftp.c (a set of back-end library routines).

[originally from svn r4987]
2004-12-16 15:01:43 +00:00
Owen Dunn 7e7aec0ca4 Nitpick, close bracket.
[originally from svn r4926]
2004-11-29 16:58:02 +00:00
Jacob Nevins 96a5923cc3 Briefly document the "CP866" manual-entry feature on Windows in the dialog
itself (since we have a bit of room).

[originally from svn r4922]
2004-11-29 09:23:11 +00:00
Simon Tatham e4e10e494b Implement xterm 256-colour mode.
[originally from svn r4917]
[this svn revision also touched putty-wishlist]
2004-11-28 15:13:34 +00:00
Simon Tatham 8c69ba0672 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!

[originally from svn r4913]
2004-11-27 19:56:38 +00:00
Simon Tatham 9fc67313fb Changes in startup order to ensure any subsystem which might attempt
to schedule timers is not started until after hwnd is initialised.

[originally from svn r4912]
2004-11-27 19:41:24 +00:00
Simon Tatham 92f3b101f5 Slight improvement to cursor blink timing: since the cursor doesn't
blink when the window doesn't have focus, we don't schedule blink
timers at that point either.

Infrastructure change: term->has_focus should now not be written
directly from outside terminal.c. Instead, use the function
term_set_focus, which will sort out the blink timers as well.

[originally from svn r4911]
2004-11-27 19:34:45 +00:00
Simon Tatham 7ecf13564a 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).

[originally from svn r4906]
[this svn revision also touched putty-wishlist]
2004-11-27 13:20:21 +00:00
Jacob Nevins 4f6e453530 Add missing backslash in "Unable to create registry key" messages.
[originally from svn r4855]
2004-11-20 19:07:34 +00:00
Jacob Nevins 693f062397 UI tweak from Malcolm Rowe: set IDM_VIEWKEYS as the default menu item and use
that mechanism to invoke it on double-click; this emboldens it in the right-
click menu.

[originally from svn r4851]
2004-11-20 18:29:58 +00:00
Jacob Nevins 739de21c6d console_get_line() returns failure iff console_batch_mode is set, whereas
before is would return success and the empty string. IMO this makes `-batch'
much more useful; before, utilities such as Plink in `-batch' mode would
attempt to plough on using empty strings for usernames, passwords, and so on.

[originally from svn r4832]
2004-11-19 21:05:31 +00:00
Simon Tatham 3a7fbd292a Fix Windows installer script: the paths were wrong after the
directory reorganisation, and also the EOL style needs to be CRLF or
Inno Setup gets upset.

[originally from svn r4793]
2004-11-16 23:26:22 +00:00