aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/pkcs12
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-11-24 18:03:04 -0500
committerMichael Mann <mmann78@netscape.net>2015-11-25 19:21:28 +0000
commit73e58f025ef111810ae7c931a0262248106095f4 (patch)
tree881de0049e5e07b573675ef2ec400859e44943ba /asn1/pkcs12
parent0cd1a8506425fa379c88df941e3039ce9a1164d4 (diff)
create_dissector_handle -> new_create_dissector_handle for ASN.1 dissectors
Change-Id: I3d7a61a5ddd79b7bcbec5b9c515470848f413fd5 Reviewed-on: https://code.wireshark.org/review/12121 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'asn1/pkcs12')
-rw-r--r--asn1/pkcs12/packet-pkcs12-template.c10
-rw-r--r--asn1/pkcs12/pkcs12.cnf4
2 files changed, 8 insertions, 6 deletions
diff --git a/asn1/pkcs12/packet-pkcs12-template.c b/asn1/pkcs12/packet-pkcs12-template.c
index 8be1913020..3dd6e03f04 100644
--- a/asn1/pkcs12/packet-pkcs12-template.c
+++ b/asn1/pkcs12/packet-pkcs12-template.c
@@ -68,8 +68,8 @@ static tvbuff_t *salt = NULL;
static const char *password = NULL;
static gboolean try_null_password = FALSE;
-static void dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
-static void dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+static int dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
+static int dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
static int dissect_PrivateKeyInfo_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data);
#include "packet-pkcs12-hf.c"
@@ -407,7 +407,7 @@ static int strip_octet_string(tvbuff_t *tvb)
}
-static void dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+static int dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) {
int offset = 0;
asn1_ctx_t asn1_ctx;
asn1_ctx_init(&asn1_ctx, ASN1_ENC_BER, TRUE, pinfo);
@@ -416,9 +416,10 @@ static void dissect_AuthenticatedSafe_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info
dissect_pkcs12_AuthenticatedSafe(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_AuthenticatedSafe_PDU);
else
proto_tree_add_expert(tree, pinfo, &ei_pkcs12_octet_string_expected, tvb, 0, 1);
+ return tvb_captured_length(tvb);
}
-static void dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static int dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
asn1_ctx_t asn1_ctx;
@@ -427,6 +428,7 @@ static void dissect_SafeContents_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pin
offset = strip_octet_string(tvb);
dissect_pkcs12_SafeContents(FALSE, tvb, offset, &asn1_ctx, tree, hf_pkcs12_SafeContents_PDU);
+ return tvb_captured_length(tvb);
}
static int dissect_X509Certificate_OCTETSTRING_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
diff --git a/asn1/pkcs12/pkcs12.cnf b/asn1/pkcs12/pkcs12.cnf
index 69fa46baa4..7190ff84b9 100644
--- a/asn1/pkcs12/pkcs12.cnf
+++ b/asn1/pkcs12/pkcs12.cnf
@@ -59,7 +59,7 @@ PrivateKeyInfo
/* we change the CMS id-data dissector to dissect as AuthenticatedSafe
not sure why PKCS#12 couldn't have used its own content type OID for AuthenticatedSafe */
- dissector_handle=create_dissector_handle(dissect_AuthenticatedSafe_OCTETSTRING_PDU, proto_pkcs12);
+ dissector_handle=new_create_dissector_handle(dissect_AuthenticatedSafe_OCTETSTRING_PDU, proto_pkcs12);
dissector_change_string("ber.oid", "1.2.840.113549.1.7.1", dissector_handle);
%(DEFAULT_BODY)s
@@ -71,7 +71,7 @@ PrivateKeyInfo
dissector_handle_t dissector_handle;
/* we change the CMS id-data dissector to dissect as SafeContents */
- dissector_handle=create_dissector_handle(dissect_SafeContents_OCTETSTRING_PDU, proto_pkcs12);
+ dissector_handle=new_create_dissector_handle(dissect_SafeContents_OCTETSTRING_PDU, proto_pkcs12);
dissector_change_string("ber.oid", "1.2.840.113549.1.7.1", dissector_handle);
%(DEFAULT_BODY)s