p += sizeof("pair_legacy_nested") - 1;
out = &fr_pair_legacy_nested;
- } else if (strncmp(p, "pair_legacy_print_nested", sizeof("pair_legacy_print_nested") - 1) == 0) {
- p += sizeof("pair_legacy_print_nested") - 1;
- out = &fr_pair_legacy_print_nested;
-
} else {
fr_strerror_const("Unknown migration flag");
RETURN_PARSE_ERROR(0);
goto cleanup;
}
+ fr_pair_legacy_nested = true; /* force migration flags */
+
if (receipt_file && (fr_unlink(receipt_file) < 0)) {
fr_perror("unit_test_attribute");
EXIT_WITH_FAILURE;
# @todo - future - we arguably want to force nesting on these attributes? Or change the nesting when printed?
#
read_file files/cisco_avpair.txt
-match User-Name = "bob", User-Password = "hello", Vendor-Specific.Cisco.AVPair = "1", Vendor-Specific.Cisco.AVPair += "2", Vendor-Specific.Cisco.AVPair += "3", Vendor-Specific.Cisco.AVPair += "4"
-
-# nested
-#match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
+match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
#
# Relative attributes, all on the same line.
#
read_file files/cisco_relative.txt
-match User-Name = "bob", User-Password = "hello", Vendor-Specific.Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" }
-
-# nested
-#match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
+match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
#
# Relative attributes, each on a different line
#
read_file files/cisco_multiline_relative.txt
-match User-Name = "bob", User-Password = "hello", Vendor-Specific.Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" }
-
-# nested
-#match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
+match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
#
# Multiple Cisco AVPAir, all on one line
#
read_file files/cisco_single_line.txt
-match User-Name = "bob", User-Password = "hello", Vendor-Specific.Cisco.AVPair = "1", Vendor-Specific.Cisco.AVPair += "2", Vendor-Specific.Cisco.AVPair += "3", Vendor-Specific.Cisco.AVPair += "4"
-
-# nested
-#match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
+match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
count
match 9
#
proto-dictionary radius
-migrate pair_legacy_nested = yes
#
# Fully specified paths.
match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
count
-match 10
+match 9
proto-dictionary radius
-#
-# The same as "file.txt", but where we set a migration flag which prints flat attributes as nested.
-#
-migrate pair_legacy_print_nested = true
-
#
# Fully specified paths.
#
-# @todo - we arguably want to force nesting on these attributes? Or change the nesting when printed?
-#
read_file files/cisco_avpair.txt
match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
match User-Name = "bob", User-Password = "hello", Vendor-Specific = { Cisco = { AVPair = "1", AVPair += "2", AVPair += "3", AVPair += "4" } }
count
-match 10
+match 9
proto-dictionary dhcpv4
fuzzer-out dhcpv4
-migrate pair_legacy_nested=true
-
#
# When the caller gives us flat lists, we create nested ones.
#
match V-I-Vendor-Specific = { raw.Cisco = 0x09050661612e747874 }
count
-match 20
+match 19
# Only run the tests if we have TLS support
need-feature tls
-
# Load the EAP-AKA/SIM encoder/decoder
proto eap-aka-sim
proto-dictionary eap-aka-sim eap/aka-sim
+migrate pair_legacy_nested = false
+
# Boolean attribute
encode-pair.sim_tp_encode Any-ID-Req = yes
match 0d 01 00 00
match 81 05 00 00 cd f7 ff a6 5d e0 4c 02 6b 56 c8 6b 76 b1 02 ea 82 05 00 00 b6 ed d3 82 79 e2 a1 42 3c 1a fc 5c 45 5c 7d 56
count
-match 62
+match 63
proto eap-aka-sim
proto-dictionary eap-aka-sim eap/aka-sim
+migrate pair_legacy_nested = false
+
# Encr-Data attributes should not be split between multiple outer TLVs (regression test)
encode-pair.sim_tp_encode_rfc4186 IV = 0xd585ac7786b90336657c77b46575b9c4, Encr-Data.Next-Reauth-ID = "8osafwilQBCdof4", Encr-Data.Next-Pseudonym = "7QSzGAfgFKU8De9", Encr-Data.Nonce-S = 0xd61d1c6124106953f6f7283ae680a5ed, Encr-Data.Counter = 1
match 81 05 00 00 d5 85 ac 77 86 b9 03 36 65 7c 77 b4 65 75 b9 c4 82 11 00 00 6e a1 2b 5c d1 57 fa fc be a9 c9 7c ad 30 07 ff 72 dc cb c8 a9 96 b3 33 1f 71 aa 06 bb f0 1d 04 6b 51 9e fa 83 31 11 67 c6 93 1e 9c 06 5c 1f 2c 62 0d 1d 6d b0 b1 59 2f 91 f1 56 98 a9 e2 dc 3c
match 04 01 01 2c 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 36 37 38 39
encode-pair Extended-Attribute-1.Unit-Ext-241-TLV.Unit-TLV-Integer = 1, Extended-Attribute-1.Unit-Ext-241-TLV.Unit-TLV-Integer = 2
-match 00 f1 0a 00 f3 07 00 01 04 00 00 00 01 00 f1 0a 00 f3 07 00 01 04 00 00 00 02
+match 00 f1 11 00 f3 0e 00 01 04 00 00 00 01 00 01 04 00 00 00 02
+
+decode-pair -
+match Extended-Attribute-1 = { Unit-Ext-241-TLV = { Unit-TLV-Integer = 1, Unit-TLV-Integer = 2 } }
+
+count
+match 10
proto-dictionary radius
fuzzer-out radius
-migrate pair_legacy_nested = true
-
#
# Time delta in milliseconds.
#
match Unit-TLV = { Delta-MSec-int32 = 2147483647 }
count
-match 66
+match 65
proto-dictionary radius
fuzzer-out radius
-migrate pair_legacy_nested = true
-
#
# And using the dictionaries
#
match Unit-TLV = { Milliseconds = "2019-08-21T03:40:31.123Z" }
count
-match 36
+match 35
proto-dictionary radius
fuzzer-out radius
-migrate pair_legacy_nested=true
-
#
# Test vectors for WiMAX attributes.
#
count
-match 148
+match 147
proto-dictionary tacacs
fuzzer-out tacacs
+migrate pair_legacy_nested = false
+
# ./pam_tacplus/tacc -TRA -u bob -p hello -s 172.17.0.2 -r 1.1.1.1 -k testing123 -S ppp -P ip -L pap
# N.B. decrypted and unencrypted flag has been set
match Argument 3 length 32 overflows packet
count
-match 29
+match 30
proto-dictionary tacacs
fuzzer-out tacacs
+migrate pair_legacy_nested = false
+
#
# Authorization - Response: (Client <- Server)
#
match c0 02 02 04 e1 66 78 e6 00 00 00 13 02 59 f9 90 38 81 e1 bb 9d a6 13 93 fc 86 7e 4a 14 1c 24
count
-match 5
+match 6