diff options
author | Michael Mann <mmann78@netscape.net> | 2015-11-24 18:03:04 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2015-11-25 19:21:28 +0000 |
commit | 73e58f025ef111810ae7c931a0262248106095f4 (patch) | |
tree | 881de0049e5e07b573675ef2ec400859e44943ba /epan/dissectors/packet-pkcs12.c | |
parent | 0cd1a8506425fa379c88df941e3039ce9a1164d4 (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 'epan/dissectors/packet-pkcs12.c')
-rw-r--r-- | epan/dissectors/packet-pkcs12.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/epan/dissectors/packet-pkcs12.c b/epan/dissectors/packet-pkcs12.c index 4dd3ca95e2..72629fa9f2 100644 --- a/epan/dissectors/packet-pkcs12.c +++ b/epan/dissectors/packet-pkcs12.c @@ -76,8 +76,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); @@ -558,7 +558,7 @@ dissect_pkcs12_PFX(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, /* 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); offset = dissect_ber_sequence(implicit_tag, actx, tree, tvb, offset, @@ -584,7 +584,7 @@ dissect_pkcs12_AuthenticatedSafe(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, i 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); offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, @@ -1174,7 +1174,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); @@ -1183,9 +1183,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; @@ -1194,6 +1195,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_) @@ -1441,7 +1443,7 @@ void proto_register_pkcs12(void) { "AlgorithmIdentifier", HFILL }}, /*--- End of included file: packet-pkcs12-hfarr.c ---*/ -#line 461 "../../asn1/pkcs12/packet-pkcs12-template.c" +#line 463 "../../asn1/pkcs12/packet-pkcs12-template.c" }; /* List of subtrees */ @@ -1472,7 +1474,7 @@ void proto_register_pkcs12(void) { &ett_pkcs12_PBMAC1Params, /*--- End of included file: packet-pkcs12-ettarr.c ---*/ -#line 467 "../../asn1/pkcs12/packet-pkcs12-template.c" +#line 469 "../../asn1/pkcs12/packet-pkcs12-template.c" }; static ei_register_info ei[] = { { &ei_pkcs12_octet_string_expected, { "pkcs12.octet_string_expected", PI_PROTOCOL, PI_WARN, "BER Error: OCTET STRING expected", EXPFILL }}, @@ -1540,7 +1542,7 @@ void proto_reg_handoff_pkcs12(void) { /*--- End of included file: packet-pkcs12-dis-tab.c ---*/ -#line 506 "../../asn1/pkcs12/packet-pkcs12-template.c" +#line 508 "../../asn1/pkcs12/packet-pkcs12-template.c" new_register_ber_oid_dissector("1.2.840.113549.1.9.22.1", dissect_X509Certificate_OCTETSTRING_PDU, proto_pkcs12, "x509Certificate"); |