]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move tests around and add some more tests
authorAlan T. DeKok <aland@freeradius.org>
Tue, 29 Oct 2019 01:44:15 +0000 (21:44 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 29 Oct 2019 01:44:15 +0000 (21:44 -0400)
src/tests/unit/dhcpv6.txt
src/tests/unit/dhcpv6_rfc3315.txt
src/tests/unit/dhcpv6_rfc6355.txt

index f399bcc1f078c45d8425b673c330b80469f28f90..86c53027c6adcee741167d92363765d6d4d6a624 100644 (file)
@@ -179,18 +179,6 @@ match 00 21 00 22 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 03 66 74 70
 encode-pair BCMCS-Server-Domain-Name-List = "www.example.com", BCMCS-Server-Domain-Name-List = "ftp.example.com", BCMCS-Server-Domain-Name-List = "ns.example.com"
 match 00 21 00 32 03 77 77 77 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 03 66 74 70 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00 02 6e 73 07 65 78 61 6d 70 6c 65 03 63 6f 6d 00
 
-encode-pair Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f
-match 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
-
-#
-#  UUID-Value field is 16 octets.  So we truncate if if it's too long, and pad it with zeros if it's too short.
-#
-encode-pair Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f1112
-match 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
-
-encode-pair Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d
-match 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 00 00
-
 #
 #  Microsoft VSAs. We have no idea what the contents are, and the documentation doesn't say.
 #
@@ -200,4 +188,4 @@ encode-pair Microsoft-Rogue-Detection-Request = 0x00
 match 00 11 00 09 00 00 01 37 00 5e 00 01 00
 
 count
-match 88
+match 82
index 6ae82b34a1d7e8b02707f444cafb1883268be8d6..be66c7854836107ef35b875cd47c6a7b1de15e2d 100644 (file)
@@ -14,32 +14,7 @@ dictionary-load dhcpv6
 #  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 #
 
-#
-#  @rfc6355
-#
-#  4.  DUID-UUID Format
-#
-#  The DUID-UUID is carried within Client Identifier or Server
-#  Identifier options.  It has the following format:
-#
-#  0                   1                   2                   3
-#  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
-#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-#  |          DUID-Type (4)        |    UUID (128 bits)            |
-#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
-#  |                                                               |
-#  |                                                               |
-#  |                                -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-#  |                                |
-#  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
-#
-#  Figure 1: DUID-UUID Format
-#
-#  DUID-Type -  DUID-UUID (4) - (16 bits)
-#  UUID -  An [RFC4122] UUID (128 bits)
-
-#
-#  @rfc3315
+#  From RFC 3315
 #
 #  9.2. DUID Based on Link-layer Address Plus Time [DUID-LLT]
 #
@@ -153,3 +128,6 @@ match 00 02 00 0a 00 03 00 02 d3 4d 00 c0 ff ee
 
 decode-pair -
 match Server-ID-DUID = Server-ID-DUID-LL, Server-ID-DUID-LL-Hardware-Type = 2, Server-ID-DUID-LL-Address = 0xd34d00c0ffee
+
+count
+match 26
index 0570549804808628b44b402c1ccbb1d6c032ba85..017ac2ac683b44da11f3fad71894db900a80f10e 100644 (file)
@@ -47,3 +47,26 @@ match 00 01 00 02 00 04
 
 decode-pair -
 match Client-ID-DUID = Client-ID-DUID-UUID
+
+#  Encode a 16-octet UUID
+encode-pair Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f
+match 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
+
+#  UUID-Value field is 16 octets.  So we truncate if if it's too long, and pad it with zeros if it's too short.
+encode-pair Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f1112
+match 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
+
+#  But if we decode something that's too long, we ignore the extra data
+decode-pair -
+match Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d0e0f
+
+#  Or we pad the UUID to 16 octets if it's too short
+encode-pair Client-ID-DUID = Client-ID-DUID-UUID, Client-ID-DUID-UUID-Value = 0x000102030405060708090a0b0c0d
+match 00 01 00 12 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 00 00
+
+#  And if we see something that's too short, we get a bad attribute.
+decode-pair 00 01 00 10 00 04 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d
+match Client-ID-DUID = Client-ID-DUID-UUID, Attr-1.1.4 = 0x000102030405060708090a0b0c0d
+
+count
+match 16