From 71dd3658b727489a75c068d7bc8170078c9582a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Thu, 27 Jul 2017 19:01:02 +0100 Subject: RADIUS: Add preference to disable RFC 6929 extended attributes This is an ugly workaround for the fact that attributes 241-246 are currently hardcoded as extended type. This is to restore previous functionality to dissect some Ascend AVPs that shouldn't be using the IANA allocation space. Ping-Bug: 11630 Change-Id: I6bebefd21fe5149f5f57b3280c9992a0eca85e62 Reviewed-on: https://code.wireshark.org/review/22972 Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- epan/dissectors/packet-radius.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'epan/dissectors') diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index a570d311b0..e1d89c6661 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -229,6 +229,7 @@ static dissector_handle_t radius_handle; static const gchar *shared_secret = ""; static gboolean validate_authenticator = FALSE; static gboolean show_length = FALSE; +static gboolean disable_extended_attributes = FALSE; static guint8 authenticator[AUTHENTICATOR_LENGTH]; @@ -1428,6 +1429,11 @@ dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tv avp_type.u8_code[0] = avp_type0; avp_type.u8_code[1] = avp_type1; + if (disable_extended_attributes) { + avp_is_extended = FALSE; + avp_type.u8_code[1] = 0; + } + if (avp_length < 2) { proto_tree_add_expert_format(tree, pinfo, &ei_radius_invalid_length, tvb, offset, 0, "AVP too short: length %u < 2", avp_length); @@ -2828,6 +2834,9 @@ proto_register_radius(void) prefs_register_bool_preference(radius_module, "show_length", "Show AVP Lengths", "Whether to add or not to the tree the AVP's payload length", &show_length); + prefs_register_bool_preference(radius_module, "disable_extended_attributes", "Disable extended attribute space (RFC 6929)", + "Whether to interpret 241-246 as extended attributes according to RFC 6929", + &disable_extended_attributes); prefs_register_obsolete_preference(radius_module, "request_ttl"); radius_tap = register_tap("radius"); -- cgit v1.2.3