Update to CMD to prepare for PKINIT support
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 16 Sep 2004 08:31:01 +0000 (08:31 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 16 Sep 2004 08:31:01 +0000 (08:31 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12009 f5534014-38df-0310-8fa8-9805f1628bb7

asn1/cms/CryptographicMessageSyntax.asn
asn1/cms/cms.cnf
asn1/cms/cms_exp.cnf [new file with mode: 0644]
asn1/cms/packet-cms-template.c
asn1/cms/packet-cms-template.h

index 9d3581fe9f3c8510974e6cb551f5c631462bcc84..03e2c7c809b2c832a970fe40ece9ec087c8e32ee 100755 (executable)
@@ -26,9 +26,14 @@ IMPORTS
 
 -- Cryptographic Message Syntax
 -- 
--- ContentInfo ::= SEQUENCE {
---OK   contentType ContentType,
---   content [0] EXPLICIT ANY DEFINED BY contentType }
+
+
+--             Implemented by hand in the template
+--ContentInfo ::= SEQUENCE {
+--   contentType ContentType,
+--   content [0] EXPLICIT ANY DEFINED BY contentType 
+--}
+
 
 ContentType ::= OBJECT IDENTIFIER
 
index af0add8e87bcb1d81f5d1098b75047655c754c94..cd01fc117070b83ea20ff45300d1f2f152b95031 100644 (file)
@@ -13,6 +13,7 @@ InformationFramework x509if
 #.EXPORTS\r
 SignedData\r
 Countersignature\r
+IssuerAndSerialNumber\r
 \r
 #.NO_EMIT\r
 OtherKeyAttribute\r
diff --git a/asn1/cms/cms_exp.cnf b/asn1/cms/cms_exp.cnf
new file mode 100644 (file)
index 0000000..97673d6
--- /dev/null
@@ -0,0 +1,19 @@
+# Do not modify this file.
+# It is created automatically by the ASN.1 to Ethereal dissector compiler
+# ./cms-exp.cnf
+# ../../tools/asn2eth.py -e -X -b -p cms -c cms.cnf CryptographicMessageSyntax.asn
+
+#.IMPORT_TAG
+ContentInfo              BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
+SignedData               BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
+IssuerAndSerialNumber    BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
+Countersignature         BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
+#.END
+
+#.TYPE_ATTR
+ContentInfo              TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
+SignedData               TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
+IssuerAndSerialNumber    TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
+Countersignature         TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
+#.END
+
index 7cb7c2955986d0af4d9caf65405c6b5318c56c92..bbb517b6bf111d1e2613f0cad99b2b11cf69ebe2 100644 (file)
 /* Initialize the protocol and registered fields */
 int proto_cms = -1;
 static int hf_cms_keyAttr_id = -1;
+static int hf_cms_ci_contentType = -1;
 #include "packet-cms-hf.c"
 
 /* Initialize the subtree pointers */
+static gint ett_cms_ContentInfo = -1;
 #include "packet-cms-ett.c"
 
 static int dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index);
@@ -118,11 +120,49 @@ dissect_cms_AuthenticatedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_
        dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, -1);
 }
 
+
+
+/* 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) 
+{
+  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) 
+{
+  offset=call_ber_oid_callback(ci_contentType, tvb, offset, pinfo, tree);
+
+  return offset;
+}
+
+static ber_sequence ContentInfo_sequence[] = {
+  { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_cms_contentType },
+  { BER_CLASS_ANY, 0, 0, dissect_hf_cms_contentType_content },
+  { 0, 0, 0, NULL }
+};
+
+int
+dissect_cms_ContentInfo(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,
+                                ContentInfo_sequence, hf_index, ett_cms_ContentInfo);
+
+  return offset;
+}
+
+
 /*--- proto_register_cms ----------------------------------------------*/
 void proto_register_cms(void) {
 
   /* List of fields */
   static hf_register_info hf[] = {
+    { &hf_cms_ci_contentType,
+      { "contentType", "cms.contentInfo.contentType",
+        FT_STRING, BASE_NONE, NULL, 0,
+        "ContentType", HFILL }},
     { &hf_cms_keyAttr_id,
       { "keyAttr_id", "cms.keyAttr_id",
         FT_STRING, BASE_NONE, NULL, 0,
@@ -132,6 +172,7 @@ void proto_register_cms(void) {
 
   /* List of subtrees */
   static gint *ett[] = {
+       &ett_cms_ContentInfo,
 #include "packet-cms-ettarr.c"
   };
 
index 69139792be69b75e15a98e38660f81bdaee5cec1..e44775a9b6927c099cb7abfb7ab796b6aed64e07 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef PACKET_CMS_H
 #define PACKET_CMS_H
 
+int dissect_cms_ContentInfo(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index);
+
 #include "packet-cms-exp.h"
 
 #endif  /* PACKET_CMS_H */