aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cms.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2004-10-28 22:06:55 +0000
committerGerald Combs <gerald@wireshark.org>2004-10-28 22:06:55 +0000
commit24f30a8850a1f11ae2470fd5124e827f443fa62b (patch)
treebe8e613482626efd38c3c9d08cef55bdfb5d0051 /epan/dissectors/packet-cms.c
parentbef8e01fcdfb99155406d7b53500f4764dffbc1a (diff)
Add support for pkauthdata and pkdhkeydata OIDs.
svn path=/trunk/; revision=12426
Diffstat (limited to 'epan/dissectors/packet-cms.c')
-rw-r--r--epan/dissectors/packet-cms.c79
1 files changed, 57 insertions, 22 deletions
diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c
index 04585b7799..d3e82289f1 100644
--- a/epan/dissectors/packet-cms.c
+++ b/epan/dissectors/packet-cms.c
@@ -8,7 +8,7 @@
/* packet-cms.c
* Routines for RFC2630 Cryptographic Message Syntax packet dissection
*
- * $Id: packet-cms-template.c 12245 2004-10-08 20:28:04Z guy $
+ * $Id: packet-cms-template.c 12394 2004-10-26 13:54:09Z sahlberg $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -53,6 +53,7 @@
int proto_cms = -1;
static int hf_cms_keyAttr_id = -1;
static int hf_cms_ci_contentType = -1;
+static int hf_cms_eci_eContentType = -1;
/*--- Included file: packet-cms-hf.c ---*/
@@ -289,19 +290,6 @@ static int dissect_keyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t
return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_keyIdentifier);
}
-static const ber_sequence EncapsulatedContentInfo_sequence[] = {
- { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_eContentType },
- { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_eContent },
- { 0, 0, 0, NULL }
-};
-
-static int
-dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
- offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
- EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
-
- return offset;
-}
static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {
return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo);
}
@@ -1181,16 +1169,16 @@ static void dissect_AuthenticatedData_PDU(tvbuff_t *tvb, packet_info *pinfo, pro
static char keyAttr_id[64]; /*64 chars should be long enough? */
-static int
-dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
+static int
+dissect_keyAttrId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_cms_keyAttr_id, keyAttr_id);
return offset;
}
-static int
-dissect_keyAttr_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
+static int
+dissect_keyAttr_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
offset=call_ber_oid_callback(keyAttr_id, tvb, offset, pinfo, tree);
@@ -1215,15 +1203,15 @@ dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offs
/* ContentInfo can not yet be handled by the compiler */
static char ci_contentType[64]; /*64 chars should be long enough? */
-static int
-dissect_hf_cms_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
+static int
+dissect_hf_cms_contentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
hf_cms_ci_contentType, ci_contentType);
return offset;
}
-static int
-dissect_hf_cms_contentType_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
+static int
+dissect_hf_cms_contentType_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
{
offset=call_ber_oid_callback(ci_contentType, tvb, offset, pinfo, tree);
@@ -1245,6 +1233,48 @@ dissect_cms_ContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet
}
+/* Do the same thing for EncapsulatedContentInfo */
+static char eci_eContentType[64]; /*64 chars should be long enough? */
+static int
+dissect_hf_cms_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
+{
+ offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset,
+ hf_cms_eci_eContentType, eci_eContentType);
+ return offset;
+}
+static int
+dissect_hf_cms_eContentType_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset)
+{
+ guint8 class;
+ gboolean pc, ind;
+ guint32 tag, len;
+ int pdu_offset = offset;
+
+ /* XXX Do we care about printing out the octet string? */
+ offset = dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent);
+
+ pdu_offset = get_ber_identifier(tvb, pdu_offset, &class, &pc, &tag);
+ pdu_offset = get_ber_length(tvb, pdu_offset, &len, &ind);
+ pdu_offset = call_ber_oid_callback(eci_eContentType, tvb, pdu_offset, pinfo, tree);
+
+ return offset;
+}
+
+static const ber_sequence EncapsulatedContentInfo_sequence[] = {
+ { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_cms_eContentType },
+ { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_hf_cms_eContentType_content },
+ { 0, 0, 0, NULL }
+};
+
+int
+dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) {
+ offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset,
+ EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo);
+
+ return offset;
+}
+
+
/*--- proto_register_cms ----------------------------------------------*/
void proto_register_cms(void) {
@@ -1254,6 +1284,10 @@ void proto_register_cms(void) {
{ "contentType", "cms.contentInfo.contentType",
FT_STRING, BASE_NONE, NULL, 0,
"ContentType", HFILL }},
+ { &hf_cms_eci_eContentType,
+ { "eContentType", "cms.encapContentInfo.eContentType",
+ FT_STRING, BASE_NONE, NULL, 0,
+ "EncapsulatedContentType", HFILL }},
{ &hf_cms_keyAttr_id,
{ "keyAttr_id", "cms.keyAttr_id",
FT_STRING, BASE_NONE, NULL, 0,
@@ -1557,6 +1591,7 @@ void proto_register_cms(void) {
/* List of subtrees */
static gint *ett[] = {
&ett_cms_ContentInfo,
+ &ett_cms_EncapsulatedContentInfo,
/*--- Included file: packet-cms-ettarr.c ---*/