diff options
author | Colin Watson <cjwatson@debian.org> | 2014-10-07 13:33:15 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-10-07 14:27:30 +0100 |
commit | f0b009aea83e9ff3a50be30f51012099a5143c16 (patch) | |
tree | 3825e6f7e3b7ea4481d06ed89aba9a7a95150df5 /regress/multiplex.sh | |
parent | 47f0bad4330b16ec3bad870fcf9839c196e42c12 (diff) | |
parent | 762c062828f5a8f6ed189ed6e44ad38fd92f8b36 (diff) |
Merge 6.7p1.
* New upstream release (http://www.openssh.com/txt/release-6.7):
- sshd(8): The default set of ciphers and MACs has been altered to
remove unsafe algorithms. In particular, CBC ciphers and arcfour* are
disabled by default. The full set of algorithms remains available if
configured explicitly via the Ciphers and MACs sshd_config options.
- ssh(1), sshd(8): Add support for Unix domain socket forwarding. A
remote TCP port may be forwarded to a local Unix domain socket and
vice versa or both ends may be a Unix domain socket (closes: #236718).
- ssh(1), ssh-keygen(1): Add support for SSHFP DNS records for ED25519
key types.
- sftp(1): Allow resumption of interrupted uploads.
- ssh(1): When rekeying, skip file/DNS lookups of the hostkey if it is
the same as the one sent during initial key exchange.
- sshd(8): Allow explicit ::1 and 127.0.0.1 forwarding bind addresses
when GatewayPorts=no; allows client to choose address family.
- sshd(8): Add a sshd_config PermitUserRC option to control whether
~/.ssh/rc is executed, mirroring the no-user-rc authorized_keys
option.
- ssh(1): Add a %C escape sequence for LocalCommand and ControlPath that
expands to a unique identifer based on a hash of the tuple of (local
host, remote user, hostname, port). Helps avoid exceeding miserly
pathname limits for Unix domain sockets in multiplexing control paths.
- sshd(8): Make the "Too many authentication failures" message include
the user, source address, port and protocol in a format similar to the
authentication success / failure messages.
- Use CLOCK_BOOTTIME in preference to CLOCK_MONOTONIC when it is
available. It considers time spent suspended, thereby ensuring
timeouts (e.g. for expiring agent keys) fire correctly (closes:
#734553).
- Use prctl() to prevent sftp-server from accessing
/proc/self/{mem,maps}.
* Restore TCP wrappers support, removed upstream in 6.7. It is true that
dropping this reduces preauth attack surface in sshd. On the other
hand, this support seems to be quite widely used, and abruptly dropping
it (from the perspective of users who don't read openssh-unix-dev) could
easily cause more serious problems in practice. It's not entirely clear
what the right long-term answer for Debian is, but it at least probably
doesn't involve dropping this feature shortly before a freeze.
* Replace patch to disable OpenSSL version check with an updated version
of Kurt Roeckx's patch from #732940 to just avoid checking the status
field.
Diffstat (limited to 'regress/multiplex.sh')
-rw-r--r-- | regress/multiplex.sh | 76 |
1 files changed, 68 insertions, 8 deletions
diff --git a/regress/multiplex.sh b/regress/multiplex.sh index 3e697e691..8ee140be6 100644 --- a/regress/multiplex.sh +++ b/regress/multiplex.sh | |||
@@ -1,10 +1,26 @@ | |||
1 | # $OpenBSD: multiplex.sh,v 1.21 2013/05/17 04:29:14 dtucker Exp $ | 1 | # $OpenBSD: multiplex.sh,v 1.25 2014/07/22 01:32:12 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | CTL=/tmp/openssh.regress.ctl-sock.$$ | 4 | CTL=/tmp/openssh.regress.ctl-sock.$$ |
5 | 5 | ||
6 | tid="connection multiplexing" | 6 | tid="connection multiplexing" |
7 | 7 | ||
8 | if have_prog nc ; then | ||
9 | if nc -h 2>&1 | grep -- -N >/dev/null; then | ||
10 | NC="nc -N"; | ||
11 | elif nc -h 2>&1 | grep -- "-U.*Use UNIX" >/dev/null ; then | ||
12 | NC="nc" | ||
13 | else | ||
14 | echo "nc is incompatible" | ||
15 | fi | ||
16 | fi | ||
17 | |||
18 | if test -z "$NC" ; then | ||
19 | echo "skipped (no compatible nc found)" | ||
20 | exit 0 | ||
21 | fi | ||
22 | |||
23 | trace "will use ProxyCommand $proxycmd" | ||
8 | if config_defined DISABLE_FD_PASSING ; then | 24 | if config_defined DISABLE_FD_PASSING ; then |
9 | echo "skipped (not supported on this platform)" | 25 | echo "skipped (not supported on this platform)" |
10 | exit 0 | 26 | exit 0 |
@@ -29,7 +45,8 @@ start_mux_master() | |||
29 | trace "start master, fork to background" | 45 | trace "start master, fork to background" |
30 | ${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ | 46 | ${SSH} -Nn2 -MS$CTL -F $OBJ/ssh_config -oSendEnv="_XXX_TEST" somehost \ |
31 | -E $TEST_REGRESS_LOGFILE 2>&1 & | 47 | -E $TEST_REGRESS_LOGFILE 2>&1 & |
32 | MASTER_PID=$! | 48 | # NB. $SSH_PID will be killed by test-exec.sh:cleanup on fatal errors. |
49 | SSH_PID=$! | ||
33 | wait_for_mux_master_ready | 50 | wait_for_mux_master_ready |
34 | } | 51 | } |
35 | 52 | ||
@@ -71,6 +88,25 @@ test -f ${COPY} || fail "scp: failed copy ${DATA}" | |||
71 | cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" | 88 | cmp ${DATA} ${COPY} || fail "scp: corrupted copy of ${DATA}" |
72 | 89 | ||
73 | rm -f ${COPY} | 90 | rm -f ${COPY} |
91 | verbose "test $tid: forward" | ||
92 | trace "forward over TCP/IP and check result" | ||
93 | $NC -l 127.0.0.1 $((${PORT} + 1)) < ${DATA} & | ||
94 | netcat_pid=$! | ||
95 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L127.0.0.1:$((${PORT} + 2)):127.0.0.1:$((${PORT} + 1)) otherhost >>$TEST_SSH_LOGFILE 2>&1 | ||
96 | $NC -d 127.0.0.1 $((${PORT} + 2)) > ${COPY} < /dev/null | ||
97 | cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" | ||
98 | kill $netcat_pid 2>/dev/null | ||
99 | rm -f ${COPY} $OBJ/unix-[123].fwd | ||
100 | |||
101 | trace "forward over UNIX and check result" | ||
102 | $NC -Ul $OBJ/unix-1.fwd < ${DATA} & | ||
103 | netcat_pid=$! | ||
104 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L$OBJ/unix-2.fwd:$OBJ/unix-1.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 | ||
105 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R$OBJ/unix-3.fwd:$OBJ/unix-2.fwd otherhost >>$TEST_SSH_LOGFILE 2>&1 | ||
106 | $NC -d -U $OBJ/unix-3.fwd > ${COPY} </dev/null | ||
107 | cmp ${DATA} ${COPY} || fail "ssh: corrupted copy of ${DATA}" | ||
108 | kill $netcat_pid 2>/dev/null | ||
109 | rm -f ${COPY} $OBJ/unix-[123].fwd | ||
74 | 110 | ||
75 | for s in 0 1 4 5 44; do | 111 | for s in 0 1 4 5 44; do |
76 | trace "exit status $s over multiplexed connection" | 112 | trace "exit status $s over multiplexed connection" |
@@ -95,7 +131,7 @@ verbose "test $tid: cmd check" | |||
95 | ${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ | 131 | ${SSH} -F $OBJ/ssh_config -S $CTL -Ocheck otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ |
96 | || fail "check command failed" | 132 | || fail "check command failed" |
97 | 133 | ||
98 | verbose "test $tid: cmd forward local" | 134 | verbose "test $tid: cmd forward local (TCP)" |
99 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $P:localhost:$PORT otherhost \ | 135 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $P:localhost:$PORT otherhost \ |
100 | || fail "request local forward failed" | 136 | || fail "request local forward failed" |
101 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ | 137 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ |
@@ -105,7 +141,7 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $P:localhost:$PORT otherhost \ | |||
105 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ | 141 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ |
106 | && fail "local forward port still listening" | 142 | && fail "local forward port still listening" |
107 | 143 | ||
108 | verbose "test $tid: cmd forward remote" | 144 | verbose "test $tid: cmd forward remote (TCP)" |
109 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $P:localhost:$PORT otherhost \ | 145 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $P:localhost:$PORT otherhost \ |
110 | || fail "request remote forward failed" | 146 | || fail "request remote forward failed" |
111 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ | 147 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ |
@@ -115,13 +151,35 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $P:localhost:$PORT otherhost \ | |||
115 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ | 151 | ${SSH} -F $OBJ/ssh_config -p$P otherhost true \ |
116 | && fail "remote forward port still listening" | 152 | && fail "remote forward port still listening" |
117 | 153 | ||
154 | verbose "test $tid: cmd forward local (UNIX)" | ||
155 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ | ||
156 | || fail "request local forward failed" | ||
157 | echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ | ||
158 | || fail "connect to local forward path failed" | ||
159 | ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -L $OBJ/unix-1.fwd:localhost:$PORT otherhost \ | ||
160 | || fail "cancel local forward failed" | ||
161 | N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l) | ||
162 | test ${N} -eq 0 || fail "local forward path still listening" | ||
163 | rm -f $OBJ/unix-1.fwd | ||
164 | |||
165 | verbose "test $tid: cmd forward remote (UNIX)" | ||
166 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oforward -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ | ||
167 | || fail "request remote forward failed" | ||
168 | echo "" | $NC -U $OBJ/unix-1.fwd | grep "Protocol mismatch" >/dev/null 2>&1 \ | ||
169 | || fail "connect to remote forwarded path failed" | ||
170 | ${SSH} -F $OBJ/ssh_config -S $CTL -Ocancel -R $OBJ/unix-1.fwd:localhost:$PORT otherhost \ | ||
171 | || fail "cancel remote forward failed" | ||
172 | N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l) | ||
173 | test ${N} -eq 0 || fail "remote forward path still listening" | ||
174 | rm -f $OBJ/unix-1.fwd | ||
175 | |||
118 | verbose "test $tid: cmd exit" | 176 | verbose "test $tid: cmd exit" |
119 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ | 177 | ${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \ |
120 | || fail "send exit command failed" | 178 | || fail "send exit command failed" |
121 | 179 | ||
122 | # Wait for master to exit | 180 | # Wait for master to exit |
123 | wait $MASTER_PID | 181 | wait $SSH_PID |
124 | kill -0 $MASTER_PID >/dev/null 2>&1 && fail "exit command failed" | 182 | kill -0 $SSH_PID >/dev/null 2>&1 && fail "exit command failed" |
125 | 183 | ||
126 | # Restart master and test -O stop command with master using -N | 184 | # Restart master and test -O stop command with master using -N |
127 | verbose "test $tid: cmd stop" | 185 | verbose "test $tid: cmd stop" |
@@ -138,6 +196,8 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Ostop otherhost >>$TEST_REGRESS_LOGFILE 2>&1 | |||
138 | # wait until both long-running command and master have exited. | 196 | # wait until both long-running command and master have exited. |
139 | wait $SLEEP_PID | 197 | wait $SLEEP_PID |
140 | [ $! != 0 ] || fail "waiting for concurrent command" | 198 | [ $! != 0 ] || fail "waiting for concurrent command" |
141 | wait $MASTER_PID | 199 | wait $SSH_PID |
142 | [ $! != 0 ] || fail "waiting for master stop" | 200 | [ $! != 0 ] || fail "waiting for master stop" |
143 | kill -0 $MASTER_PID >/dev/null 2>&1 && fail "stop command failed" | 201 | kill -0 $SSH_PID >/dev/null 2>&1 && fatal "stop command failed" |
202 | SSH_PID="" # Already gone, so don't kill in cleanup | ||
203 | |||