aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tacacs.c
diff options
context:
space:
mode:
authorJason Cohen <kryojenik2@gmail.com>2018-11-20 16:23:09 -0600
committerAnders Broman <a.broman58@gmail.com>2018-11-21 04:37:17 +0000
commit31a20607d619c9db7f6997640891416dfd9439cc (patch)
tree761e2670029e52c046009019a6894e660c6fbcb3 /epan/dissectors/packet-tacacs.c
parent7943dbf7bbffb535f83c333b779f9d384c7fe6df (diff)
Fix reassembly of larger TACACS+ accounting messages
Since TACACS+ is TCP only, switched to tcp_dissect_pdus Bug: 15293 Change-Id: I8cee8a1f474ae866c59f94ec8ecbd412e5189e89 Reviewed-on: https://code.wireshark.org/review/30748 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-tacacs.c')
-rw-r--r--epan/dissectors/packet-tacacs.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/epan/dissectors/packet-tacacs.c b/epan/dissectors/packet-tacacs.c
index 1e19629a80..6b4f5f3a13 100644
--- a/epan/dissectors/packet-tacacs.c
+++ b/epan/dissectors/packet-tacacs.c
@@ -29,6 +29,7 @@
#include <wsutil/wsgcrypt.h>
#include <wsutil/ws_printf.h> /* ws_debug_printf */
+#include "packet-tcp.h"
#include "packet-tacacs.h"
void proto_reg_handoff_tacacs(void);
@@ -38,6 +39,7 @@ void proto_reg_handoff_tacplus(void);
void proto_register_tacplus(void);
static void md5_xor( guint8 *data, const char *key, int data_len, guint8 *session_id, guint8 version, guint8 seq_no );
+static int dissect_tacplus_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static int proto_tacacs = -1;
static int hf_tacacs_version = -1;
@@ -861,8 +863,21 @@ parse_tacplus_keys( const char *keys_from_option )
#endif
}
+static guint
+get_tacplus_message_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
+{
+ return (guint)tvb_get_ntohl(tvb, offset+H_LENGTH_OFF) + TAC_PLUS_HDR_SIZE;
+}
+
+static int
+dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
+{
+ tcp_dissect_pdus(tvb, pinfo, tree, tacplus_preference_desegment, TAC_PLUS_HDR_SIZE, get_tacplus_message_len, dissect_tacplus_message, data);
+ return tvb_captured_length(tvb);
+}
+
static int
-dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
+dissect_tacplus_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
tvbuff_t *new_tvb=NULL;
proto_tree *tacplus_tree, *body_tree;
@@ -877,13 +892,6 @@ dissect_tacplus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data
len = tvb_get_ntohl(tvb, 8);
- if(len > (guint)tvb_captured_length_remaining(tvb, 12) &&
- pinfo->can_desegment && tacplus_preference_desegment) {
- pinfo->desegment_offset = 0;
- pinfo->desegment_len = len;
- return tvb_captured_length(tvb);
- }
-
if( request ) {
key=find_key( &pinfo->dst, &pinfo->src );
} else {