2015-03-03 22:35:19 +00:00
|
|
|
# $OpenBSD: proto-version.sh,v 1.5 2015/03/03 22:35:19 markus Exp $
|
2002-05-01 03:17:33 +00:00
|
|
|
# Placed in the Public Domain.
|
|
|
|
|
|
|
|
tid="sshd version with different protocol combinations"
|
|
|
|
|
|
|
|
# we just start sshd in inetd mode and check the banner
|
|
|
|
check_version ()
|
|
|
|
{
|
|
|
|
version=$1
|
|
|
|
expect=$2
|
2013-05-17 03:28:36 +00:00
|
|
|
banner=`printf '' | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy`
|
2002-05-01 03:17:33 +00:00
|
|
|
case ${banner} in
|
|
|
|
SSH-1.99-*)
|
|
|
|
proto=199
|
|
|
|
;;
|
|
|
|
SSH-2.0-*)
|
|
|
|
proto=20
|
|
|
|
;;
|
|
|
|
SSH-1.5-*)
|
|
|
|
proto=15
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
proto=0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if [ ${expect} -ne ${proto} ]; then
|
|
|
|
fail "wrong protocol version ${banner} for ${version}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
check_version 2 20
|
2015-03-03 22:35:19 +00:00
|
|
|
if ssh_version 1; then
|
|
|
|
check_version 2,1 199
|
|
|
|
check_version 1,2 199
|
|
|
|
check_version 1 15
|
|
|
|
fi
|