]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
break out some more test cases for clarity
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Apr 2022 19:11:38 +0000 (15:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Apr 2022 13:15:19 +0000 (09:15 -0400)
src/tests/unit/protocols/radius/packet_rfc3162.txt

index 14f58382ab3eea496f1516305e6680439be4d8ef..4f9969289abcbacc93dc16fa3781eb9d0c07c71a 100644 (file)
@@ -13,6 +13,36 @@ proto radius
 proto-dictionary radius
 fuzzer-out radius
 
+#
+#  one byte is too short for reserved + prefix
+#
+decode-pair 61 03 00
+match raw.Framed-IPv6-Prefix = 0x00
+
+#
+#  This is 0/0
+#
+decode-pair 61 04 00 00
+match Framed-IPv6-Prefix = ::/0
+
+#
+#  Omitting bytes outside of the prefix length
+#
+decode-pair 61 0c 00 40 20 01 0d b8 0a 0b 12 f0
+match Framed-IPv6-Prefix = 2001:db8:a0b:12f0::/64
+
+#
+#  Same as above, but the trailing bytes are zero.
+#
+decode-pair 61 14 00 40 20 01 0d b8 0a 0b 12 f0 00 00 00 00 00 00 00 00
+match Framed-IPv6-Prefix = 2001:db8:a0b:12f0::/64
+
+#
+#  trailing bytes outside of the prefix exist, but are not zero
+#
+decode-pair 61 14 00 40 20 01 0d b8 0a 0b 12 f0 00 00 00 00 00 00 00 01
+match raw.Framed-IPv6-Prefix = 0x004020010db80a0b12f00000000000000001
+
 #
 #  1.
 #
@@ -68,4 +98,4 @@ decode-proto -
 match Packet-Type = Access-Request, Packet-Authentication-Vector = 0x2afdb090418ac6365298fbbb15e0fd2e, User-Name = "bob", User-Password = "hello", NAS-IPv6-Address = 2001:db8:a0b:12f0::1, Framed-IPv6-Prefix = 2001:db8:a0b:12f0::/64, Framed-IPv6-Prefix = 2001:db8:a0b:12f0::/64, Framed-IPv6-Prefix = ::/0, raw.Framed-IPv6-Prefix = 0x00, raw.Framed-IPv6-Prefix = 0x004020010db80a0b12f0000000000000000000, raw.Framed-IPv6-Prefix = 0x008120010db80a0b12f00000000000000001
 
 count
-match 9
+match 19