Permalink
Browse files

Original PuTTY beta 0.62 from Simon Tatham.

  • Loading branch information...
1 parent d83cc90 commit a37f8efa131e2d4198f00c19f387e6b0da2bd064 rmcardle committed Jan 13, 2012
View
@@ -1,6 +1,6 @@
/*
* Linking module for programs that do not support selection of backend
- * (such as pscp or pterm).
+ * (such as pterm).
*/
#include <stdio.h>
View
@@ -0,0 +1,16 @@
+/*
+ * Linking module for programs that are restricted to only using SSH
+ * (pscp and psftp). These do not support selection of backend, but
+ * must still have a backends[] array mentioning SSH because
+ * settings.c will want to consult it during session load.
+ */
+
+#include <stdio.h>
+#include "putty.h"
+
+const int be_default_protocol = PROT_SSH;
+
+Backend *backends[] = {
+ &ssh_backend,
+ NULL
+};
View
@@ -7,6 +7,7 @@ module putty
set Makever -DSVN_REV=$(revision)
ifneq "$(!numeric $(revision))" "yes" set Makever $(Makever) -DMODIFIED
ifneq "$(RELEASE)" "" set Makever $(Makever) -DRELEASE=$(RELEASE)
+ifneq "$(PRERELEASE)" "" set Makever $(Makever) -DPRERELEASE=$(PRERELEASE)
ifneq "$(date)" "" set Makever $(Makever) -DSNAPSHOT=$(date)
set Makeargs VER="$(Makever)"
ifneq "$(XFLAGS)" "" set Makeargs $(Makeargs) XFLAGS="$(XFLAGS)"
@@ -15,11 +16,13 @@ ifneq "$(MAKEARGS)" "" set Makeargs $(Makeargs) $(MAKEARGS)
# Set up the version string for the docs build.
set Docmakeargs VERSION="PuTTY revision $(revision)"
ifneq "$(RELEASE)" "" set Docmakeargs VERSION="PuTTY release $(RELEASE)"
+ifneq "$(PRERELEASE)" "" set Docmakeargs VERSION="PuTTY pre-release $(PRERELEASE):r$(revision)"
ifneq "$(date)" "" set Docmakeargs VERSION="PuTTY development snapshot $(date)"
# Set up the version string for the Unix source archive.
set Unxver r$(revision)
ifneq "$(RELEASE)" "" set Unxver $(RELEASE)
+ifneq "$(PRERELEASE)" "" set Unxver $(PRERELEASE)pre $(revision)
ifneq "$(date)" "" set Unxver $(date)
# Set up the various version strings for the installer.
@@ -33,16 +36,15 @@ ifneq "$(RELEASE)" "" set Iname PuTTY version $(RELEASE)
ifneq "$(RELEASE)" "" set Ivertext Release $(RELEASE)
ifneq "$(RELEASE)" "" set Irev 0
ifneq "$(RELEASE)" "" set Ifilename putty-$(RELEASE)-installer.exe
+ifneq "$(PRERELEASE)" "" set Iversion $(PRERELEASE):r$(revision)
+ifneq "$(PRERELEASE)" "" set Iname PuTTY pre-release $(PRERELEASE):r$(revision)
+ifneq "$(PRERELEASE)" "" set Ivertext Pre-release $(PRERELEASE):r$(revision)
+ifneq "$(PRERELEASE)" "" set Ifilename putty-$(PRERELEASE)-pre$(revision)-installer.exe
ifneq "$(date)" "" set Iversion $(date):r$(revision)
ifneq "$(date)" "" set Iname PuTTY development snapshot $(date):r$(revision)
ifneq "$(date)" "" set Ivertext Development snapshot $(date):r$(revision)
ifneq "$(date)" "" set Ifilename putty-$(date)-installer.exe
-# Set up the version string for the installer.
-set Iversion r$(revision)
-ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
-ifneq "$(date)" "" set Iversion $(date):r$(revision)
-
in putty do ./mksrcarc.sh
in putty do ./mkunxarc.sh $(Unxver)
in putty do perl mkfiles.pl
View
@@ -1,4 +1,4 @@
-\define{versionidplink} \versionid $Id: plink.but 9202 2011-07-12 18:26:18Z simon $
+\define{versionidplink} \versionid $Id: plink.but 9366 2011-12-10 12:08:09Z simon $
\C{plink} Using the command-line connection tool \i{Plink}
@@ -43,7 +43,7 @@ use Plink:
\c Z:\sysosd>plink
\c PuTTY Link: command-line connection utility
-\c Release 0.61
+\c Release 0.62
\c Usage: plink [options] [user@]host [command]
\c ("host" can also be a PuTTY saved session name)
\c Options:
View
@@ -1,4 +1,4 @@
-\define{versionidpscp} \versionid $Id: pscp.but 9202 2011-07-12 18:26:18Z simon $
+\define{versionidpscp} \versionid $Id: pscp.but 9366 2011-12-10 12:08:09Z simon $
\#FIXME: Need examples
@@ -41,7 +41,7 @@ use PSCP:
\c Z:\owendadmin>pscp
\c PuTTY Secure Copy client
-\c Release 0.61
+\c Release 0.62
\c Usage: pscp [options] [user@]host:source target
\c pscp [options] source [source...] [user@]host:target
\c pscp [options] -ls [user@]host:filespec
View
@@ -174,15 +174,15 @@ plink: be_all_s.o cmdline.o cproxy.o ldisc.o logging.o misc.o pgssapi.o \
uxnet.o uxnoise.o uxplink.o uxproxy.o uxsel.o uxser.o \
uxsignal.o uxstore.o version.o wildcard.o x11fwd.o
-pscp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
+pscp: be_ssh.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
pinger.o portfwd.o proxy.o pscp.o settings.o sftp.o ssh.o \
sshaes.o ssharcf.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
sshdes.o sshdh.o sshdss.o sshgssc.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o sshzlib.o \
time.o timing.o tree234.o uxagentc.o uxcons.o uxgss.o \
uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o uxsftp.o \
uxstore.o version.o wildcard.o x11fwd.o
- $(CC) $(ULDFLAGS) -o $@ be_none.o cmdline.o cproxy.o int64.o \
+ $(CC) $(ULDFLAGS) -o $@ be_ssh.o cmdline.o cproxy.o int64.o \
logging.o misc.o pgssapi.o pinger.o portfwd.o proxy.o pscp.o \
settings.o sftp.o ssh.o sshaes.o ssharcf.o sshblowf.o \
sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o sshdss.o \
@@ -192,15 +192,15 @@ pscp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
uxproxy.o uxsel.o uxsftp.o uxstore.o version.o wildcard.o \
x11fwd.o
-psftp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
+psftp: be_ssh.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
pinger.o portfwd.o proxy.o psftp.o settings.o sftp.o ssh.o \
sshaes.o ssharcf.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
sshdes.o sshdh.o sshdss.o sshgssc.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o sshzlib.o \
time.o timing.o tree234.o uxagentc.o uxcons.o uxgss.o \
uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o uxsftp.o \
uxstore.o version.o wildcard.o x11fwd.o
- $(CC) $(ULDFLAGS) -o $@ be_none.o cmdline.o cproxy.o int64.o \
+ $(CC) $(ULDFLAGS) -o $@ be_ssh.o cmdline.o cproxy.o int64.o \
logging.o misc.o pgssapi.o pinger.o portfwd.o proxy.o \
psftp.o settings.o sftp.o ssh.o sshaes.o ssharcf.o \
sshblowf.o sshbn.o sshcrc.o sshcrcda.o sshdes.o sshdh.o \
@@ -236,6 +236,11 @@ be_nos_s.o: ../be_nos_s.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(FWHACK) $(CFLAGS) $(XFLAGS) -c $<
+be_ssh.o: ../be_ssh.c ../putty.h ../puttyps.h ../network.h ../misc.h \
+ ../windows/winstuff.h ../macosx/osx.h ../unix/unix.h \
+ ../puttymem.h ../tree234.h ../windows/winhelp.h \
+ ../charset/charset.h
+ $(CC) $(COMPAT) $(FWHACK) $(CFLAGS) $(XFLAGS) -c $<
cmdgen.o: ../cmdgen.c ../putty.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../tree234.h ../int64.h \
../windows/winstuff.h ../macosx/osx.h ../unix/unix.h \
View
@@ -24,8 +24,17 @@ case "$1" in
ver=
docver=
;;
+ *pre)
+ set -- "${1%pre}" "$2"
+ case "$1" in *[!.0-9a-z~]*) echo "Malformed prerelease ID '$1'">&2;exit 1;;esac
+ case "$2" in *[!.0-9a-z~]*) echo "Malformed prerelease revision '$1'">&2;exit 1;;esac
+ autoconfver="$1~pre$2"
+ arcsuffix="-$autoconfver"
+ ver="-DPRERELEASE=$1 -DSVN_REV=$2"
+ docver="VERSION=\"PuTTY prerelease $1:r$2\""
+ ;;
*)
- case "$1" in *[!.0-9a-z]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
+ case "$1" in *[!.0-9a-z~]*) echo "Malformed release ID '$1'">&2;exit 1;;esac
arcsuffix="-$1"
ver="-DRELEASE=$1"
docver="VERSION=\"PuTTY release $1\""
View
2 RECIPE
@@ -289,7 +289,7 @@ LIBS = advapi32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib
# to proxy.c depending on whether we're crypto-avoidant or not.
BE_ALL = be_all cproxy
BE_NOSSH = be_nossh nocproxy
-BE_SSH = be_none cproxy
+BE_SSH = be_ssh cproxy
BE_NONE = be_none nocproxy
# More backend sets, with the additional Windows serial-port module.
W_BE_ALL = be_all_s winser cproxy
View
@@ -303,11 +303,11 @@ static void wprefs(void *sesskey, char *name,
for (maxlen = i = 0; i < nvals; i++) {
const char *s = val2key(mapping, nvals, array[i]);
if (s) {
- maxlen += 1 + strlen(s);
+ maxlen += (maxlen > 0 ? 1 : 0) + strlen(s);
}
}
- buf = snewn(maxlen, char);
+ buf = snewn(maxlen + 1, char);
p = buf;
for (i = 0; i < nvals; i++) {
@@ -317,7 +317,8 @@ static void wprefs(void *sesskey, char *name,
}
}
- assert(p - buf == maxlen - 1); /* maxlen counted the NUL */
+ assert(p - buf == maxlen);
+ *p = '\0';
write_setting_s(sesskey, name, buf);
View
71 SSH.C
@@ -7312,7 +7312,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
AUTH_TYPE_PUBLICKEY_OFFER_LOUD,
AUTH_TYPE_PUBLICKEY_OFFER_QUIET,
AUTH_TYPE_PASSWORD,
- AUTH_TYPE_GSSAPI,
+ AUTH_TYPE_GSSAPI, /* always QUIET */
AUTH_TYPE_KEYBOARD_INTERACTIVE,
AUTH_TYPE_KEYBOARD_INTERACTIVE_QUIET
} type;
@@ -7675,19 +7675,20 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
/*
* We have received an unequivocal Access
* Denied. This can translate to a variety of
- * messages:
- *
- * - if we'd just tried "none" authentication,
- * it's not worth printing anything at all
- *
- * - if we'd just tried a public key _offer_,
- * the message should be "Server refused our
- * key" (or no message at all if the key
- * came from Pageant)
- *
- * - if we'd just tried anything else, the
- * message really should be "Access denied".
- *
+ * messages, or no message at all.
+ *
+ * For forms of authentication which are attempted
+ * implicitly, by which I mean without printing
+ * anything in the window indicating that we're
+ * trying them, we should never print 'Access
+ * denied'.
+ *
+ * If we do print a message saying that we're
+ * attempting some kind of authentication, it's OK
+ * to print a followup message saying it failed -
+ * but the message may sometimes be more specific
+ * than simply 'Access denied'.
+ *
* Additionally, if we'd just tried password
* authentication, we should break out of this
* whole loop so as to go back to the username
@@ -7700,14 +7701,31 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
s->type == AUTH_TYPE_PUBLICKEY_OFFER_QUIET) {
if (s->type == AUTH_TYPE_PUBLICKEY_OFFER_LOUD)
c_write_str(ssh, "Server refused our key\r\n");
- logevent("Server refused public key");
+ logevent("Server refused our key");
+ } else if (s->type == AUTH_TYPE_PUBLICKEY) {
+ /* This _shouldn't_ happen except by a
+ * protocol bug causing client and server to
+ * disagree on what is a correct signature. */
+ c_write_str(ssh, "Server refused public-key signature"
+ " despite accepting key!\r\n");
+ logevent("Server refused public-key signature"
+ " despite accepting key!");
} else if (s->type==AUTH_TYPE_KEYBOARD_INTERACTIVE_QUIET) {
- /* server declined keyboard-interactive; ignore */
- } else {
+ /* quiet, so no c_write */
+ logevent("Server refused keyboard-interactive authentication");
+ } else if (s->type==AUTH_TYPE_GSSAPI) {
+ /* always quiet, so no c_write */
+ /* also, the code down in the GSSAPI block has
+ * already logged this in the Event Log */
+ } else if (s->type == AUTH_TYPE_KEYBOARD_INTERACTIVE) {
+ logevent("Keyboard-interactive authentication failed");
+ c_write_str(ssh, "Access denied\r\n");
+ } else {
+ assert(s->type == AUTH_TYPE_PASSWORD);
+ logevent("Password authentication failed");
c_write_str(ssh, "Access denied\r\n");
- logevent("Access denied");
- if (s->type == AUTH_TYPE_PASSWORD &&
- ssh->cfg.change_username) {
+
+ if (ssh->cfg.change_username) {
/* XXX perhaps we should allow
* keyboard-interactive to do this too? */
s->we_are_in = FALSE;
@@ -8056,6 +8074,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
sfree(sigdata);
ssh2_pkt_send(ssh, s->pktout);
+ logevent("Sent public key signature");
s->type = AUTH_TYPE_PUBLICKEY;
key->alg->freekey(key->data);
}
@@ -8107,6 +8126,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
ssh2_pkt_addstring(s->pktout, s->username);
ssh2_pkt_addstring(s->pktout, "ssh-connection");
ssh2_pkt_addstring(s->pktout, "gssapi-with-mic");
+ logevent("Attempting GSSAPI authentication");
/* add mechanism info */
s->gsslib->indicate_mech(s->gsslib, &s->gss_buf);
@@ -8270,6 +8290,8 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
ssh2_pkt_addstring(s->pktout, ""); /* lang */
ssh2_pkt_addstring(s->pktout, ""); /* submethods */
ssh2_pkt_send(ssh, s->pktout);
+
+ logevent("Attempting keyboard-interactive authentication");
crWaitUntilV(pktin);
if (pktin->type != SSH2_MSG_USERAUTH_INFO_REQUEST) {
@@ -8278,8 +8300,6 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
* user without actually issuing any prompts).
* Give up on it entirely. */
s->gotit = TRUE;
- if (pktin->type == SSH2_MSG_USERAUTH_FAILURE)
- logevent("Keyboard-interactive authentication refused");
s->type = AUTH_TYPE_KEYBOARD_INTERACTIVE_QUIET;
s->kbd_inter_refused = TRUE; /* don't try it again */
continue;
@@ -8391,6 +8411,13 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen,
}
ssh2_pkt_send_with_padding(ssh, s->pktout, 256);
+ /*
+ * Free the prompts structure from this iteration.
+ * If there's another, a new one will be allocated
+ * when we return to the top of this while loop.
+ */
+ free_prompts(s->cur_prompt);
+
/*
* Get the next packet in case it's another
* INFO_REQUEST.
View
@@ -4940,7 +4940,9 @@ static void do_paint(Terminal *term, Context ctx, int may_optimise)
break_run = ((tattr ^ attr) & term->attr_mask) != 0;
/* Special hack for VT100 Linedraw glyphs */
- if (tchar >= 0x23BA && tchar <= 0x23BD)
+ if ((tchar >= 0x23BA && tchar <= 0x23BD) ||
+ (j > 0 && (newline[j-1].chr >= 0x23BA &&
+ newline[j-1].chr <= 0x23BD)))
break_run = TRUE;
/*
View
@@ -167,15 +167,15 @@ plink: be_all_s.o cmdline.o cproxy.o ldisc.o logging.o misc.o pgssapi.o \
uxnoise.o uxplink.o uxproxy.o uxsel.o uxser.o uxsignal.o \
uxstore.o version.o wildcard.o x11fwd.o $(ULDFLAGS)
-pscp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
+pscp: be_ssh.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
pinger.o portfwd.o proxy.o pscp.o settings.o sftp.o ssh.o \
sshaes.o ssharcf.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
sshdes.o sshdh.o sshdss.o sshgssc.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o sshzlib.o \
time.o timing.o tree234.o uxagentc.o uxcons.o uxgss.o \
uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o uxsftp.o \
uxstore.o version.o wildcard.o x11fwd.o
- $(CC) -o $@ be_none.o cmdline.o cproxy.o int64.o logging.o misc.o \
+ $(CC) -o $@ be_ssh.o cmdline.o cproxy.o int64.o logging.o misc.o \
pgssapi.o pinger.o portfwd.o proxy.o pscp.o settings.o \
sftp.o ssh.o sshaes.o ssharcf.o sshblowf.o sshbn.o sshcrc.o \
sshcrcda.o sshdes.o sshdh.o sshdss.o sshgssc.o sshmd5.o \
@@ -184,15 +184,15 @@ pscp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
uxgss.o uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o \
uxsftp.o uxstore.o version.o wildcard.o x11fwd.o $(ULDFLAGS)
-psftp: be_none.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
+psftp: be_ssh.o cmdline.o cproxy.o int64.o logging.o misc.o pgssapi.o \
pinger.o portfwd.o proxy.o psftp.o settings.o sftp.o ssh.o \
sshaes.o ssharcf.o sshblowf.o sshbn.o sshcrc.o sshcrcda.o \
sshdes.o sshdh.o sshdss.o sshgssc.o sshmd5.o sshpubk.o \
sshrand.o sshrsa.o sshsh256.o sshsh512.o sshsha.o sshzlib.o \
time.o timing.o tree234.o uxagentc.o uxcons.o uxgss.o \
uxmisc.o uxnet.o uxnoise.o uxproxy.o uxsel.o uxsftp.o \
uxstore.o version.o wildcard.o x11fwd.o
- $(CC) -o $@ be_none.o cmdline.o cproxy.o int64.o logging.o misc.o \
+ $(CC) -o $@ be_ssh.o cmdline.o cproxy.o int64.o logging.o misc.o \
pgssapi.o pinger.o portfwd.o proxy.o psftp.o settings.o \
sftp.o ssh.o sshaes.o ssharcf.o sshblowf.o sshbn.o sshcrc.o \
sshcrcda.o sshdes.o sshdh.o sshdss.o sshgssc.o sshmd5.o \
@@ -291,6 +291,11 @@ be_nos_s.o: ../be_nos_s.c ../putty.h ../puttyps.h ../network.h ../misc.h \
../puttymem.h ../tree234.h ../windows/winhelp.h \
../charset/charset.h
$(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_nos_s.c
+be_ssh.o: ../be_ssh.c ../putty.h ../puttyps.h ../network.h ../misc.h \
+ ../windows/winstuff.h ../macosx/osx.h ../unix/unix.h \
+ ../puttymem.h ../tree234.h ../windows/winhelp.h \
+ ../charset/charset.h
+ $(CC) $(COMPAT) $(CFLAGS) $(XFLAGS) -c ../be_ssh.c
cmdgen.o: ../cmdgen.c ../putty.h ../ssh.h ../puttyps.h ../network.h \
../misc.h ../puttymem.h ../tree234.h ../int64.h \
../windows/winstuff.h ../macosx/osx.h ../unix/unix.h \
Oops, something went wrong.

0 comments on commit a37f8ef

Please sign in to comment.