aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-radius.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2016-03-13 14:09:42 -0400
committerMichael Mann <mmann78@netscape.net>2016-03-13 20:30:24 +0000
commit89fc294892283bd54582074a350f38d1a2b2ef4e (patch)
treefd4e2e6d77c3744d71bc18ac464b4d3021134111 /epan/dissectors/packet-radius.c
parent55fd97e73df032584ab9c9c1c4401aa91fe5096c (diff)
Fix a FIXME: remove an if(tree).
The reason the notice in the INFO column disappeared when a display filter was added is because the column operation was wrapped in an if(tree). Change-Id: Ic8ff929d7ef601458b8650f8095f87282f9fde40 Reviewed-on: https://code.wireshark.org/review/14449 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-radius.c')
-rw-r--r--epan/dissectors/packet-radius.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c
index 37ea2b4233..f60c8313e1 100644
--- a/epan/dissectors/packet-radius.c
+++ b/epan/dissectors/packet-radius.c
@@ -1942,42 +1942,39 @@ dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _
/* Indicate the frame to which this is a reply. */
if (radius_call->req_num)
{
+ nstime_t delta;
+ proto_item *item;
+
rad_info->request_available = TRUE;
rad_info->req_num = radius_call->req_num;
radius_call->responded = TRUE;
- if (tree)
+ item = proto_tree_add_uint_format(radius_tree,
+ hf_radius_req_frame, tvb, 0, 0,
+ radius_call->req_num,
+ "This is a response to a request in frame %u",
+ radius_call->req_num);
+ PROTO_ITEM_SET_GENERATED(item);
+ nstime_delta(&delta, &pinfo->abs_ts, &radius_call->req_time);
+ item = proto_tree_add_time(radius_tree, hf_radius_time, tvb, 0, 0, &delta);
+ PROTO_ITEM_SET_GENERATED(item);
+ /* Response Authenticator Validation */
+ if (validate_authenticator && *shared_secret != '\0')
{
- nstime_t delta;
- proto_item* item;
- item = proto_tree_add_uint_format(radius_tree,
- hf_radius_req_frame, tvb, 0, 0,
- radius_call->req_num,
- "This is a response to a request in frame %u",
- radius_call->req_num);
+ proto_item * authenticator_tree;
+ int valid;
+ valid = valid_authenticator(tvb, radius_call->req_authenticator);
+
+ proto_item_append_text(authenticator_item, " [%s]", valid? "correct" : "incorrect");
+ authenticator_tree = proto_item_add_subtree(authenticator_item, ett_radius_authenticator);
+ item = proto_tree_add_boolean(authenticator_tree, hf_radius_authenticator_valid, tvb, 4, AUTHENTICATOR_LENGTH, valid ? TRUE : FALSE);
PROTO_ITEM_SET_GENERATED(item);
- nstime_delta(&delta, &pinfo->abs_ts, &radius_call->req_time);
- item = proto_tree_add_time(radius_tree, hf_radius_time, tvb, 0, 0, &delta);
+ item = proto_tree_add_boolean(authenticator_tree, hf_radius_authenticator_invalid, tvb, 4, AUTHENTICATOR_LENGTH, valid ? FALSE : TRUE);
PROTO_ITEM_SET_GENERATED(item);
- /* Response Authenticator Validation */
- if (validate_authenticator && *shared_secret != '\0')
- {
- proto_item * authenticator_tree;
- int valid;
- valid = valid_authenticator(tvb, radius_call->req_authenticator);
- proto_item_append_text(authenticator_item, " [%s]", valid? "correct" : "incorrect");
- authenticator_tree = proto_item_add_subtree(authenticator_item, ett_radius_authenticator);
- item = proto_tree_add_boolean(authenticator_tree, hf_radius_authenticator_valid, tvb, 4, AUTHENTICATOR_LENGTH, valid ? TRUE : FALSE);
- PROTO_ITEM_SET_GENERATED(item);
- item = proto_tree_add_boolean(authenticator_tree, hf_radius_authenticator_invalid, tvb, 4, AUTHENTICATOR_LENGTH, valid ? FALSE : TRUE);
- PROTO_ITEM_SET_GENERATED(item);
-
- if (!valid)
- {
- /* FIXME: this information disappears when a display filter is enterred */
- col_append_fstr(pinfo->cinfo,COL_INFO," [incorrect authenticator]");
- }
+ if (!valid)
+ {
+ col_append_fstr(pinfo->cinfo,COL_INFO," [incorrect authenticator]");
}
}
}