aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-10 19:58:03 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-10 19:58:03 +0000
commitce62a3c5ccbfcb28d049e8b14f96fd138cdd3747 (patch)
tree402d94ca06906c96b26fab6c20d4d0554712fec4 /asn1
parente78924d5a424f8623a137d96f6e4cd3db46ceaaa (diff)
Use ASN.1 private data instead of pinfo->private_data to exchange kerberos callback functions.
svn path=/trunk/; revision=53240
Diffstat (limited to 'asn1')
-rw-r--r--asn1/kerberos/kerberos.cnf4
-rw-r--r--asn1/kerberos/packet-kerberos-template.c13
2 files changed, 4 insertions, 13 deletions
diff --git a/asn1/kerberos/kerberos.cnf b/asn1/kerberos/kerberos.cnf
index b63c864b83..b2a7e8cf7c 100644
--- a/asn1/kerberos/kerberos.cnf
+++ b/asn1/kerberos/kerberos.cnf
@@ -398,13 +398,13 @@ guint32 msgtype;
tvbuff_t *new_tvb;
offset=dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &new_tvb);
if (new_tvb) {
- call_kerberos_callbacks(actx->pinfo, tree, new_tvb, KRB_CBTAG_SAFE_USER_DATA);
+ call_kerberos_callbacks(actx->pinfo, tree, new_tvb, KRB_CBTAG_SAFE_USER_DATA, (kerberos_callbacks*)actx->private_data);
}
#.FN_BODY EncKrbPrivPart/user-data
tvbuff_t *new_tvb;
offset=dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &new_tvb);
if (new_tvb) {
- call_kerberos_callbacks(actx->pinfo, tree, new_tvb, KRB_CBTAG_PRIV_USER_DATA);
+ call_kerberos_callbacks(actx->pinfo, tree, new_tvb, KRB_CBTAG_PRIV_USER_DATA, (kerberos_callbacks*)actx->private_data);
}
diff --git a/asn1/kerberos/packet-kerberos-template.c b/asn1/kerberos/packet-kerberos-template.c
index e9d7cd154d..87ed2246b2 100644
--- a/asn1/kerberos/packet-kerberos-template.c
+++ b/asn1/kerberos/packet-kerberos-template.c
@@ -162,10 +162,8 @@ static guint32 gbl_keytype;
static gboolean gbl_do_col_info;
static void
-call_kerberos_callbacks(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int tag)
+call_kerberos_callbacks(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int tag, kerberos_callbacks *cb)
{
- kerberos_callbacks *cb=(kerberos_callbacks *)pinfo->private_data;
-
if(!cb){
return;
}
@@ -1715,15 +1713,12 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
volatile int offset = 0;
proto_tree *volatile kerberos_tree = NULL;
proto_item *volatile item = NULL;
- void *saved_private_data;
asn1_ctx_t asn1_ctx;
/* TCP record mark and length */
guint32 krb_rm = 0;
gint krb_reclen = 0;
- saved_private_data=pinfo->private_data;
- pinfo->private_data=cb;
gbl_do_col_info=dci;
if (have_rm) {
@@ -1733,7 +1728,6 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* What is a reasonable size limit?
*/
if (krb_reclen > 10 * 1024 * 1024) {
- pinfo->private_data=saved_private_data;
return (-1);
}
@@ -1761,7 +1755,6 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
get_ber_identifier(tvb, offset, &tmp_class, &tmp_pc, &tmp_tag);
if(tmp_class!=BER_CLASS_APP){
- pinfo->private_data=saved_private_data;
return 0;
}
switch(tmp_tag){
@@ -1784,7 +1777,6 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case KRB5_MSG_ERROR:
break;
default:
- pinfo->private_data=saved_private_data;
return 0;
}
if (do_col_protocol) {
@@ -1799,16 +1791,15 @@ dissect_kerberos_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
+ asn1_ctx.private_data = cb;
TRY {
offset=dissect_kerberos_Applications(FALSE, tvb, 0, &asn1_ctx , tree, /* hf_index */ -1);
} CATCH_BOUNDS_ERRORS {
- pinfo->private_data=saved_private_data;
RETHROW;
} ENDTRY;
proto_item_set_len(item, offset);
- pinfo->private_data=saved_private_data;
return offset;
}