diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-09-16 09:01:20 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-09-16 09:01:20 +0000 |
commit | 5ef0b5c88d0a1903b2e484f2124897f30a3af225 (patch) | |
tree | 15b73a65468644185f9ccaa764a1147da534935a /epan/dissectors/packet-cms.c | |
parent | 0388e3cd12bd3f59422200ceb1dd9eb287c77e01 (diff) |
add new dissectors to build process
update Kerberos to call PKINIT (and remove the handwritten incomplete one inside packet-kerberos.c)
svn path=/trunk/; revision=12014
Diffstat (limited to 'epan/dissectors/packet-cms.c')
-rw-r--r-- | epan/dissectors/packet-cms.c | 74 |
1 files changed, 46 insertions, 28 deletions
diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c index 6d8d539e87..4fdb1f8070 100644 --- a/epan/dissectors/packet-cms.c +++ b/epan/dissectors/packet-cms.c @@ -1,10 +1,9 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* packet-cms.c */ -/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ +/* ./packet-cms.c */ +/* ../../tools/asn2eth.py -e -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ /* Input file: packet-cms-template.c */ -/* Include files: packet-cms-hf.c, packet-cms-ett.c, packet-cms-fn.c, packet-cms-hfarr.c, packet-cms-ettarr.c, packet-cms-val.h */ /* packet-cms.c * Routines for RFC2630 Cryptographic Message Syntax packet dissection @@ -53,14 +52,10 @@ /* Initialize the protocol and registered fields */ int proto_cms = -1; static int hf_cms_keyAttr_id = -1; +static int hf_cms_ci_contentType = -1; /*--- Included file: packet-cms-hf.c ---*/ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* packet-cms-hf.c */ -/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ - static int hf_cms_version = -1; /* CMSVersion */ static int hf_cms_digestAlgorithms = -1; /* DigestAlgorithmIdentifiers */ static int hf_cms_encapContentInfo = -1; /* EncapsulatedContentInfo */ @@ -133,14 +128,10 @@ static int hf_cms_attributes = -1; /* UnauthAttributes */ /* Initialize the subtree pointers */ +static gint ett_cms_ContentInfo = -1; /*--- Included file: packet-cms-ett.c ---*/ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* packet-cms-ett.c */ -/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ - static gint ett_cms_SignedData = -1; static gint ett_cms_DigestAlgorithmIdentifiers = -1; static gint ett_cms_SignerInfos = -1; @@ -189,10 +180,7 @@ static int dissect_cms_OtherKeyAttribute(gboolean implicit_tag _U_, tvbuff_t *tv /*--- Included file: packet-cms-fn.c ---*/ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* packet-cms-fn.c */ -/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ +/*--- Fields for imported types ---*/ static int dissect_algorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_algorithm); @@ -213,6 +201,7 @@ static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t * return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber); } + static int dissect_cms_ContentType(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, @@ -492,7 +481,7 @@ static ber_sequence IssuerAndSerialNumber_sequence[] = { { 0, 0, 0, NULL } }; -static int +int dissect_cms_IssuerAndSerialNumber(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, IssuerAndSerialNumber_sequence, hf_index, ett_cms_IssuerAndSerialNumber); @@ -1224,11 +1213,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, @@ -1236,11 +1263,6 @@ void proto_register_cms(void) { /*--- Included file: packet-cms-hfarr.c ---*/ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* packet-cms-hfarr.c */ -/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ - { &hf_cms_version, { "version", "cms.version", FT_INT32, BASE_DEC, VALS(CMSVersion_vals), 0, @@ -1516,14 +1538,10 @@ void proto_register_cms(void) { /* List of subtrees */ static gint *ett[] = { + &ett_cms_ContentInfo, /*--- Included file: packet-cms-ettarr.c ---*/ -/* Do not modify this file. */ -/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ -/* packet-cms-ettarr.c */ -/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ - &ett_cms_SignedData, &ett_cms_DigestAlgorithmIdentifiers, &ett_cms_SignerInfos, |