diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-09-16 08:31:01 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-09-16 08:31:01 +0000 |
commit | 4cb62f797de426a114666e27ff0996da8b42365c (patch) | |
tree | 6ea2cca53d51d3ae3cbd08d848eee7960788de20 /asn1/cms/packet-cms-template.c | |
parent | 2d444f2c6e5a05a14c169ba42c512e3b52670caf (diff) |
Update to CMD to prepare for PKINIT support
svn path=/trunk/; revision=12009
Diffstat (limited to 'asn1/cms/packet-cms-template.c')
-rw-r--r-- | asn1/cms/packet-cms-template.c | 41 |
1 files changed, 41 insertions, 0 deletions
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" }; |