aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-credssp.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2013-06-18 01:13:07 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2013-06-18 01:13:07 +0000
commit458dcb7ea2271200494707361b06208daa160a47 (patch)
treed3d78892f47b849a0a54f6b2a02c4a80074bc02e /epan/dissectors/packet-credssp.c
parent3d1115c2bd19c2e8f768f9b0321f60c36df91844 (diff)
Add ability to export decrypted SSL/DTLS PDUs
svn path=/trunk/; revision=50001
Diffstat (limited to 'epan/dissectors/packet-credssp.c')
-rw-r--r--epan/dissectors/packet-credssp.c46
1 files changed, 31 insertions, 15 deletions
diff --git a/epan/dissectors/packet-credssp.c b/epan/dissectors/packet-credssp.c
index 52ac249e5e..357538e155 100644
--- a/epan/dissectors/packet-credssp.c
+++ b/epan/dissectors/packet-credssp.c
@@ -36,6 +36,8 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/asn1.h>
+#include <epan/tap.h>
+#include <epan/exported_pdu.h>
#include "packet-ber.h"
#include "packet-credssp.h"
@@ -49,6 +51,8 @@
#define TS_SMARTCARD_CREDS 2
static gint creds_type;
+static gint exported_pdu_tap = -1;
+
/* Initialize the protocol and registered fields */
static int proto_credssp = -1;
@@ -84,7 +88,7 @@ static int hf_credssp_authInfo = -1; /* T_authInfo */
static int hf_credssp_pubKeyAuth = -1; /* OCTET_STRING */
/*--- End of included file: packet-credssp-hf.c ---*/
-#line 54 "../../asn1/credssp/packet-credssp-template.c"
+#line 58 "../../asn1/credssp/packet-credssp-template.c"
/* Initialize the subtree pointers */
static gint ett_credssp = -1;
@@ -100,7 +104,7 @@ static gint ett_credssp_TSCredentials = -1;
static gint ett_credssp_TSRequest = -1;
/*--- End of included file: packet-credssp-ett.c ---*/
-#line 58 "../../asn1/credssp/packet-credssp-template.c"
+#line 62 "../../asn1/credssp/packet-credssp-template.c"
/*--- Included file: packet-credssp-fn.c ---*/
@@ -328,7 +332,7 @@ static void dissect_TSRequest_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pro
/*--- End of included file: packet-credssp-fn.c ---*/
-#line 60 "../../asn1/credssp/packet-credssp-template.c"
+#line 64 "../../asn1/credssp/packet-credssp-template.c"
/*
* Dissect CredSSP PDUs
@@ -369,15 +373,27 @@ dissect_credssp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree,
offset = get_ber_length(tvb, offset, NULL, NULL);
offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
if((ber_class == BER_CLASS_CON) && (tag == 0)) {
- offset = get_ber_length(tvb, offset, NULL, NULL);
- offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
- if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) {
- offset = get_ber_length(tvb, offset, &length, NULL);
- if((length == 1) && (tvb_get_guint8(tvb, offset) == 2)) {
- dissect_credssp(tvb, pinfo, parent_tree);
- return TRUE;
- }
- }
+ offset = get_ber_length(tvb, offset, NULL, NULL);
+ offset = get_ber_identifier(tvb, offset, &ber_class, &pc, &tag);
+ if((ber_class == BER_CLASS_UNI) && (tag == BER_UNI_TAG_INTEGER)) {
+ offset = get_ber_length(tvb, offset, &length, NULL);
+ if((length == 1) && (tvb_get_guint8(tvb, offset) == 2)) {
+ if (have_tap_listener(exported_pdu_tap)) {
+ exp_pdu_data_t *exp_pdu_data;
+
+ exp_pdu_data = load_export_pdu_tags(pinfo, "credssp", -1,
+ (EXP_PDU_TAG_IP_SRC_BIT | EXP_PDU_TAG_IP_DST_BIT | EXP_PDU_TAG_SRC_PORT_BIT |
+ EXP_PDU_TAG_DST_PORT_BIT | EXP_PDU_TAG_ORIG_FNO_BIT));
+
+ exp_pdu_data->tvb_length = tvb_length(tvb);
+ exp_pdu_data->pdu_tvb = tvb;
+
+ tap_queue_packet(exported_pdu_tap, pinfo, exp_pdu_data);
+ }
+ dissect_credssp(tvb, pinfo, parent_tree);
+ return TRUE;
+ }
+ }
}
}
}
@@ -492,7 +508,7 @@ void proto_register_credssp(void) {
"OCTET_STRING", HFILL }},
/*--- End of included file: packet-credssp-hfarr.c ---*/
-#line 135 "../../asn1/credssp/packet-credssp-template.c"
+#line 151 "../../asn1/credssp/packet-credssp-template.c"
};
/* List of subtrees */
@@ -510,7 +526,7 @@ void proto_register_credssp(void) {
&ett_credssp_TSRequest,
/*--- End of included file: packet-credssp-ettarr.c ---*/
-#line 141 "../../asn1/credssp/packet-credssp-template.c"
+#line 157 "../../asn1/credssp/packet-credssp-template.c"
};
@@ -532,6 +548,6 @@ void proto_register_credssp(void) {
void proto_reg_handoff_credssp(void) {
heur_dissector_add("ssl", dissect_credssp_heur, proto_credssp);
-
+ exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);
}