blob: 1f33b1f00b773af7b77b11a8bde64503d4af63e9 [file] [log] [blame]
djm@openbsd.org1de5e472017-06-07 01:48:15 +00001# $OpenBSD: proto-version.sh,v 1.7 2017/06/07 01:48:15 djm Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# 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{
djm@openbsd.org1de5e472017-06-07 01:48:15 +00009 expect=$1
djm@openbsd.orgdd369322017-04-30 23:34:55 +000010 banner=`printf '' | ${SSHD} -i -f ${OBJ}/sshd_proxy`
Damien Miller38cd4352002-05-01 13:17:33 +100011 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
djm@openbsd.orgdd369322017-04-30 23:34:55 +000026 fail "wrong protocol version ${banner}"
Damien Miller38cd4352002-05-01 13:17:33 +100027 fi
28}
29
djm@openbsd.orgdd369322017-04-30 23:34:55 +000030check_version 20