aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cms.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2004-10-26 13:53:30 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2004-10-26 13:53:30 +0000
commit76a5fb68993654bdda0f4b1fc799d0d63aea98c8 (patch)
treed24e56cfa36fb5190963e7550aa8a595203c20d0 /epan/dissectors/packet-cms.c
parent3c2e9b16ef9a819eabdd3364645b418a64e1d48d (diff)
new cms dissector based on updated and cleaned up conformance and template file.
use the nice #.REGISTER directive instead of doing it by hand. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12393 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-cms.c')
-rw-r--r--epan/dissectors/packet-cms.c91
1 files changed, 55 insertions, 36 deletions
diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c
index e4a2cb8e00..04585b7799 100644
--- a/epan/dissectors/packet-cms.c
+++ b/epan/dissectors/packet-cms.c
@@ -56,6 +56,11 @@ static int hf_cms_ci_contentType = -1;
/*--- Included file: packet-cms-hf.c ---*/
+static int hf_cms_SignedData_PDU = -1; /* SignedData */
+static int hf_cms_EnvelopedData_PDU = -1; /* EnvelopedData */
+static int hf_cms_DigestedData_PDU = -1; /* DigestedData */
+static int hf_cms_EncryptedData_PDU = -1; /* EncryptedData */
+static int hf_cms_AuthenticatedData_PDU = -1; /* AuthenticatedData */
static int hf_cms_version = -1; /* CMSVersion */
static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */
static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */
@@ -1152,6 +1157,24 @@ dissect_cms_Countersignature(gboolean implicit_tag _U_, tvbuff_t *tvb, int offse
return offset;
}
+/*--- PDUs ---*/
+
+static void dissect_SignedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, hf_cms_SignedData_PDU);
+}
+static void dissect_EnvelopedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EnvelopedData_PDU);
+}
+static void dissect_DigestedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, hf_cms_DigestedData_PDU);
+}
+static void dissect_EncryptedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, hf_cms_EncryptedData_PDU);
+}
+static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, hf_cms_AuthenticatedData_PDU);
+}
+
/*--- End of included file: packet-cms-fn.c ---*/
@@ -1188,37 +1211,6 @@ dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
return offset;
}
-static void
-dissect_cms_SignedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, -1);
-}
-
-static void
-dissect_cms_EnvelopedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, -1);
-}
-
-static void
-dissect_cms_DigestedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, -1);
-}
-
-
-static void
-dissect_cms_EncryptedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, -1);
-}
-
-static void
-dissect_cms_AuthenticatedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
-{
- dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, -1);
-}
-
/* ContentInfo can not yet be handled by the compiler */
@@ -1269,6 +1261,26 @@ void proto_register_cms(void) {
/*--- Included file: packet-cms-hfarr.c ---*/
+ { &hf_cms_SignedData_PDU,
+ { "SignedData", "cms.SignedData",
+ FT_NONE, BASE_NONE, NULL, 0,
+ "SignedData", HFILL }},
+ { &hf_cms_EnvelopedData_PDU,
+ { "EnvelopedData", "cms.EnvelopedData",
+ FT_NONE, BASE_NONE, NULL, 0,
+ "EnvelopedData", HFILL }},
+ { &hf_cms_DigestedData_PDU,
+ { "DigestedData", "cms.DigestedData",
+ FT_NONE, BASE_NONE, NULL, 0,
+ "DigestedData", HFILL }},
+ { &hf_cms_EncryptedData_PDU,
+ { "EncryptedData", "cms.EncryptedData",
+ FT_NONE, BASE_NONE, NULL, 0,
+ "EncryptedData", HFILL }},
+ { &hf_cms_AuthenticatedData_PDU,
+ { "AuthenticatedData", "cms.AuthenticatedData",
+ FT_NONE, BASE_NONE, NULL, 0,
+ "AuthenticatedData", HFILL }},
{ &hf_cms_version,
{ "version", "cms.version",
FT_INT32, BASE_DEC, VALS(CMSVersion_vals), 0,
@@ -1603,10 +1615,17 @@ void proto_register_cms(void) {
/*--- proto_reg_handoff_cms -------------------------------------------*/
void proto_reg_handoff_cms(void) {
- register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_cms_SignedData_callback, proto_cms, "id-signedData");
- register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_cms_EnvelopedData_callback, proto_cms, "id-envelopedData");
- register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_cms_DigestedData_callback, proto_cms, "id-digestedData");
- register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_cms_EncryptedData_callback, proto_cms, "id-encryptedData");
- register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_cms_AuthenticatedData_callback, proto_cms, "id-ct-authenticatedData");
+
+/*--- Included file: packet-cms-dis-tab.c ---*/
+
+ register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_SignedData_PDU, proto_cms, "id-signedData");
+ register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_EnvelopedData_PDU, proto_cms, "id-envelopedData");
+ register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_DigestedData_PDU, proto_cms, "id-digestedData");
+ register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_EncryptedData_PDU, proto_cms, "id-encryptedData");
+ register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_AuthenticatedData_PDU, proto_cms, "id-ct-authenticatedData");
+
+
+/*--- End of included file: packet-cms-dis-tab.c ---*/
+
}