1# $OpenBSD: proto-version.sh,v 1.7 2017/06/07 01:48:15 djm Exp $ 2# Placed in the Public Domain. 3 4tid="sshd version with different protocol combinations" 5 6# we just start sshd in inetd mode and check the banner 7check_version () 8{ 9 expect=$1 10 banner=`printf '' | ${SSHD} -i -f ${OBJ}/sshd_proxy` 11 case ${banner} in 12 SSH-1.99-*) 13 proto=199 14 ;; 15 SSH-2.0-*) 16 proto=20 17 ;; 18 SSH-1.5-*) 19 proto=15 20 ;; 21 *) 22 proto=0 23 ;; 24 esac 25 if [ ${expect} -ne ${proto} ]; then 26 fail "wrong protocol version ${banner}" 27 fi 28} 29 30check_version 20 31