Some notable changes, from upstream's release notes: - sshd(8): Remove support for obsolete "host/port" syntax. - ssh(1): When prompting whether to record a new host key, accept the key fingerprint as a synonym for "yes". - ssh-keygen(1): when acting as a CA and signing certificates with an RSA key, default to using the rsa-sha2-512 signature algorithm. - ssh(1), sshd(8), ssh-keygen(1): this release removes the "ssh-rsa" (RSA/SHA1) algorithm from those accepted for certificate signatures. - ssh-sk-helper(8): this is a new binary. It is used by the FIDO/U2F support to provide address-space isolation for token middleware libraries (including the internal one). - ssh(1): this release enables UpdateHostkeys by default subject to some conservative preconditions. - scp(1): this release changes the behaviour of remote to remote copies (e.g. "scp host-a:/path host-b:") to transfer through the local host by default. - scp(1): experimental support for transfers using the SFTP protocol as a replacement for the venerable SCP/RCP protocol that it has traditionally used. Additional integration work is needed to support FIDO/U2F in the base system. Deprecation Notice ------------------ OpenSSH will disable the ssh-rsa signature scheme by default in the next release. Reviewed by: imp MFC after: 1 month Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29985
77 lines
2.3 KiB
Bash
77 lines
2.3 KiB
Bash
# $OpenBSD: integrity.sh,v 1.24 2020/01/21 08:06:27 djm Exp $
|
|
# Placed in the Public Domain.
|
|
|
|
tid="integrity"
|
|
cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
|
|
|
|
# start at byte 2900 (i.e. after kex) and corrupt at different offsets
|
|
tries=10
|
|
startoffset=2900
|
|
macs=`${SSH} -Q mac`
|
|
# The following are not MACs, but ciphers with integrated integrity. They are
|
|
# handled specially below.
|
|
macs="$macs `${SSH} -Q cipher-auth`"
|
|
|
|
# avoid DH group exchange as the extra traffic makes it harder to get the
|
|
# offset into the stream right.
|
|
#echo "KexAlgorithms -diffie-hellman-group*" \
|
|
# >> $OBJ/ssh_proxy
|
|
|
|
# sshd-command for proxy (see test-exec.sh)
|
|
cmd="$SUDO env SSH_SK_HELPER="$SSH_SK_HELPER" sh ${SRC}/sshd-log-wrapper.sh ${TEST_SSHD_LOGFILE} ${SSHD} -i -f $OBJ/sshd_proxy"
|
|
|
|
for m in $macs; do
|
|
trace "test $tid: mac $m"
|
|
elen=0
|
|
epad=0
|
|
emac=0
|
|
etmo=0
|
|
ecnt=0
|
|
skip=0
|
|
for off in `jot $tries $startoffset`; do
|
|
skip=`expr $skip - 1`
|
|
if [ $skip -gt 0 ]; then
|
|
# avoid modifying the high bytes of the length
|
|
continue
|
|
fi
|
|
cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
|
|
# modify output from sshd at offset $off
|
|
pxy="proxycommand=$cmd | $OBJ/modpipe -wm xor:$off:1"
|
|
if ${SSH} -Q cipher-auth | grep "^${m}\$" >/dev/null 2>&1 ; then
|
|
echo "Ciphers=$m" >> $OBJ/sshd_proxy
|
|
macopt="-c $m"
|
|
else
|
|
echo "Ciphers=aes128-ctr" >> $OBJ/sshd_proxy
|
|
echo "MACs=$m" >> $OBJ/sshd_proxy
|
|
macopt="-m $m -c aes128-ctr"
|
|
fi
|
|
verbose "test $tid: $m @$off"
|
|
${SSH} $macopt -F $OBJ/ssh_proxy -o "$pxy" \
|
|
-oServerAliveInterval=1 -oServerAliveCountMax=30 \
|
|
999.999.999.999 'printf "%4096s" " "' >/dev/null
|
|
if [ $? -eq 0 ]; then
|
|
fail "ssh -m $m succeeds with bit-flip at $off"
|
|
fi
|
|
ecnt=`expr $ecnt + 1`
|
|
out=$(egrep -v "^debug" $TEST_SSH_LOGFILE | tail -2 | \
|
|
tr -s '\r\n' '.')
|
|
case "$out" in
|
|
Bad?packet*) elen=`expr $elen + 1`; skip=3;;
|
|
Corrupted?MAC* | *message?authentication?code?incorrect*)
|
|
emac=`expr $emac + 1`; skip=0;;
|
|
padding*) epad=`expr $epad + 1`; skip=0;;
|
|
*Timeout,?server*)
|
|
etmo=`expr $etmo + 1`; skip=0;;
|
|
*) fail "unexpected error mac $m at $off: $out";;
|
|
esac
|
|
done
|
|
verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen timeout $etmo"
|
|
if [ $emac -eq 0 ]; then
|
|
fail "$m: no mac errors"
|
|
fi
|
|
expect=`expr $ecnt - $epad - $elen - $etmo`
|
|
if [ $emac -ne $expect ]; then
|
|
fail "$m: expected $expect mac errors, got $emac"
|
|
fi
|
|
done
|