diff options
Diffstat (limited to 'debian/patches/fix-putty-interop-tests.patch')
-rw-r--r-- | debian/patches/fix-putty-interop-tests.patch | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/debian/patches/fix-putty-interop-tests.patch b/debian/patches/fix-putty-interop-tests.patch new file mode 100644 index 000000000..c33c24acc --- /dev/null +++ b/debian/patches/fix-putty-interop-tests.patch | |||
@@ -0,0 +1,113 @@ | |||
1 | From 9c88f6248e9da14cb7916527862f2eac7f55b12a Mon Sep 17 00:00:00 2001 | ||
2 | From: Colin Watson <cjwatson@debian.org> | ||
3 | Date: Sat, 19 Nov 2016 16:02:49 +0000 | ||
4 | Subject: Fix PuTTY interop tests | ||
5 | |||
6 | A while back I got a patch into PuTTY (although it hasn't yet made it | ||
7 | into an upstream release) to add passphrase-file options to puttygen. | ||
8 | Use these to make the PuTTY interop tests non-interactive. | ||
9 | |||
10 | Fix up a few details of the saved session. | ||
11 | |||
12 | When plink is given a saved session name, it expects that *instead* of | ||
13 | the host name (or IP address), not in addition to it. Drop "127.0.0.1" | ||
14 | from the various plink test command lines. | ||
15 | |||
16 | (It is possible that the last two of these represent compatibility | ||
17 | breaks of some kind; but if they are, then that ship sailed sufficiently | ||
18 | long ago - at least seven years, possibly more - that it's no longer | ||
19 | worth worrying about it. It's more useful to test interoperability with | ||
20 | current versions.) | ||
21 | |||
22 | Origin: https://bugzilla.mindrot.org/attachment.cgi?id=2891 | ||
23 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=2639 | ||
24 | Last-Update: 2016-11-19 | ||
25 | |||
26 | Patch-Name: fix-putty-interop-tests.patch | ||
27 | --- | ||
28 | regress/putty-ciphers.sh | 2 +- | ||
29 | regress/putty-kex.sh | 3 +-- | ||
30 | regress/putty-transfer.sh | 4 ++-- | ||
31 | regress/test-exec.sh | 10 ++++++++-- | ||
32 | 4 files changed, 12 insertions(+), 7 deletions(-) | ||
33 | |||
34 | diff --git a/regress/putty-ciphers.sh b/regress/putty-ciphers.sh | ||
35 | index 724a98c..3775b1d 100644 | ||
36 | --- a/regress/putty-ciphers.sh | ||
37 | +++ b/regress/putty-ciphers.sh | ||
38 | @@ -16,7 +16,7 @@ for c in aes blowfish 3des arcfour aes128-ctr aes192-ctr aes256-ctr ; do | ||
39 | |||
40 | rm -f ${COPY} | ||
41 | env HOME=$PWD ${PLINK} -load cipher_$c -batch -i putty.rsa2 \ | ||
42 | - 127.0.0.1 cat ${DATA} > ${COPY} | ||
43 | + cat ${DATA} > ${COPY} | ||
44 | if [ $? -ne 0 ]; then | ||
45 | fail "ssh cat $DATA failed" | ||
46 | fi | ||
47 | diff --git a/regress/putty-kex.sh b/regress/putty-kex.sh | ||
48 | index 1844d65..6ae2290 100644 | ||
49 | --- a/regress/putty-kex.sh | ||
50 | +++ b/regress/putty-kex.sh | ||
51 | @@ -14,8 +14,7 @@ for k in dh-gex-sha1 dh-group1-sha1 dh-group14-sha1 ; do | ||
52 | ${OBJ}/.putty/sessions/kex_$k | ||
53 | echo "KEX=$k" >> ${OBJ}/.putty/sessions/kex_$k | ||
54 | |||
55 | - env HOME=$PWD ${PLINK} -load kex_$k -batch -i putty.rsa2 \ | ||
56 | - 127.0.0.1 true | ||
57 | + env HOME=$PWD ${PLINK} -load kex_$k -batch -i putty.rsa2 true | ||
58 | if [ $? -ne 0 ]; then | ||
59 | fail "KEX $k failed" | ||
60 | fi | ||
61 | diff --git a/regress/putty-transfer.sh b/regress/putty-transfer.sh | ||
62 | index aec0e04..cb1da94 100644 | ||
63 | --- a/regress/putty-transfer.sh | ||
64 | +++ b/regress/putty-transfer.sh | ||
65 | @@ -17,7 +17,7 @@ for p in 2; do | ||
66 | ${OBJ}/.putty/sessions/compression_$c | ||
67 | echo "Compression=$c" >> ${OBJ}/.putty/sessions/kex_$k | ||
68 | env HOME=$PWD ${PLINK} -load compression_$c -batch \ | ||
69 | - -i putty.rsa$p 127.0.0.1 cat ${DATA} > ${COPY} | ||
70 | + -i putty.rsa$p cat ${DATA} > ${COPY} | ||
71 | if [ $? -ne 0 ]; then | ||
72 | fail "ssh cat $DATA failed" | ||
73 | fi | ||
74 | @@ -28,7 +28,7 @@ for p in 2; do | ||
75 | rm -f ${COPY} | ||
76 | dd if=$DATA obs=${s} 2> /dev/null | \ | ||
77 | env HOME=$PWD ${PLINK} -load compression_$c \ | ||
78 | - -batch -i putty.rsa$p 127.0.0.1 \ | ||
79 | + -batch -i putty.rsa$p \ | ||
80 | "cat > ${COPY}" | ||
81 | if [ $? -ne 0 ]; then | ||
82 | fail "ssh cat $DATA failed" | ||
83 | diff --git a/regress/test-exec.sh b/regress/test-exec.sh | ||
84 | index 1b6526d..74b365c 100644 | ||
85 | --- a/regress/test-exec.sh | ||
86 | +++ b/regress/test-exec.sh | ||
87 | @@ -513,7 +513,11 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then | ||
88 | |||
89 | # Add a PuTTY key to authorized_keys | ||
90 | rm -f ${OBJ}/putty.rsa2 | ||
91 | - puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null | ||
92 | + if ! puttygen -t rsa -o ${OBJ}/putty.rsa2 \ | ||
93 | + --new-passphrase /dev/null < /dev/null > /dev/null; then | ||
94 | + echo "Your installed version of PuTTY is too old to support --new-passphrase; trying without (may require manual interaction) ..." >&2 | ||
95 | + puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null | ||
96 | + fi | ||
97 | puttygen -O public-openssh ${OBJ}/putty.rsa2 \ | ||
98 | >> $OBJ/authorized_keys_$USER | ||
99 | |||
100 | @@ -526,10 +530,12 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then | ||
101 | # Setup proxied session | ||
102 | mkdir -p ${OBJ}/.putty/sessions | ||
103 | rm -f ${OBJ}/.putty/sessions/localhost_proxy | ||
104 | - echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
105 | + echo "Protocol=ssh" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
106 | + echo "HostName=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
107 | echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
108 | echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
109 | echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
110 | + echo "ProxyLocalhost=1" >> ${OBJ}/.putty/sessions/localhost_proxy | ||
111 | |||
112 | REGRESS_INTEROP_PUTTY=yes | ||
113 | fi | ||