diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-07-25 10:34:07 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-07-25 10:34:07 +0000 |
commit | 2d069de8b482de3c111cf68c7c50bc257e53ac8e (patch) | |
tree | c7208543db966fff00229a1b7c02d573bcf3bbdd /asn1/cms/packet-cms-template.c | |
parent | a4ab30088af7b247b2646e3559d9e336a98a75a6 (diff) |
large CMS update.
most of cms is now implemented
svn path=/trunk/; revision=11518
Diffstat (limited to 'asn1/cms/packet-cms-template.c')
-rw-r--r-- | asn1/cms/packet-cms-template.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/asn1/cms/packet-cms-template.c b/asn1/cms/packet-cms-template.c index eae4c3ada9..4ff14cb735 100644 --- a/asn1/cms/packet-cms-template.c +++ b/asn1/cms/packet-cms-template.c @@ -43,25 +43,89 @@ /* Initialize the protocol and registered fields */ int proto_cms = -1; +static int hf_cms_keyAttr_id = -1; #include "packet-cms-hf.c" /* Initialize the subtree pointers */ #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); + + #include "packet-cms-fn.c" +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) +{ + 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) +{ + offset=call_ber_oid_callback(keyAttr_id, tvb, offset, pinfo, tree); + + return offset; +} + +static ber_sequence OtherKeyAttribute_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_keyAttrId }, + { BER_CLASS_ANY, 0, 0, dissect_keyAttr_type }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_OtherKeyAttribute(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, + OtherKeyAttribute_sequence, hf_index, ett_cms_OtherKeyAttribute); + + return offset; +} + static void dissect_cms_SignedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { dissect_cms_SignedData(FALSE, tvb, 0, pinfo, tree, -1); } +static void +dissect_cms_EnvelopedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_cms_EnvelopedData(FALSE, tvb, 0, pinfo, tree, -1); +} + +static void +dissect_cms_DigestedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_cms_DigestedData(FALSE, tvb, 0, pinfo, tree, -1); +} + + +static void +dissect_cms_EncryptedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_cms_EncryptedData(FALSE, tvb, 0, pinfo, tree, -1); +} + +static void +dissect_cms_AuthenticatedData_callback(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_cms_AuthenticatedData(FALSE, tvb, 0, pinfo, tree, -1); +} + /*--- proto_register_cms ----------------------------------------------*/ void proto_register_cms(void) { /* List of fields */ static hf_register_info hf[] = { + { &hf_cms_keyAttr_id, + { "keyAttr_id", "cms.keyAttr_id", + FT_STRING, BASE_NONE, NULL, 0, + "keyAttr_id", HFILL }}, #include "packet-cms-hfarr.c" }; @@ -83,5 +147,9 @@ void proto_register_cms(void) { /*--- proto_reg_handoff_cms -------------------------------------------*/ void proto_reg_handoff_cms(void) { register_ber_oid_dissector("1.2.840.113549.1.7.2", dissect_cms_SignedData_callback, proto_cms, "id-signedData"); + register_ber_oid_dissector("1.2.840.113549.1.7.3", dissect_cms_EnvelopedData_callback, proto_cms, "id-envelopedData"); + register_ber_oid_dissector("1.2.840.113549.1.7.5", dissect_cms_DigestedData_callback, proto_cms, "id-digestedData"); + register_ber_oid_dissector("1.2.840.113549.1.7.6", dissect_cms_EncryptedData_callback, proto_cms, "id-encryptedData"); + register_ber_oid_dissector("1.2.840.113549.1.9.16.1.2", dissect_cms_AuthenticatedData_callback, proto_cms, "id-ct-authenticatedData"); } |