diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-09-16 08:31:01 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-09-16 08:31:01 +0000 |
commit | 6a310cf01eab0c876812c29548996d82a4bb6710 (patch) | |
tree | 6ea2cca53d51d3ae3cbd08d848eee7960788de20 /asn1/cms | |
parent | 03431f37123954c5a070a48d8da0e3ca7fab591d (diff) |
Update to CMD to prepare for PKINIT support
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12009 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1/cms')
-rwxr-xr-x | asn1/cms/CryptographicMessageSyntax.asn | 11 | ||||
-rw-r--r-- | asn1/cms/cms.cnf | 1 | ||||
-rw-r--r-- | asn1/cms/cms_exp.cnf | 19 | ||||
-rw-r--r-- | asn1/cms/packet-cms-template.c | 41 | ||||
-rw-r--r-- | asn1/cms/packet-cms-template.h | 2 |
5 files changed, 71 insertions, 3 deletions
diff --git a/asn1/cms/CryptographicMessageSyntax.asn b/asn1/cms/CryptographicMessageSyntax.asn index 9d3581fe9f..03e2c7c809 100755 --- a/asn1/cms/CryptographicMessageSyntax.asn +++ b/asn1/cms/CryptographicMessageSyntax.asn @@ -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 diff --git a/asn1/cms/cms.cnf b/asn1/cms/cms.cnf index af0add8e87..cd01fc1170 100644 --- a/asn1/cms/cms.cnf +++ b/asn1/cms/cms.cnf @@ -13,6 +13,7 @@ InformationFramework x509if #.EXPORTS
SignedData
Countersignature
+IssuerAndSerialNumber
#.NO_EMIT
OtherKeyAttribute
diff --git a/asn1/cms/cms_exp.cnf b/asn1/cms/cms_exp.cnf new file mode 100644 index 0000000000..97673d6923 --- /dev/null +++ b/asn1/cms/cms_exp.cnf @@ -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 + diff --git a/asn1/cms/packet-cms-template.c b/asn1/cms/packet-cms-template.c index 7cb7c29559..bbb517b6bf 100644 --- a/asn1/cms/packet-cms-template.c +++ b/asn1/cms/packet-cms-template.c @@ -45,9 +45,11 @@ /* 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" }; diff --git a/asn1/cms/packet-cms-template.h b/asn1/cms/packet-cms-template.h index 69139792be..e44775a9b6 100644 --- a/asn1/cms/packet-cms-template.h +++ b/asn1/cms/packet-cms-template.h @@ -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 */ |