Skip to content

Commit

Permalink
hoist setting of "is raw" out of protocol decoders
Browse files Browse the repository at this point in the history
and into the dictionary code so it's more centralized.

Another side effect is that unknown attributes are now always
"raw".  Which is likely what we should always have done anyways
  • Loading branch information
alandekok committed Sep 8, 2023
1 parent 83dedf4 commit 4164089
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 31 deletions.
1 change: 0 additions & 1 deletion src/lib/eap_aka_sim/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ static ssize_t sim_decode_pair_value(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_di
fr_strerror_printf_push("%s[%d]: Internal sanity check failed", __FUNCTION__, __LINE__);
return -1;
}
unknown->flags.is_raw = 1;
}

vp = fr_pair_afrom_da(ctx, parent);
Expand Down
1 change: 0 additions & 1 deletion src/lib/util/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ ssize_t fr_pair_raw_from_network(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_a
*/
unknown = fr_dict_unknown_attr_afrom_da(ctx, parent);
if (!unknown) return -1;
unknown->flags.is_raw = 1;

vp = fr_pair_afrom_da(ctx, unknown); /* makes a copy of 'unknown' */
child = unknown;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/util/dict_unknown.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ static fr_dict_attr_t *dict_unknown_alloc(TALLOC_CTX *ctx, fr_dict_attr_t const
* which we know to be correct.
*/
flags.is_unknown = 1;
flags.is_raw = 1;
flags.array = 0;
flags.has_value = 0;
if (type != FR_TYPE_VENDOR) {
Expand Down Expand Up @@ -340,6 +341,7 @@ fr_dict_attr_t *fr_dict_unknown_attr_afrom_num(TALLOC_CTX *ctx, fr_dict_attr_t c
{
fr_dict_attr_flags_t flags = {
.is_unknown = true,
.is_raw = true,
.internal = parent->flags.internal,
};

Expand Down
6 changes: 0 additions & 6 deletions src/lib/util/dict_validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,

// is_root
// is_unknown
// is_raw
// internal
// array
// has_value
Expand All @@ -87,11 +86,6 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,
return false;
}

if (flags->is_raw) {
fr_strerror_const("The 'raw' flag cannot be set for attributes in the dictionary.");
return false;
}

/*
* Only some data types can be in arrays, because we need
* to be able to decode the various array members.
Expand Down
1 change: 0 additions & 1 deletion src/protocols/radius/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ static ssize_t decode_extended(TALLOC_CTX *ctx, fr_pair_list_t *out,
unknown = fr_dict_unknown_attr_afrom_num(packet_ctx->tmp_ctx, da, data[2]);
if (!unknown) return -1;

unknown->flags.is_raw = true;
child = unknown;
}

Expand Down
1 change: 0 additions & 1 deletion src/protocols/tacacs/decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,6 @@ ssize_t fr_tacacs_decode(TALLOC_CTX *ctx, fr_pair_list_t *out, fr_dict_attr_t co
da_unknown = fr_dict_unknown_attr_afrom_da(ctx, attr_tacacs_data);
if (!da_unknown) goto fail;

da_unknown->flags.is_raw = 1;
want = pkt->authen_start.data_len;

DECODE_FIELD_STRING8(da_unknown, want);
Expand Down
8 changes: 4 additions & 4 deletions src/tests/unit/protocols/eap/sim/decode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ match
decode-pair.sim_tp_decode 82 01 00 00
match

# Non-encrypted skippable attribute found inside AT_ENCR_DATA
# Non-encrypted skippable unknown attribute found inside AT_ENCR_DATA
decode-pair.sim_tp_decode 82 05 00 00 e1 8b 0e ec 5a bf 10 ac 81 ac e3 f2 ae 71 cb ef
match Encr-Data.255 = 0x0000000000000000000000000000
match raw.Encr-Data.255 = 0x0000000000000000000000000000

# Mixture of known and than skippable unknown
decode-pair.sim_tp_decode 82 05 00 00 47 bd f4 5e 3d c5 69 da e8 fa 73 2a 69 44 a8 78
match Encr-Data.Counter = 0, Encr-Data.255 = 0x00000000000000000000
match Encr-Data.Counter = 0, raw.Encr-Data.255 = 0x00000000000000000000

decode-pair.sim_tp_decode 82 05 00 00 b2 dd 1d a3 e1 fc 91 3d 94 6b 3f a1 ba 5d 73 e2
match Encr-Data.255 = 0x00000000000000000000, Encr-Data.Counter = 0
match raw.Encr-Data.255 = 0x00000000000000000000, Encr-Data.Counter = 0

# RFC4186 A.3. example
decode-pair.sim_tp_decode_rfc4186 0f 02 00 02 00 01 00 00
Expand Down
2 changes: 1 addition & 1 deletion src/tests/unit/protocols/eap/sim/error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ match Unknown (non-skippable) attribute 99
# Unknown skippable attribute (150) - Ensure the 'reserved bytes' in a normal octets
# attribute are not skipped.
decode-pair.sim_tp_decode 97 02 00 00 ff ff ff ff
match 151 = 0x0000ffffffff
match raw.151 = 0x0000ffffffff

# Array missing length field
decode-pair.sim_tp_decode 0f 01
Expand Down
2 changes: 1 addition & 1 deletion src/tests/unit/protocols/internal/decode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ match 6

# Same string attribute but now marked as "unknown"
decode-pair 01 80 01 03 62 6f 62
match 1 = 0x626f62
match raw.1 = 0x626f62
returned
match 7

Expand Down
4 changes: 2 additions & 2 deletions src/tests/unit/protocols/radius/eapol_msg.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fuzzer-out radius
# Snip of packet extracted from eapol_test (GET_RADIUS_REPLY -RAW)
#
decode-proto 020200eb8b7a26bee11f1ca308233d49733187720506000030391217506f776572656420627920467265655241444955531a0c000004d23806deadbeef1a0c000000141e06cafecafe1a0c000000141e06cadecade1a1200000be1130c6d792070726f66696c651a0c00000be11006000000051a0c000001370706000000011a2a0000013711248701b3e481d72fa1333b9838a3cd448837eaed62a843295f1c9dd153c6866e499f201a2a0000013710249385f7dc0fd758b02dd0dc43f68266508ec93c678a5fa38525749016edede8eeea0e4f0603fc0004501200e9e565eb053138254850edb41fc013
match Packet-Type = Access-Accept, Packet-Authentication-Vector = 0x8b7a26bee11f1ca308233d4973318772, NAS-Port = 12345, Reply-Message = "Powered by FreeRADIUS", Vendor-Specific.1234.56 = 0xdeadbeef, Vendor-Specific.20.30 = 0xcafecafe, Vendor-Specific.20.30 = 0xcadecade, Vendor-Specific.Alcatel.FR-Direct-Profile = "my profile", Vendor-Specific.Alcatel.Home-Agent-UDP-Port = 5, Vendor-Specific.Microsoft.MPPE-Encryption-Policy = Encryption-Allowed, raw.Vendor-Specific.Microsoft.MPPE-Recv-Key = 0x8701b3e481d72fa1333b9838a3cd448837eaed62a843295f1c9dd153c6866e499f20, raw.Vendor-Specific.Microsoft.MPPE-Send-Key = 0x9385f7dc0fd758b02dd0dc43f68266508ec93c678a5fa38525749016edede8eeea0e, EAP-Message = 0x03fc0004, Message-Authenticator = 0x00e9e565eb053138254850edb41fc013
match Packet-Type = Access-Accept, Packet-Authentication-Vector = 0x8b7a26bee11f1ca308233d4973318772, NAS-Port = 12345, Reply-Message = "Powered by FreeRADIUS", raw.Vendor-Specific.1234.56 = 0xdeadbeef, raw.Vendor-Specific.20.30 = 0xcafecafe, raw.Vendor-Specific.20.30 = 0xcadecade, Vendor-Specific.Alcatel.FR-Direct-Profile = "my profile", Vendor-Specific.Alcatel.Home-Agent-UDP-Port = 5, Vendor-Specific.Microsoft.MPPE-Encryption-Policy = Encryption-Allowed, raw.Vendor-Specific.Microsoft.MPPE-Recv-Key = 0x8701b3e481d72fa1333b9838a3cd448837eaed62a843295f1c9dd153c6866e499f20, raw.Vendor-Specific.Microsoft.MPPE-Send-Key = 0x9385f7dc0fd758b02dd0dc43f68266508ec93c678a5fa38525749016edede8eeea0e, EAP-Message = 0x03fc0004, Message-Authenticator = 0x00e9e565eb053138254850edb41fc013

count
match 5
match 5
12 changes: 6 additions & 6 deletions src/tests/unit/protocols/radius/extended.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ raw 245.26.1.6 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
match f5 ff 1a 80 00 00 00 01 06 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ab bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb f5 17 1a 00 bb bb bb bb bb cc cc cc cc cc cc cc cc cc cc 13 45 67 89

decode-pair f5 ff 1a 80 00 00 00 01 06 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ab bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb f5 17 1a 00 bb bb bb bb bb cc cc cc cc cc cc cc cc cc cc 13 45 67 89
match Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccc13456789
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccc13456789

# Same as above, but the first attribute doesn't have
# the "continuation" bit set.
#
# Which means we decode-pair the second attribute as an EVS with vendor-ID of 0xbbbbbbbb
decode-pair f5 ff 1a 00 00 00 00 01 06 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ab bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb f5 17 1a 00 bb bb bb bb bb cc cc cc cc cc cc cc cc cc cc 13 45 67 89
match Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, Extended-Attribute-5.Extended-Vendor-Specific-5.3149642683.187 = 0xcccccccccccccccccccc13456789
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, raw.Extended-Attribute-5.Extended-Vendor-Specific-5.3149642683.187 = 0xcccccccccccccccccccc13456789


# again, but the second one attr is not an extended attr
decode-pair f5 ff 1a 80 00 00 00 01 06 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa ab bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb bb 01 05 62 6f 62
match Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, User-Name = "bob"
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, User-Name = "bob"

# No data means that the attribute is an "invalid attribute"
decode-pair f5 04 01 00
Expand All @@ -98,13 +98,13 @@ decode-pair f5 09 1a 00 00 00 00 01 06
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5 = 0x0000000106

decode-pair f5 0a 1a 00 00 00 00 01 06 01
match Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0x01
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0x01

decode-pair f5 09 1a 80 00 00 00 01 06 f5 05 1a 80 01
match Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0x01
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0x01

decode-pair f5 0a 1a 80 00 00 00 01 06 01 f5 05 1a 80 01
match Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0x0101
match raw.Extended-Attribute-5.Extended-Vendor-Specific-5.1.6 = 0x0101

count
match 61
4 changes: 2 additions & 2 deletions src/tests/unit/protocols/radius/lucent.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ decode-pair -
match Vendor-Specific.Lucent.Max-Shared-Users = 1

decode-pair 1a 0d 00 00 12 ee ff 02 07 00 00 00 01
match Vendor-Specific.Lucent.65282 = 0x00000001
match raw.Vendor-Specific.Lucent.65282 = 0x00000001

encode-pair Vendor-Specific.Lucent.65282 = 0x00000001
encode-pair -
match 1a 0d 00 00 12 ee ff 02 07 00 00 00 01

count
Expand Down
10 changes: 5 additions & 5 deletions src/tests/unit/protocols/radius/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ decode-pair -
match Vendor-Specific.USR.Event-Id = 1234

decode-pair 1a 15 00 00 4e 20 01 0f 6c 69 74 68 69 61 73 70 72 69 6e 67 73
match Vendor-Specific.20000.1 = 0x6c6974686961737072696e6773
match raw.Vendor-Specific.20000.1 = 0x6c6974686961737072696e6773

encode-pair Vendor-Specific.3com.User-Access-Level = Visitor, Vendor-Specific.3com.Ip-Host-Addr = "155.4.12.100 00:00:00:00:00:00"
match 1a 0c 00 00 00 2b 01 06 00 00 00 00 1a 26 00 00 00 2b 3c 20 31 35 35 2e 34 2e 31 32 2e 31 30 30 20 30 30 3a 30 30 3a 30 30 3a 30 30 3a 30 30 3a 30 30
Expand Down Expand Up @@ -72,7 +72,7 @@ match Vendor-Specific.Unisphere.LI-Action = off
# Unknown vendors get decoded as TLVs with type=1,length=1
#
decode-pair 1a12000080000105abcdef02076161616161
match Vendor-Specific.32768.1 = 0xabcdef, Vendor-Specific.32768.2 = 0x6161616161
match raw.Vendor-Specific.32768.1 = 0xabcdef, raw.Vendor-Specific.32768.2 = 0x6161616161

#
# This MUST be 50 octets of data
Expand Down Expand Up @@ -116,19 +116,19 @@ encode-pair 26.6809.1 = 0xabcdef
match 1a 0b 00 00 1a 99 01 05 ab cd ef

decode-pair -
match Vendor-Specific.6809.1 = 0xabcdef
match raw.Vendor-Specific.6809.1 = 0xabcdef

encode-pair 26.6809.1.2 = 0xabcdef
match 1a 0d 00 00 1a 99 01 07 02 05 ab cd ef

decode-pair -
match Vendor-Specific.6809.1 = { 2 = 0xabcdef }
match raw.Vendor-Specific.6809.1 = { raw.2 = 0xabcdef }

encode-pair 26.6809.1.2.3 = 0xabcdef
match 1a 0f 00 00 1a 99 01 09 02 07 03 05 ab cd ef

decode-pair -
match Vendor-Specific.6809.1 = { 2 = { 3 = 0xabcdef } }
match raw.Vendor-Specific.6809.1 = { raw.2 = { raw.3 = 0xabcdef } }

count
match 64

0 comments on commit 4164089

Please sign in to comment.