From a25ab018459dc366061ac98086705c561b856a19 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 7 Oct 2009 11:00:58 +1100 Subject: [PATCH] - (dtucker) [regress/portnum.sh] Import new test. --- ChangeLog | 1 + regress/portnum.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 regress/portnum.sh diff --git a/ChangeLog b/ChangeLog index 824bca846..e6a21cf7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -116,6 +116,7 @@ - dtucker@cvs.openbsd.org 2009/10/06 23:51:49 [regress/ssh2putty.sh] Add OpenBSD tag to make syncs easier + - (dtucker) [regress/portnum.sh] Import new test. 20091002 - (djm) [Makefile.in] Mention readconf.o in ssh-keysign's make deps. diff --git a/regress/portnum.sh b/regress/portnum.sh new file mode 100644 index 000000000..82abbc9f0 --- /dev/null +++ b/regress/portnum.sh @@ -0,0 +1,32 @@ +# $OpenBSD: portnum.sh,v 1.1 2009/08/13 00:57:17 djm Exp $ +# Placed in the Public Domain. + +tid="port number parsing" + +badport() { + port=$1 + verbose "$tid: invalid port $port" + if ${SSH} -F $OBJ/ssh_proxy -p $port somehost true 2>/dev/null ; then + fail "$tid accepted invalid port $port" + fi +} +goodport() { + port=$1 + verbose "$tid: valid port $port" + if ! ${SSH} -F $OBJ/ssh_proxy -p $port somehost true 2>/dev/null ; then + fail "$tid rejected valid port $port" + fi +} + +badport 0 +badport 65536 +badport 131073 +badport 2000blah +badport blah2000 + +goodport 1 +goodport 22 +goodport 2222 +goodport 22222 +goodport 65535 +