diff options
author | Gerald Combs <gerald@wireshark.org> | 2004-10-28 22:06:55 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2004-10-28 22:06:55 +0000 |
commit | 24f30a8850a1f11ae2470fd5124e827f443fa62b (patch) | |
tree | be8e613482626efd38c3c9d08cef55bdfb5d0051 /asn1/cms/packet-cms-template.c | |
parent | bef8e01fcdfb99155406d7b53500f4764dffbc1a (diff) |
Add support for pkauthdata and pkdhkeydata OIDs.
svn path=/trunk/; revision=12426
Diffstat (limited to 'asn1/cms/packet-cms-template.c')
-rw-r--r-- | asn1/cms/packet-cms-template.c | 64 |
1 files changed, 56 insertions, 8 deletions
diff --git a/asn1/cms/packet-cms-template.c b/asn1/cms/packet-cms-template.c index 7be19a3065..600b0b004e 100644 --- a/asn1/cms/packet-cms-template.c +++ b/asn1/cms/packet-cms-template.c @@ -46,6 +46,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; #include "packet-cms-hf.c" /* Initialize the subtree pointers */ @@ -59,16 +60,16 @@ static int dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tv 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); @@ -93,15 +94,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); @@ -123,6 +124,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) { @@ -132,6 +175,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, @@ -142,6 +189,7 @@ void proto_register_cms(void) { /* List of subtrees */ static gint *ett[] = { &ett_cms_ContentInfo, + &ett_cms_EncapsulatedContentInfo, #include "packet-cms-ettarr.c" }; |