diff options
author | 2009-08-13 00:57:17 +0000 | |
---|---|---|
committer | 2009-08-13 00:57:17 +0000 | |
commit | 032780dc98c853d2a0eb27d9966b31dd02eef02d (patch) | |
tree | cbedc23f9ec9562656c69ba2706ae564a1ff8c61 | |
parent | add modinst to CONFIGURE_STYLE list (diff) | |
download | wireguard-openbsd-032780dc98c853d2a0eb27d9966b31dd02eef02d.tar.xz wireguard-openbsd-032780dc98c853d2a0eb27d9966b31dd02eef02d.zip |
regression test for port number parsing. written as part of the a2port
change that went into 5.2 but I forgot to commit it at the time...
-rw-r--r-- | regress/usr.bin/ssh/Makefile | 5 | ||||
-rw-r--r-- | regress/usr.bin/ssh/portnum.sh | 32 |
2 files changed, 35 insertions, 2 deletions
diff --git a/regress/usr.bin/ssh/Makefile b/regress/usr.bin/ssh/Makefile index 3ade8c907f7..c2dcc7a45e3 100644 --- a/regress/usr.bin/ssh/Makefile +++ b/regress/usr.bin/ssh/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.48 2008/06/28 13:57:25 djm Exp $ +# $OpenBSD: Makefile,v 1.49 2009/08/13 00:57:17 djm Exp $ REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 @@ -42,7 +42,8 @@ LTESTS= connect \ cfgmatch \ addrmatch \ localcommand \ - forcecommand + forcecommand \ + portnum INTEROP_TESTS= putty-transfer putty-ciphers putty-kex conch-ciphers #INTEROP_TESTS+=ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp diff --git a/regress/usr.bin/ssh/portnum.sh b/regress/usr.bin/ssh/portnum.sh new file mode 100644 index 00000000000..82abbc9f0d6 --- /dev/null +++ b/regress/usr.bin/ssh/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 + |