diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2020-08-28 03:17:13 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2020-09-09 13:12:29 +1000 |
commit | 9afe2a150893b20bdf9eab764978d817b9a7b783 (patch) | |
tree | ca47ce2b11d1a417debbe8e6e95d97f18b956bfb | |
parent | c76773524179cb654ff838dd43ba1ddb155bafaa (diff) |
upstream: Ensure that address/mask mismatches are flagged at
config-check time. ok djm@
OpenBSD-Regress-ID: 8f5f4c2c0bf00e6ceae7a1755a444666de0ea5c2
-rw-r--r-- | regress/addrmatch.sh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/regress/addrmatch.sh b/regress/addrmatch.sh index e7d29c3f3..26e0c9910 100644 --- a/regress/addrmatch.sh +++ b/regress/addrmatch.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: addrmatch.sh,v 1.5 2020/03/13 03:18:45 djm Exp $ | 1 | # $OpenBSD: addrmatch.sh,v 1.6 2020/08/28 03:17:13 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="address match" | 4 | tid="address match" |
@@ -52,5 +52,17 @@ run_trial user ::5 somehost ::1 1234 match3 "IP6 localaddress" | |||
52 | run_trial user ::5 somehost ::2 5678 match4 "IP6 localport" | 52 | run_trial user ::5 somehost ::2 5678 match4 "IP6 localport" |
53 | fi | 53 | fi |
54 | 54 | ||
55 | # | ||
56 | # Check that we catch invalid address/mask in Match Address/Localaddress | ||
57 | # | ||
58 | for i in 10.0.1.0/8 10.0.0.1/24 2000:aa:bb:01::/56; do | ||
59 | for a in address localaddress; do | ||
60 | verbose "test invalid Match $a $i" | ||
61 | echo "Match $a $i" > $OBJ/sshd_proxy | ||
62 | ${SUDO} ${SSHD} -f $OBJ/sshd_proxy -t >/dev/null 2>&1 && \ | ||
63 | fail "accepted invalid match $a $i" | ||
64 | done | ||
65 | done | ||
66 | |||
55 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy | 67 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
56 | rm $OBJ/sshd_proxy_bak | 68 | rm $OBJ/sshd_proxy_bak |