packet-dcerpc: move auth information into a subtree
authorStefan Metzmacher <metze@samba.org>
Mon, 19 Sep 2016 02:35:49 +0000 (04:35 +0200)
committerMichael Mann <mmann78@netscape.net>
Sun, 9 Jul 2017 17:53:23 +0000 (17:53 +0000)
Change-Id: I0e5d3967a26b79c899b0d219317e2963969cba6b
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/17809
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-dcerpc.c

index f865dc3fe1eb1f006115f26da0c42500fcc03a23..a3f700d5272f8c77e9313a7e7bcc092a5e40c0e0 100644 (file)
@@ -3766,6 +3766,19 @@ dcerpc_try_handoff(packet_info *pinfo, proto_tree *tree,
     return 0;
 }
 
+static void
+dissect_dcerpc_cn_auth_move(dcerpc_auth_info *auth_info, proto_tree *dcerpc_tree)
+{
+    if (auth_info->auth_item != NULL) {
+        proto_item *last_item = proto_tree_add_item(dcerpc_tree, hf_dcerpc_auth_info,
+                                                    auth_info->auth_tvb, 0, 0, ENC_NA);
+        if (last_item != NULL) {
+            PROTO_ITEM_SET_HIDDEN(last_item);
+            proto_tree_move_item(dcerpc_tree, last_item, auth_info->auth_item);
+        }
+    }
+}
+
 static void
 dissect_dcerpc_cn_auth(tvbuff_t *tvb, int stub_offset, packet_info *pinfo,
                        proto_tree *dcerpc_tree, e_dce_cn_common_hdr_t *hdr,
@@ -4648,6 +4661,12 @@ dissect_dcerpc_cn_rqst(tvbuff_t *tvb, gint offset, packet_info *pinfo,
             show_stub_data(pinfo, tvb, offset, dcerpc_tree, &auth_info, TRUE);
         }
     }
+
+    /*
+     * Move the auth_info subtree to the end,
+     * as it's also at the end of the pdu on the wire.
+     */
+    dissect_dcerpc_cn_auth_move(&auth_info, dcerpc_tree);
 }
 
 static void
@@ -4779,6 +4798,12 @@ dissect_dcerpc_cn_resp(tvbuff_t *tvb, gint offset, packet_info *pinfo,
             show_stub_data(pinfo, tvb, offset, dcerpc_tree, &auth_info, TRUE);
         }
     }
+
+    /*
+     * Move the auth_info subtree to the end,
+     * as it's also at the end of the pdu on the wire.
+     */
+    dissect_dcerpc_cn_auth_move(&auth_info, dcerpc_tree);
 }
 
 static void
@@ -5033,6 +5058,12 @@ dissect_dcerpc_cn_fault(tvbuff_t *tvb, gint offset, packet_info *pinfo,
             }
         }
     }
+
+    /*
+     * Move the auth_info subtree to the end,
+     * as it's also at the end of the pdu on the wire.
+     */
+    dissect_dcerpc_cn_auth_move(&auth_info, dcerpc_tree);
 }
 
 static void