diff options
author | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-07-20 09:11:40 +0000 |
---|---|---|
committer | sahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-07-20 09:11:40 +0000 |
commit | f237adaa981dce1cbc65b19737f324647d788abe (patch) | |
tree | 0837b1c968637c9b65a5a26b6b11228ed92528da /epan | |
parent | 6866ed217f2df43683c2facf56034045e44a1994 (diff) |
Add the new protocols CMS, X509AF, X509IF, X509CE and X509SAT
to the ethereal build.
The dissections are semi-useful but incomplete.
The big problem still remaining is the x509if Name object not being
dissected properly thus causing the dissection to get out of sync/fail
halfway through the certificate structure.
work in progress but already semi-useful.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11440 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/Makefile.common | 10 | ||||
-rw-r--r-- | epan/dissectors/packet-ber.c | 44 | ||||
-rw-r--r-- | epan/dissectors/packet-ber.h | 6 | ||||
-rw-r--r-- | epan/dissectors/packet-cms.c | 845 | ||||
-rw-r--r-- | epan/dissectors/packet-cms.h | 50 | ||||
-rw-r--r-- | epan/dissectors/packet-kerberos.c | 23 | ||||
-rw-r--r-- | epan/dissectors/packet-x509af.c | 1231 | ||||
-rw-r--r-- | epan/dissectors/packet-x509af.h | 55 | ||||
-rw-r--r-- | epan/dissectors/packet-x509ce.c | 256 | ||||
-rw-r--r-- | epan/dissectors/packet-x509ce.h | 50 | ||||
-rw-r--r-- | epan/dissectors/packet-x509if.c | 332 | ||||
-rw-r--r-- | epan/dissectors/packet-x509if.h | 54 | ||||
-rw-r--r-- | epan/dissectors/packet-x509sat.c | 227 | ||||
-rw-r--r-- | epan/dissectors/packet-x509sat.h | 50 |
14 files changed, 3219 insertions, 14 deletions
diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index 7a614d1bdf..03ddacf682 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -93,6 +93,7 @@ DISSECTOR_SRC = \ packet-clearcase.c \ packet-clip.c \ packet-clnp.c \ + packet-cms.c \ packet-cops.c \ packet-cosine.c \ packet-cpfi.c \ @@ -485,6 +486,10 @@ DISSECTOR_SRC = \ packet-x11.c \ packet-x25.c \ packet-x29.c \ + packet-x509af.c \ + packet-x509ce.c \ + packet-x509if.c \ + packet-x509sat.c \ packet-xdmcp.c \ packet-xot.c \ packet-xyplex.c \ @@ -519,6 +524,7 @@ DISSECTOR_INCLUDES = \ packet-chdlc.h \ packet-clearcase.h \ packet-clip.h \ + packet-cms.h \ packet-data.h \ packet-dccp.h \ packet-dcerpc-atsvc.h \ @@ -678,6 +684,10 @@ DISSECTOR_INCLUDES = \ packet-wtp.h \ packet-x11-keysym.h \ packet-x11-keysymdef.h \ + packet-x509af.h \ + packet-x509ce.h \ + packet-x509if.h \ + packet-x509sat.h \ packet-ypbind.h \ packet-yppasswd.h \ packet-ypserv.h \ diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index b681b9bdc0..57e44be15f 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -113,6 +113,50 @@ proto_item *get_ber_last_created_item(void) { return ber_last_created_item; } + +/* + * Code to handle to OID ber callback array + * done here explicitely since the dissector tables can not (yet) deal + * with "ports" that are strings. + */ +typedef struct _ber_oid_callback_list_t { + struct _ber_oid_callback_list_t *next; + char *oid; + ber_oid_callback func; +} ber_oid_callback_list_t; +static ber_oid_callback_list_t *ber_oid_callbacks=NULL; + +void +register_ber_oid_callback(char *oid, ber_oid_callback func) +{ + ber_oid_callback_list_t *boc; + + boc=g_malloc(sizeof(ber_oid_callback_list_t)); + boc->next=ber_oid_callbacks; + boc->func=func; + boc->oid=g_strdup(oid); + ber_oid_callbacks=boc; +} + +int +invoke_ber_oid_callback(char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) +{ + ber_oid_callback_list_t *boc; + for(boc=ber_oid_callbacks;boc;boc=boc->next){ + if(!strcmp(boc->oid, oid)){ + offset=boc->func(tvb, offset, pinfo, tree); + return offset; + } + } + proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "BER: Dissector for OID:%s unknown", oid); + + return offset; +} + + + + + static int dissect_ber_sq_of(gboolean implicit_tag, guint32 type, packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *tvb, int offset, ber_sequence *seq, gint hf_id, gint ett_id); /* 8.1 General rules for encoding */ diff --git a/epan/dissectors/packet-ber.h b/epan/dissectors/packet-ber.h index 5d00016602..e8230b1ded 100644 --- a/epan/dissectors/packet-ber.h +++ b/epan/dissectors/packet-ber.h @@ -158,4 +158,10 @@ extern int dissect_ber_bitstring32(gboolean implicit_tag, packet_info *pinfo, pr extern proto_item *ber_last_created_item; extern proto_item *get_ber_last_created_item(void); + +typedef int (*ber_oid_callback)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); + +void register_ber_oid_callback(char *oid, ber_oid_callback func); +int invoke_ber_oid_callback(char *oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); + #endif /* __PACKET_BER_H__ */ diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c new file mode 100644 index 0000000000..bb11640702 --- /dev/null +++ b/epan/dissectors/packet-cms.c @@ -0,0 +1,845 @@ +/* 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 */ + +/* 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 + * + * $Id: packet-cms-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" +#include "packet-cms.h" +#include "packet-x509af.h" + +#define PNAME "Cryptographic Message Syntax" +#define PSNAME "CMS" +#define PFNAME "cms" + +/* Initialize the protocol and registered fields */ +int proto_cms = -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 */ +static int hf_cms_certificates = -1; /* CertificateSet */ +static int hf_cms_crls = -1; /* CertificateRevocationLists */ +static int hf_cms_signerInfos = -1; /* SignerInfos */ +static int hf_cms_DigestAlgorithmIdentifiers_item = -1; /* DigestAlgorithmIdentifier */ +static int hf_cms_SignerInfos_item = -1; /* SignerInfo */ +static int hf_cms_eContentType = -1; /* ContentType */ +static int hf_cms_eContent = -1; /* OCTET_STRING */ +static int hf_cms_sid = -1; /* SignerIdentifier */ +static int hf_cms_digestAlgorithm = -1; /* DigestAlgorithmIdentifier */ +static int hf_cms_signedAttrs = -1; /* SignedAttributes */ +static int hf_cms_signatureAlgorithm = -1; /* SignatureAlgorithmIdentifier */ +static int hf_cms_signature = -1; /* SignatureValue */ +static int hf_cms_unsignedAttrs = -1; /* UnsignedAttributes */ +static int hf_cms_issuerAndSerialNumber = -1; /* IssuerAndSerialNumber */ +static int hf_cms_subjectKeyIdentifier = -1; /* SubjectKeyIdentifier */ +static int hf_cms_SignedAttributes_item = -1; /* Attribute */ +static int hf_cms_UnsignedAttributes_item = -1; /* Attribute */ +static int hf_cms_attrType = -1; /* OBJECT_IDENTIFIER */ +static int hf_cms_AuthAttributes_item = -1; /* Attribute */ +static int hf_cms_UnauthAttributes_item = -1; /* Attribute */ +static int hf_cms_CertificateRevocationLists_item = -1; /* CertificateList */ +static int hf_cms_certificate = -1; /* Certificate */ +static int hf_cms_extendedCertificate = -1; /* ExtendedCertificate */ +static int hf_cms_attrCert = -1; /* AttributeCertificate */ +static int hf_cms_CertificateSet_item = -1; /* CertificateChoices */ +static int hf_cms_serialNumber = -1; /* CertificateSerialNumber */ +static int hf_cms_extendedCertificateInfo = -1; /* ExtendedCertificateInfo */ +static int hf_cms_signature1 = -1; /* Signature */ +static int hf_cms_attributes = -1; /* UnauthAttributes */ + +/*--- End of included file: packet-cms-hf.c ---*/ + + +/* Initialize the subtree pointers */ + +/*--- 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; +static gint ett_cms_EncapsulatedContentInfo = -1; +static gint ett_cms_SignerInfo = -1; +static gint ett_cms_SignerIdentifier = -1; +static gint ett_cms_SignedAttributes = -1; +static gint ett_cms_UnsignedAttributes = -1; +static gint ett_cms_Attribute = -1; +static gint ett_cms_RecipientIdentifier = -1; +static gint ett_cms_AuthAttributes = -1; +static gint ett_cms_UnauthAttributes = -1; +static gint ett_cms_CertificateRevocationLists = -1; +static gint ett_cms_CertificateChoices = -1; +static gint ett_cms_CertificateSet = -1; +static gint ett_cms_IssuerAndSerialNumber = -1; +static gint ett_cms_ExtendedCertificate = -1; +static gint ett_cms_ExtendedCertificateInfo = -1; + +/*--- End of included file: packet-cms-ett.c ---*/ + + + +/*--- 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 */ + +static int dissect_CertificateRevocationLists_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CertificateList(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateRevocationLists_item); +} +static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_cms_certificate); +} +static int dissect_attrCert_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AttributeCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_attrCert); +} +static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_serialNumber); +} + +static int +dissect_cms_ContentType(gboolean implicit_tag, 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, + hf_index, NULL); + + return offset; +} +static int dissect_eContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_ContentType(FALSE, tvb, offset, pinfo, tree, hf_cms_eContentType); +} + + +static const value_string CMSVersion_vals[] = { + { 0, "v0" }, + { 1, "v1" }, + { 2, "v2" }, + { 3, "v3" }, + { 4, "v4" }, + { 0, NULL } +}; + + +static int +dissect_cms_CMSVersion(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_integer(pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_CMSVersion(FALSE, tvb, offset, pinfo, tree, hf_cms_version); +} + + +static int +dissect_cms_DigestAlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} +static int dissect_DigestAlgorithmIdentifiers_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_DigestAlgorithmIdentifiers_item); +} +static int dissect_digestAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_DigestAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithm); +} + +static ber_sequence DigestAlgorithmIdentifiers_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_DigestAlgorithmIdentifiers_item }, +}; + +static int +dissect_cms_DigestAlgorithmIdentifiers(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + DigestAlgorithmIdentifiers_set_of, hf_index, ett_cms_DigestAlgorithmIdentifiers); + + return offset; +} +static int dissect_digestAlgorithms(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_DigestAlgorithmIdentifiers(FALSE, tvb, offset, pinfo, tree, hf_cms_digestAlgorithms); +} + + +static int +dissect_cms_OCTET_STRING(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_eContent(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_cms_eContent); +} + +static ber_sequence EncapsulatedContentInfo_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_eContentType }, + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_eContent }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_EncapsulatedContentInfo(gboolean implicit_tag, 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, + EncapsulatedContentInfo_sequence, hf_index, ett_cms_EncapsulatedContentInfo); + + return offset; +} +static int dissect_encapContentInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_EncapsulatedContentInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_encapContentInfo); +} + + +static int +dissect_cms_OBJECT_IDENTIFIER(gboolean implicit_tag, 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, + hf_index, NULL); + + return offset; +} +static int dissect_attrType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_cms_attrType); +} + +static ber_sequence Attribute_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_attrType }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_Attribute(gboolean implicit_tag, 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, + Attribute_sequence, hf_index, ett_cms_Attribute); + + return offset; +} +static int dissect_SignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_SignedAttributes_item); +} +static int dissect_UnsignedAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnsignedAttributes_item); +} +static int dissect_AuthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_AuthAttributes_item); +} +static int dissect_UnauthAttributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_Attribute(FALSE, tvb, offset, pinfo, tree, hf_cms_UnauthAttributes_item); +} + +static ber_sequence UnauthAttributes_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnauthAttributes_item }, +}; + +static int +dissect_cms_UnauthAttributes(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + UnauthAttributes_set_of, hf_index, ett_cms_UnauthAttributes); + + return offset; +} +static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_UnauthAttributes(FALSE, tvb, offset, pinfo, tree, hf_cms_attributes); +} + +static ber_sequence ExtendedCertificateInfo_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate }, + { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_attributes }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_ExtendedCertificateInfo(gboolean implicit_tag, 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, + ExtendedCertificateInfo_sequence, hf_index, ett_cms_ExtendedCertificateInfo); + + return offset; +} +static int dissect_extendedCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_ExtendedCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_extendedCertificateInfo); +} + + +static int +dissect_cms_SignatureAlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} +static int dissect_signatureAlgorithm(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SignatureAlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_signatureAlgorithm); +} + + +static int +dissect_cms_Signature(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, + NULL, hf_index, -1, + NULL); + + return offset; +} +static int dissect_signature1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_Signature(FALSE, tvb, offset, pinfo, tree, hf_cms_signature1); +} + +static ber_sequence ExtendedCertificate_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_extendedCertificateInfo }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_signature1 }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_ExtendedCertificate(gboolean implicit_tag, 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, + ExtendedCertificate_sequence, hf_index, ett_cms_ExtendedCertificate); + + return offset; +} +static int dissect_extendedCertificate_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_ExtendedCertificate(TRUE, tvb, offset, pinfo, tree, hf_cms_extendedCertificate); +} + + +static const value_string CertificateChoices_vals[] = { + { 0, "certificate" }, + { 1, "extendedCertificate" }, + { 2, "attrCert" }, + { 0, NULL } +}; + +static ber_choice CertificateChoices_choice[] = { + { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_certificate }, + { 1, BER_CLASS_CON, 0, BER_FLAGS_IMPLTAG, dissect_extendedCertificate_impl }, + { 2, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_attrCert_impl }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_cms_CertificateChoices(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + CertificateChoices_choice, hf_index, ett_cms_CertificateChoices); + + return offset; +} +static int dissect_CertificateSet_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_CertificateChoices(FALSE, tvb, offset, pinfo, tree, hf_cms_CertificateSet_item); +} + +static ber_sequence CertificateSet_set_of[1] = { + { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_CertificateSet_item }, +}; + +static int +dissect_cms_CertificateSet(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + CertificateSet_set_of, hf_index, ett_cms_CertificateSet); + + return offset; +} +static int dissect_certificates_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_CertificateSet(TRUE, tvb, offset, pinfo, tree, hf_cms_certificates); +} + +static ber_sequence CertificateRevocationLists_set_of[1] = { + { -1 /*imported*/, -1 /*imported*/, BER_FLAGS_NOOWNTAG, dissect_CertificateRevocationLists_item }, +}; + +static int +dissect_cms_CertificateRevocationLists(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + CertificateRevocationLists_set_of, hf_index, ett_cms_CertificateRevocationLists); + + return offset; +} +static int dissect_crls_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_CertificateRevocationLists(TRUE, tvb, offset, pinfo, tree, hf_cms_crls); +} + +static ber_sequence IssuerAndSerialNumber_sequence[] = { + { -1 /*imported*/, -1 /*imported*/, BER_FLAGS_NOOWNTAG, dissect_serialNumber }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_IssuerAndSerialNumber(gboolean implicit_tag, 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); + + return offset; +} +static int dissect_issuerAndSerialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_IssuerAndSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_cms_issuerAndSerialNumber); +} + + +static int +dissect_cms_SubjectKeyIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_subjectKeyIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SubjectKeyIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_subjectKeyIdentifier); +} + + +static const value_string SignerIdentifier_vals[] = { + { 0, "issuerAndSerialNumber" }, + { 1, "subjectKeyIdentifier" }, + { 0, NULL } +}; + +static ber_choice SignerIdentifier_choice[] = { + { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber }, + { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_cms_SignerIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + SignerIdentifier_choice, hf_index, ett_cms_SignerIdentifier); + + return offset; +} +static int dissect_sid(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SignerIdentifier(FALSE, tvb, offset, pinfo, tree, hf_cms_sid); +} + +static ber_sequence SignedAttributes_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignedAttributes_item }, +}; + +static int +dissect_cms_SignedAttributes(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + SignedAttributes_set_of, hf_index, ett_cms_SignedAttributes); + + return offset; +} +static int dissect_signedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_signedAttrs); +} + + +static int +dissect_cms_SignatureValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SignatureValue(FALSE, tvb, offset, pinfo, tree, hf_cms_signature); +} + +static ber_sequence UnsignedAttributes_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_UnsignedAttributes_item }, +}; + +static int +dissect_cms_UnsignedAttributes(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + UnsignedAttributes_set_of, hf_index, ett_cms_UnsignedAttributes); + + return offset; +} +static int dissect_unsignedAttrs_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_UnsignedAttributes(TRUE, tvb, offset, pinfo, tree, hf_cms_unsignedAttrs); +} + +static ber_sequence SignerInfo_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version }, + { -1/*choice*/ , -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_sid }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithm }, + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_signedAttrs_impl }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signatureAlgorithm }, + { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_signature }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_unsignedAttrs_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_cms_SignerInfo(gboolean implicit_tag, 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, + SignerInfo_sequence, hf_index, ett_cms_SignerInfo); + + return offset; +} +static int dissect_SignerInfos_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SignerInfo(FALSE, tvb, offset, pinfo, tree, hf_cms_SignerInfos_item); +} + +static ber_sequence SignerInfos_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_SignerInfos_item }, +}; + +static int +dissect_cms_SignerInfos(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + SignerInfos_set_of, hf_index, ett_cms_SignerInfos); + + return offset; +} +static int dissect_signerInfos(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_cms_SignerInfos(FALSE, tvb, offset, pinfo, tree, hf_cms_signerInfos); +} + +static ber_sequence SignedData_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_version }, + { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_digestAlgorithms }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_encapContentInfo }, + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_certificates_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_crls_impl }, + { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_signerInfos }, + { 0, 0, 0, NULL } +}; + +int +dissect_cms_SignedData(gboolean implicit_tag, 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, + SignedData_sequence, hf_index, ett_cms_SignedData); + + return offset; +} + + +static const value_string RecipientIdentifier_vals[] = { + { 0, "issuerAndSerialNumber" }, + { 1, "subjectKeyIdentifier" }, + { 0, NULL } +}; + +static ber_choice RecipientIdentifier_choice[] = { + { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuerAndSerialNumber }, + { 1, BER_CLASS_CON, 0, 0, dissect_subjectKeyIdentifier }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_cms_RecipientIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + RecipientIdentifier_choice, hf_index, ett_cms_RecipientIdentifier); + + return offset; +} + + +static int +dissect_cms_Digest(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} + +static ber_sequence AuthAttributes_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_AuthAttributes_item }, +}; + +static int +dissect_cms_AuthAttributes(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + AuthAttributes_set_of, hf_index, ett_cms_AuthAttributes); + + return offset; +} + + +static int +dissect_cms_MessageAuthenticationCode(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} + + +static int +dissect_cms_KeyEncryptionAlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} + + +static int +dissect_cms_ContentEncryptionAlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} + + +static int +dissect_cms_MessageAuthenticationCodeAlgorithm(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} + + +static int +dissect_cms_Countersignature(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_cms_SignerInfo(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} + + +/*--- End of included file: packet-cms-fn.c ---*/ + + + +static int +dissect_cms_SignedData_callback(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) +{ + offset=dissect_cms_SignedData(FALSE, tvb, offset, pinfo, tree, -1); + return offset; +} + +/*--- proto_register_cms ----------------------------------------------*/ +void proto_register_cms(void) { + + /* List of fields */ + static hf_register_info hf[] = { + +/*--- 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, + "", HFILL }}, + { &hf_cms_digestAlgorithms, + { "digestAlgorithms", "cms.digestAlgorithms", + FT_UINT32, BASE_DEC, NULL, 0, + "SignedData/digestAlgorithms", HFILL }}, + { &hf_cms_encapContentInfo, + { "encapContentInfo", "cms.encapContentInfo", + FT_NONE, BASE_NONE, NULL, 0, + "SignedData/encapContentInfo", HFILL }}, + { &hf_cms_certificates, + { "certificates", "cms.certificates", + FT_UINT32, BASE_DEC, NULL, 0, + "SignedData/certificates", HFILL }}, + { &hf_cms_crls, + { "crls", "cms.crls", + FT_UINT32, BASE_DEC, NULL, 0, + "SignedData/crls", HFILL }}, + { &hf_cms_signerInfos, + { "signerInfos", "cms.signerInfos", + FT_UINT32, BASE_DEC, NULL, 0, + "SignedData/signerInfos", HFILL }}, + { &hf_cms_DigestAlgorithmIdentifiers_item, + { "Item(##)", "cms.DigestAlgorithmIdentifiers_item", + FT_NONE, BASE_NONE, NULL, 0, + "DigestAlgorithmIdentifiers/_item", HFILL }}, + { &hf_cms_SignerInfos_item, + { "Item(##)", "cms.SignerInfos_item", + FT_NONE, BASE_NONE, NULL, 0, + "SignerInfos/_item", HFILL }}, + { &hf_cms_eContentType, + { "eContentType", "cms.eContentType", + FT_STRING, BASE_NONE, NULL, 0, + "EncapsulatedContentInfo/eContentType", HFILL }}, + { &hf_cms_eContent, + { "eContent", "cms.eContent", + FT_BYTES, BASE_HEX, NULL, 0, + "EncapsulatedContentInfo/eContent", HFILL }}, + { &hf_cms_sid, + { "sid", "cms.sid", + FT_UINT32, BASE_DEC, VALS(SignerIdentifier_vals), 0, + "SignerInfo/sid", HFILL }}, + { &hf_cms_digestAlgorithm, + { "digestAlgorithm", "cms.digestAlgorithm", + FT_NONE, BASE_NONE, NULL, 0, + "SignerInfo/digestAlgorithm", HFILL }}, + { &hf_cms_signedAttrs, + { "signedAttrs", "cms.signedAttrs", + FT_UINT32, BASE_DEC, NULL, 0, + "SignerInfo/signedAttrs", HFILL }}, + { &hf_cms_signatureAlgorithm, + { "signatureAlgorithm", "cms.signatureAlgorithm", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_cms_signature, + { "signature", "cms.signature", + FT_BYTES, BASE_HEX, NULL, 0, + "SignerInfo/signature", HFILL }}, + { &hf_cms_unsignedAttrs, + { "unsignedAttrs", "cms.unsignedAttrs", + FT_UINT32, BASE_DEC, NULL, 0, + "SignerInfo/unsignedAttrs", HFILL }}, + { &hf_cms_issuerAndSerialNumber, + { "issuerAndSerialNumber", "cms.issuerAndSerialNumber", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_cms_subjectKeyIdentifier, + { "subjectKeyIdentifier", "cms.subjectKeyIdentifier", + FT_BYTES, BASE_HEX, NULL, 0, + "", HFILL }}, + { &hf_cms_SignedAttributes_item, + { "Item(##)", "cms.SignedAttributes_item", + FT_NONE, BASE_NONE, NULL, 0, + "SignedAttributes/_item", HFILL }}, + { &hf_cms_UnsignedAttributes_item, + { "Item(##)", "cms.UnsignedAttributes_item", + FT_NONE, BASE_NONE, NULL, 0, + "UnsignedAttributes/_item", HFILL }}, + { &hf_cms_attrType, + { "attrType", "cms.attrType", + FT_STRING, BASE_NONE, NULL, 0, + "Attribute/attrType", HFILL }}, + { &hf_cms_AuthAttributes_item, + { "Item(##)", "cms.AuthAttributes_item", + FT_NONE, BASE_NONE, NULL, 0, + "AuthAttributes/_item", HFILL }}, + { &hf_cms_UnauthAttributes_item, + { "Item(##)", "cms.UnauthAttributes_item", + FT_NONE, BASE_NONE, NULL, 0, + "UnauthAttributes/_item", HFILL }}, + { &hf_cms_CertificateRevocationLists_item, + { "Item(##)", "cms.CertificateRevocationLists_item", + FT_NONE, BASE_NONE, NULL, 0, + "CertificateRevocationLists/_item", HFILL }}, + { &hf_cms_certificate, + { "certificate", "cms.certificate", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_cms_extendedCertificate, + { "extendedCertificate", "cms.extendedCertificate", + FT_NONE, BASE_NONE, NULL, 0, + "CertificateChoices/extendedCertificate", HFILL }}, + { &hf_cms_attrCert, + { "attrCert", "cms.attrCert", + FT_NONE, BASE_NONE, NULL, 0, + "CertificateChoices/attrCert", HFILL }}, + { &hf_cms_CertificateSet_item, + { "Item(##)", "cms.CertificateSet_item", + FT_UINT32, BASE_DEC, VALS(CertificateChoices_vals), 0, + "CertificateSet/_item", HFILL }}, + { &hf_cms_serialNumber, + { "serialNumber", "cms.serialNumber", + FT_NONE, BASE_NONE, NULL, 0, + "IssuerAndSerialNumber/serialNumber", HFILL }}, + { &hf_cms_extendedCertificateInfo, + { "extendedCertificateInfo", "cms.extendedCertificateInfo", + FT_NONE, BASE_NONE, NULL, 0, + "ExtendedCertificate/extendedCertificateInfo", HFILL }}, + { &hf_cms_signature1, + { "signature", "cms.signature", + FT_BYTES, BASE_HEX, NULL, 0, + "ExtendedCertificate/signature", HFILL }}, + { &hf_cms_attributes, + { "attributes", "cms.attributes", + FT_UINT32, BASE_DEC, NULL, 0, + "ExtendedCertificateInfo/attributes", HFILL }}, + +/*--- End of included file: packet-cms-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + +/*--- 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, + &ett_cms_EncapsulatedContentInfo, + &ett_cms_SignerInfo, + &ett_cms_SignerIdentifier, + &ett_cms_SignedAttributes, + &ett_cms_UnsignedAttributes, + &ett_cms_Attribute, + &ett_cms_RecipientIdentifier, + &ett_cms_AuthAttributes, + &ett_cms_UnauthAttributes, + &ett_cms_CertificateRevocationLists, + &ett_cms_CertificateChoices, + &ett_cms_CertificateSet, + &ett_cms_IssuerAndSerialNumber, + &ett_cms_ExtendedCertificate, + &ett_cms_ExtendedCertificateInfo, + +/*--- End of included file: packet-cms-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_cms = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_cms, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_cms -------------------------------------------*/ +void proto_reg_handoff_cms(void) { + register_ber_oid_callback("1.2.840.113549.1.7.2", dissect_cms_SignedData_callback); +} + diff --git a/epan/dissectors/packet-cms.h b/epan/dissectors/packet-cms.h new file mode 100644 index 0000000000..5f3a0e61d9 --- /dev/null +++ b/epan/dissectors/packet-cms.h @@ -0,0 +1,50 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-cms.h */ +/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ + +/* Input file: packet-cms-template.h */ +/* Include files: packet-cms-exp.h, packet-cms-valexp.h */ + +/* packet-cms.h + * Routines for RFC2630 Cryptographic Message Syntax packet dissection + * + * $Id: packet-cms-template.h,v 1.1 2004/05/24 08:42:29 sahlberg Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_CMS_H +#define PACKET_CMS_H + + +/*--- Included file: packet-cms-exp.h ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-cms-exp.h */ +/* ../../tools/asn2eth.py -X -b -p cms -c cms.cnf -s packet-cms-template CryptographicMessageSyntax.asn */ + +int dissect_cms_SignedData(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +/*--- End of included file: packet-cms-exp.h ---*/ + + +#endif /* PACKET_CMS_H */ + diff --git a/epan/dissectors/packet-kerberos.c b/epan/dissectors/packet-kerberos.c index 2c186138b3..c065ae6e7d 100644 --- a/epan/dissectors/packet-kerberos.c +++ b/epan/dissectors/packet-kerberos.c @@ -1,3 +1,9 @@ +/* TODO: + PKINIT embryo inside should be pulled out into its own dissector, preferably + one that can handle generic PAtype additions via some registration API. + Keep an eye on ietf/krbwg on what they design for their framework for + adding PAtypes. +*/ /* packet-kerberos.c * Routines for Kerberos * Wes Hardaker (c) 2000 @@ -63,6 +69,7 @@ #include <epan/dissectors/packet-tcp.h> #include "prefs.h" #include <epan/dissectors/packet-ber.h> +#include <epan/dissectors/packet-cms.h> #include <epan/dissectors/packet-smb-common.h> #include <epan/dissectors/packet-dcerpc-netlogon.h> @@ -1354,10 +1361,10 @@ dissect_krb5_pvno(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offse * name-string[1] SEQUENCE OF GeneralString * } */ +guint32 name_type; static int dissect_krb5_name_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - guint32 name_type; offset=dissect_ber_integer(pinfo, tree, tvb, offset, hf_krb_name_type, &name_type); if(tree){ @@ -1452,14 +1459,6 @@ dissect_krb5_PA_PAC_REQUEST(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, -static int -dissect_krb5_SignedData(packet_info *pinfo _U_, proto_tree *tree _U_, tvbuff_t *tvb _U_, int offset) -{ -/*qqq*/ - return offset; -} - - static char ContentType[64]; /*64 chars should be long enough */ static int dissect_krb5_ContentInfo_ContentType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) @@ -1474,11 +1473,7 @@ dissect_krb5_ContentInfo_ContentType(packet_info *pinfo, proto_tree *tree, tvbuf static int dissect_krb5_ContentInfo_content(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - if(!strcmp(ContentType, "1.2.840.113549.1.7.2")){ - offset=dissect_krb5_SignedData(pinfo, tree, tvb, offset); - } else { - proto_tree_add_text(tree, tvb, offset, tvb_length_remaining(tvb, offset), "ContentInfo: dont know how to parse this type yet."); - } + offset=invoke_ber_oid_callback(ContentType, tvb, offset, pinfo, tree); return offset; } diff --git a/epan/dissectors/packet-x509af.c b/epan/dissectors/packet-x509af.c new file mode 100644 index 0000000000..3fb6017e80 --- /dev/null +++ b/epan/dissectors/packet-x509af.c @@ -0,0 +1,1231 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af.c */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + +/* Input file: packet-x509af-template.c */ +/* Include files: packet-x509af-hf.c, packet-x509af-ett.c, packet-x509af-fn.c, packet-x509af-hfarr.c, packet-x509af-ettarr.c, packet-x509af-val.h */ + +/* packet-x509af.c + * Routines for X.509 Authentication Framework packet dissection + * + * $Id: packet-x509af-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" +#include "packet-x509af.h" +#include "packet-x509ce.h" +#include "packet-x509if.h" + +#define PNAME "X.509 Authentication Framework" +#define PSNAME "X509AF" +#define PFNAME "x509af" + +/* Initialize the protocol and registered fields */ +int proto_x509af = -1; +int hf_x509af_algorithm_id = -1; + +/*--- Included file: packet-x509af-hf.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af-hf.c */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + +static int hf_x509af_signedCertificate = -1; /* T_signedCertificate */ +static int hf_x509af_version = -1; /* Version */ +static int hf_x509af_serialNumber = -1; /* CertificateSerialNumber */ +static int hf_x509af_signature = -1; /* AlgorithmIdentifier */ +static int hf_x509af_issuer = -1; /* Name */ +static int hf_x509af_validity = -1; /* Validity */ +static int hf_x509af_subject = -1; /* Name */ +static int hf_x509af_subjectPublicKeyInfo = -1; /* SubjectPublicKeyInfo */ +static int hf_x509af_issuerUniqueIdentifier = -1; /* UniqueIdentifier */ +static int hf_x509af_subjectUniqueIdentifier = -1; /* UniqueIdentifier */ +static int hf_x509af_extensions = -1; /* Extensions */ +static int hf_x509af_algorithmIdentifier = -1; /* AlgorithmIdentifier */ +static int hf_x509af_encrypted = -1; /* BIT_STRING */ +static int hf_x509af_notBefore = -1; /* Time */ +static int hf_x509af_notAfter = -1; /* Time */ +static int hf_x509af_algorithm = -1; /* AlgorithmIdentifier */ +static int hf_x509af_subjectPublicKey = -1; /* BIT_STRING */ +static int hf_x509af_utcTime = -1; /* UTCTime */ +static int hf_x509af_generalizedTime = -1; /* GeneralizedTime */ +static int hf_x509af_Extensions_item = -1; /* Extension */ +static int hf_x509af_critical = -1; /* BOOLEAN */ +static int hf_x509af_extnValue = -1; /* OCTET_STRING */ +static int hf_x509af_userCertificate = -1; /* Certificate */ +static int hf_x509af_certificationPath = -1; /* ForwardCertificationPath */ +static int hf_x509af_ForwardCertificationPath_item = -1; /* CrossCertificates */ +static int hf_x509af_CrossCertificates_item = -1; /* Certificate */ +static int hf_x509af_theCACertificates = -1; /* SEQUNCE_OF_CertificatePair */ +static int hf_x509af_theCACertificates_item = -1; /* CertificatePair */ +static int hf_x509af_issuedByThisCA = -1; /* Certificate */ +static int hf_x509af_issuedToThisCA = -1; /* Certificate */ +static int hf_x509af_signedCertificateList = -1; /* T_signedCertificateList */ +static int hf_x509af_thisUpdate = -1; /* Time */ +static int hf_x509af_nextUpdate = -1; /* Time */ +static int hf_x509af_revokedCertificates = -1; /* T_revokedCertificates */ +static int hf_x509af_revokedCertificates_item = -1; /* T_revokedCertificates_item */ +static int hf_x509af_userCertificate1 = -1; /* CertificateSerialNumber */ +static int hf_x509af_revocationDate = -1; /* Time */ +static int hf_x509af_crlEntryExtensions = -1; /* Extensions */ +static int hf_x509af_crlExtensions = -1; /* Extensions */ +static int hf_x509af_attributeCertificate = -1; /* AttributeCertificate */ +static int hf_x509af_acPath = -1; /* SEQUNCE_OF_ACPathData */ +static int hf_x509af_acPath_item = -1; /* ACPathData */ +static int hf_x509af_certificate = -1; /* Certificate */ +static int hf_x509af_signedAttributeCertificateInfo = -1; /* AttributeCertificateInfo */ +static int hf_x509af_info_subject = -1; /* InfoSubject */ +static int hf_x509af_baseCertificateID = -1; /* IssuerSerial */ +static int hf_x509af_infoSubjectName = -1; /* GeneralNames */ +static int hf_x509af_issuer1 = -1; /* GeneralNames */ +static int hf_x509af_attCertValidityPeriod = -1; /* AttCertValidityPeriod */ +static int hf_x509af_attributes = -1; /* SEQUNCE_OF_Attribute */ +static int hf_x509af_attributes_item = -1; /* Attribute */ +static int hf_x509af_issuerUniqueID = -1; /* UniqueIdentifier */ +static int hf_x509af_serial = -1; /* CertificateSerialNumber */ +static int hf_x509af_issuerUID = -1; /* UniqueIdentifier */ +static int hf_x509af_notBeforeTime = -1; /* GeneralizedTime */ +static int hf_x509af_notAfterTime = -1; /* GeneralizedTime */ +static int hf_x509af_assertion_subject = -1; /* AssertionSubject */ +static int hf_x509af_assertionSubjectName = -1; /* Name */ +static int hf_x509af_assertionIssuer = -1; /* Name */ +static int hf_x509af_attCertValidity = -1; /* GeneralizedTime */ +static int hf_x509af_attType = -1; /* SET_OF_AttributeType */ +static int hf_x509af_attType_item = -1; /* AttributeType */ + +/*--- End of included file: packet-x509af-hf.c ---*/ + + +/* Initialize the subtree pointers */ + +/*--- Included file: packet-x509af-ett.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af-ett.c */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + +static gint ett_x509af_Certificate = -1; +static gint ett_x509af_T_signedCertificate = -1; +static gint ett_x509af_AlgorithmIdentifier = -1; +static gint ett_x509af_Validity = -1; +static gint ett_x509af_SubjectPublicKeyInfo = -1; +static gint ett_x509af_Time = -1; +static gint ett_x509af_Extensions = -1; +static gint ett_x509af_Extension = -1; +static gint ett_x509af_Certificates = -1; +static gint ett_x509af_ForwardCertificationPath = -1; +static gint ett_x509af_CrossCertificates = -1; +static gint ett_x509af_CertificationPath = -1; +static gint ett_x509af_SEQUNCE_OF_CertificatePair = -1; +static gint ett_x509af_CertificatePair = -1; +static gint ett_x509af_CertificateList = -1; +static gint ett_x509af_T_signedCertificateList = -1; +static gint ett_x509af_T_revokedCertificates = -1; +static gint ett_x509af_T_revokedCertificates_item = -1; +static gint ett_x509af_AttributeCertificationPath = -1; +static gint ett_x509af_SEQUNCE_OF_ACPathData = -1; +static gint ett_x509af_ACPathData = -1; +static gint ett_x509af_AttributeCertificate = -1; +static gint ett_x509af_AttributeCertificateInfo = -1; +static gint ett_x509af_InfoSubject = -1; +static gint ett_x509af_SEQUNCE_OF_Attribute = -1; +static gint ett_x509af_IssuerSerial = -1; +static gint ett_x509af_AttCertValidityPeriod = -1; +static gint ett_x509af_AttributeCertificateAssertion = -1; +static gint ett_x509af_AssertionSubject = -1; +static gint ett_x509af_SET_OF_AttributeType = -1; + +/*--- End of included file: packet-x509af-ett.c ---*/ + + + +static int dissect_hf_x509af_algorithm_id(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, + hf_x509af_algorithm_id, NULL); + return offset; +} + +/* Algorithm Identifier can not yet be handled by the compiler */ +static ber_sequence AlgorithmIdentifier_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509af_algorithm_id }, +/*QQQ for the Type we need compiler support for ANY (==FT_BYTES) */ + { 0, 0, 0, NULL } +}; + +int +dissect_x509af_AlgorithmIdentifier(gboolean implicit_tag, 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, + AlgorithmIdentifier_sequence, hf_index, ett_x509af_AlgorithmIdentifier); + + return offset; +} + + +/*--- Included file: packet-x509af-fn.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af-fn.c */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + +static int dissect_issuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuer); +} +static int dissect_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x509af_subject); +} +static int dissect_issuerUniqueIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509sat_UniqueIdentifier(TRUE, tvb, offset, pinfo, tree, hf_x509af_issuerUniqueIdentifier); +} +static int dissect_subjectUniqueIdentifier_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509sat_UniqueIdentifier(TRUE, tvb, offset, pinfo, tree, hf_x509af_subjectUniqueIdentifier); +} +static int dissect_infoSubjectName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_x509af_infoSubjectName); +} +static int dissect_issuer1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_GeneralNames(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuer1); +} +static int dissect_attributes_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_Attribute(FALSE, tvb, offset, pinfo, tree, hf_x509af_attributes_item); +} +static int dissect_issuerUniqueID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509sat_UniqueIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuerUniqueID); +} +static int dissect_issuerUID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509sat_UniqueIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuerUID); +} +static int dissect_assertionSubjectName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x509af_assertionSubjectName); +} +static int dissect_assertionIssuer(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_Name(FALSE, tvb, offset, pinfo, tree, hf_x509af_assertionIssuer); +} +static int dissect_attType_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509af_attType_item); +} + +static const value_string Version_vals[] = { + { 0, "v1" }, + { 1, "v2" }, + { 2, "v3" }, + { 0, NULL } +}; + + +static int +dissect_x509af_Version(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_integer(pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_version(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Version(FALSE, tvb, offset, pinfo, tree, hf_x509af_version); +} + + + +int +dissect_x509af_CertificateSerialNumber(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_integer(pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} +static int dissect_serialNumber(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_x509af_serialNumber); +} +static int dissect_userCertificate1(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_x509af_userCertificate1); +} +static int dissect_serial(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CertificateSerialNumber(FALSE, tvb, offset, pinfo, tree, hf_x509af_serial); +} + +static int dissect_signature(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_signature); +} +static int dissect_algorithmIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AlgorithmIdentifier(FALSE, tvb, offset, pinfo, tree, hf_x509af_algorithmIdentifier); +} +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_x509af_algorithm); +} + + +static int +dissect_x509af_UTCTime(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_UTCTime, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_utcTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_UTCTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_utcTime); +} + + +static int +dissect_x509af_GeneralizedTime(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_generalized_time(pinfo, tree, tvb, offset, hf_index); + + return offset; +} +static int dissect_generalizedTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_generalizedTime); +} +static int dissect_notBeforeTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_notBeforeTime); +} +static int dissect_notAfterTime(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_notAfterTime); +} +static int dissect_attCertValidity(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_GeneralizedTime(FALSE, tvb, offset, pinfo, tree, hf_x509af_attCertValidity); +} + + +static const value_string Time_vals[] = { + { 0, "utcTime" }, + { 1, "generalizedTime" }, + { 0, NULL } +}; + +static ber_choice Time_choice[] = { + { 0, BER_CLASS_UNI, BER_UNI_TAG_UTCTime, BER_FLAGS_NOOWNTAG, dissect_utcTime }, + { 1, BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_generalizedTime }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_x509af_Time(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Time_choice, hf_index, ett_x509af_Time); + + return offset; +} +static int dissect_notBefore(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_notBefore); +} +static int dissect_notAfter(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_notAfter); +} +static int dissect_thisUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_thisUpdate); +} +static int dissect_nextUpdate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_nextUpdate); +} +static int dissect_revocationDate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Time(FALSE, tvb, offset, pinfo, tree, hf_x509af_revocationDate); +} + +static ber_sequence Validity_sequence[] = { + { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_notBefore }, + { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_notAfter }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_Validity(gboolean implicit_tag, 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, + Validity_sequence, hf_index, ett_x509af_Validity); + + return offset; +} +static int dissect_validity(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Validity(FALSE, tvb, offset, pinfo, tree, hf_x509af_validity); +} + + +static int +dissect_x509af_BIT_STRING(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, + NULL, hf_index, -1, + NULL); + + return offset; +} +static int dissect_encrypted(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_x509af_encrypted); +} +static int dissect_subjectPublicKey(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_BIT_STRING(FALSE, tvb, offset, pinfo, tree, hf_x509af_subjectPublicKey); +} + +static ber_sequence SubjectPublicKeyInfo_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithm }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_subjectPublicKey }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_SubjectPublicKeyInfo(gboolean implicit_tag, 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, + SubjectPublicKeyInfo_sequence, hf_index, ett_x509af_SubjectPublicKeyInfo); + + return offset; +} +static int dissect_subjectPublicKeyInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, offset, pinfo, tree, hf_x509af_subjectPublicKeyInfo); +} + + +static int +dissect_x509af_BOOLEAN(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_boolean(pinfo, tree, tvb, offset, hf_index); + + return offset; +} +static int dissect_critical(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_BOOLEAN(FALSE, tvb, offset, pinfo, tree, hf_x509af_critical); +} + + +static int +dissect_x509af_OCTET_STRING(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_extnValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnValue); +} + +static ber_sequence Extension_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical }, + { BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING, BER_FLAGS_NOOWNTAG, dissect_extnValue }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_Extension(gboolean implicit_tag, 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, + Extension_sequence, hf_index, ett_x509af_Extension); + + return offset; +} +static int dissect_Extensions_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Extension(FALSE, tvb, offset, pinfo, tree, hf_x509af_Extensions_item); +} + +static ber_sequence Extensions_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_Extensions_item }, +}; + +static int +dissect_x509af_Extensions(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + Extensions_sequence_of, hf_index, ett_x509af_Extensions); + + return offset; +} +static int dissect_extensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Extensions(FALSE, tvb, offset, pinfo, tree, hf_x509af_extensions); +} +static int dissect_crlEntryExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Extensions(FALSE, tvb, offset, pinfo, tree, hf_x509af_crlEntryExtensions); +} +static int dissect_crlExtensions(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Extensions(FALSE, tvb, offset, pinfo, tree, hf_x509af_crlExtensions); +} + +static ber_sequence T_signedCertificate_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_version }, + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuer }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_validity }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_subject }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_subjectPublicKeyInfo }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_issuerUniqueIdentifier_impl }, + { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_subjectUniqueIdentifier_impl }, + { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_extensions }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_T_signedCertificate(gboolean implicit_tag, 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, + T_signedCertificate_sequence, hf_index, ett_x509af_T_signedCertificate); + + return offset; +} +static int dissect_signedCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_T_signedCertificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_signedCertificate); +} + +static ber_sequence Certificate_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signedCertificate }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithmIdentifier }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted }, + { 0, 0, 0, NULL } +}; + +int +dissect_x509af_Certificate(gboolean implicit_tag, 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, + Certificate_sequence, hf_index, ett_x509af_Certificate); + + return offset; +} +static int dissect_userCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_userCertificate); +} +static int dissect_CrossCertificates_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_CrossCertificates_item); +} +static int dissect_issuedByThisCA(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuedByThisCA); +} +static int dissect_issuedToThisCA(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_issuedToThisCA); +} +static int dissect_certificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_Certificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_certificate); +} + +static ber_sequence CrossCertificates_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_CrossCertificates_item }, +}; + +static int +dissect_x509af_CrossCertificates(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + CrossCertificates_set_of, hf_index, ett_x509af_CrossCertificates); + + return offset; +} +static int dissect_ForwardCertificationPath_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CrossCertificates(FALSE, tvb, offset, pinfo, tree, hf_x509af_ForwardCertificationPath_item); +} + +static ber_sequence ForwardCertificationPath_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_ForwardCertificationPath_item }, +}; + +static int +dissect_x509af_ForwardCertificationPath(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + ForwardCertificationPath_sequence_of, hf_index, ett_x509af_ForwardCertificationPath); + + return offset; +} +static int dissect_certificationPath(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_ForwardCertificationPath(FALSE, tvb, offset, pinfo, tree, hf_x509af_certificationPath); +} + +static ber_sequence Certificates_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_userCertificate }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_certificationPath }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_Certificates(gboolean implicit_tag, 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, + Certificates_sequence, hf_index, ett_x509af_Certificates); + + return offset; +} + +static ber_sequence CertificatePair_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_issuedByThisCA }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_issuedToThisCA }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_CertificatePair(gboolean implicit_tag, 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, + CertificatePair_sequence, hf_index, ett_x509af_CertificatePair); + + return offset; +} +static int dissect_theCACertificates_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_CertificatePair(FALSE, tvb, offset, pinfo, tree, hf_x509af_theCACertificates_item); +} + +static ber_sequence SEQUNCE_OF_CertificatePair_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_theCACertificates_item }, +}; + +static int +dissect_x509af_SEQUNCE_OF_CertificatePair(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + SEQUNCE_OF_CertificatePair_sequence_of, hf_index, ett_x509af_SEQUNCE_OF_CertificatePair); + + return offset; +} +static int dissect_theCACertificates(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_SEQUNCE_OF_CertificatePair(FALSE, tvb, offset, pinfo, tree, hf_x509af_theCACertificates); +} + +static ber_sequence CertificationPath_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_userCertificate }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_theCACertificates }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_CertificationPath(gboolean implicit_tag, 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, + CertificationPath_sequence, hf_index, ett_x509af_CertificationPath); + + return offset; +} + +static ber_sequence T_revokedCertificates_item_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_userCertificate1 }, + { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_revocationDate }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_crlEntryExtensions }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_T_revokedCertificates_item(gboolean implicit_tag, 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, + T_revokedCertificates_item_sequence, hf_index, ett_x509af_T_revokedCertificates_item); + + return offset; +} +static int dissect_revokedCertificates_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_T_revokedCertificates_item(FALSE, tvb, offset, pinfo, tree, hf_x509af_revokedCertificates_item); +} + +static ber_sequence T_revokedCertificates_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_revokedCertificates_item }, +}; + +static int +dissect_x509af_T_revokedCertificates(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + T_revokedCertificates_sequence_of, hf_index, ett_x509af_T_revokedCertificates); + + return offset; +} +static int dissect_revokedCertificates(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_T_revokedCertificates(FALSE, tvb, offset, pinfo, tree, hf_x509af_revokedCertificates); +} + +static ber_sequence T_signedCertificateList_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuer }, + { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_thisUpdate }, + { BER_CLASS_UNI, -1/*choice*/, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_nextUpdate }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_revokedCertificates }, + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_crlExtensions }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_T_signedCertificateList(gboolean implicit_tag, 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, + T_signedCertificateList_sequence, hf_index, ett_x509af_T_signedCertificateList); + + return offset; +} +static int dissect_signedCertificateList(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_T_signedCertificateList(FALSE, tvb, offset, pinfo, tree, hf_x509af_signedCertificateList); +} + +static ber_sequence CertificateList_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signedCertificateList }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithmIdentifier }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted }, + { 0, 0, 0, NULL } +}; + +int +dissect_x509af_CertificateList(gboolean implicit_tag, 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, + CertificateList_sequence, hf_index, ett_x509af_CertificateList); + + return offset; +} + +static ber_sequence IssuerSerial_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuer1 }, + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serial }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuerUID }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_IssuerSerial(gboolean implicit_tag, 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, + IssuerSerial_sequence, hf_index, ett_x509af_IssuerSerial); + + return offset; +} +static int dissect_baseCertificateID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_IssuerSerial(FALSE, tvb, offset, pinfo, tree, hf_x509af_baseCertificateID); +} + + +static const value_string InfoSubject_vals[] = { + { 0, "baseCertificateID" }, + { 1, "subjectName" }, + { 0, NULL } +}; + +static ber_choice InfoSubject_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_baseCertificateID }, + { 1, BER_CLASS_CON, 1, 0, dissect_infoSubjectName }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_x509af_InfoSubject(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + InfoSubject_choice, hf_index, ett_x509af_InfoSubject); + + return offset; +} +static int dissect_info_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_InfoSubject(FALSE, tvb, offset, pinfo, tree, hf_x509af_info_subject); +} + +static ber_sequence AttCertValidityPeriod_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_notBeforeTime }, + { BER_CLASS_UNI, BER_UNI_TAG_GeneralizedTime, BER_FLAGS_NOOWNTAG, dissect_notAfterTime }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_AttCertValidityPeriod(gboolean implicit_tag, 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, + AttCertValidityPeriod_sequence, hf_index, ett_x509af_AttCertValidityPeriod); + + return offset; +} +static int dissect_attCertValidityPeriod(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AttCertValidityPeriod(FALSE, tvb, offset, pinfo, tree, hf_x509af_attCertValidityPeriod); +} + +static ber_sequence SEQUNCE_OF_Attribute_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attributes_item }, +}; + +static int +dissect_x509af_SEQUNCE_OF_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + SEQUNCE_OF_Attribute_sequence_of, hf_index, ett_x509af_SEQUNCE_OF_Attribute); + + return offset; +} +static int dissect_attributes(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_SEQUNCE_OF_Attribute(FALSE, tvb, offset, pinfo, tree, hf_x509af_attributes); +} + +static ber_sequence AttributeCertificateInfo_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_version }, + { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_info_subject }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_issuer1 }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signature }, + { BER_CLASS_UNI, BER_UNI_TAG_INTEGER, BER_FLAGS_NOOWNTAG, dissect_serialNumber }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attCertValidityPeriod }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attributes }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_issuerUniqueID }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_extensions }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_AttributeCertificateInfo(gboolean implicit_tag, 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, + AttributeCertificateInfo_sequence, hf_index, ett_x509af_AttributeCertificateInfo); + + return offset; +} +static int dissect_signedAttributeCertificateInfo(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AttributeCertificateInfo(FALSE, tvb, offset, pinfo, tree, hf_x509af_signedAttributeCertificateInfo); +} + +static ber_sequence AttributeCertificate_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_signedAttributeCertificateInfo }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_algorithmIdentifier }, + { BER_CLASS_UNI, BER_UNI_TAG_BITSTRING, BER_FLAGS_NOOWNTAG, dissect_encrypted }, + { 0, 0, 0, NULL } +}; + +int +dissect_x509af_AttributeCertificate(gboolean implicit_tag, 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, + AttributeCertificate_sequence, hf_index, ett_x509af_AttributeCertificate); + + return offset; +} +static int dissect_attributeCertificate(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AttributeCertificate(FALSE, tvb, offset, pinfo, tree, hf_x509af_attributeCertificate); +} + +static ber_sequence ACPathData_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_certificate }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_attributeCertificate }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_ACPathData(gboolean implicit_tag, 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, + ACPathData_sequence, hf_index, ett_x509af_ACPathData); + + return offset; +} +static int dissect_acPath_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_ACPathData(FALSE, tvb, offset, pinfo, tree, hf_x509af_acPath_item); +} + +static ber_sequence SEQUNCE_OF_ACPathData_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_acPath_item }, +}; + +static int +dissect_x509af_SEQUNCE_OF_ACPathData(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + SEQUNCE_OF_ACPathData_sequence_of, hf_index, ett_x509af_SEQUNCE_OF_ACPathData); + + return offset; +} +static int dissect_acPath(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_SEQUNCE_OF_ACPathData(FALSE, tvb, offset, pinfo, tree, hf_x509af_acPath); +} + +static ber_sequence AttributeCertificationPath_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_attributeCertificate }, + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_acPath }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_AttributeCertificationPath(gboolean implicit_tag, 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, + AttributeCertificationPath_sequence, hf_index, ett_x509af_AttributeCertificationPath); + + return offset; +} + + +static const value_string AssertionSubject_vals[] = { + { 0, "baseCertificateID" }, + { 1, "subjectName" }, + { 0, NULL } +}; + +static ber_choice AssertionSubject_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_baseCertificateID }, + { 1, BER_CLASS_CON, 1, 0, dissect_assertionSubjectName }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_x509af_AssertionSubject(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + AssertionSubject_choice, hf_index, ett_x509af_AssertionSubject); + + return offset; +} +static int dissect_assertion_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_AssertionSubject(FALSE, tvb, offset, pinfo, tree, hf_x509af_assertion_subject); +} + +static ber_sequence SET_OF_AttributeType_set_of[1] = { + { -1 /*imported*/, -1 /*imported*/, BER_FLAGS_NOOWNTAG, dissect_attType_item }, +}; + +static int +dissect_x509af_SET_OF_AttributeType(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + SET_OF_AttributeType_set_of, hf_index, ett_x509af_SET_OF_AttributeType); + + return offset; +} +static int dissect_attType(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_SET_OF_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509af_attType); +} + +static ber_sequence AttributeCertificateAssertion_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL, dissect_assertion_subject }, + { BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL, dissect_assertionIssuer }, + { BER_CLASS_CON, 2, BER_FLAGS_OPTIONAL, dissect_attCertValidity }, + { BER_CLASS_CON, 3, BER_FLAGS_OPTIONAL, dissect_attType }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509af_AttributeCertificateAssertion(gboolean implicit_tag, 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, + AttributeCertificateAssertion_sequence, hf_index, ett_x509af_AttributeCertificateAssertion); + + return offset; +} + + +/*--- End of included file: packet-x509af-fn.c ---*/ + + + +/*--- proto_register_x509af ----------------------------------------------*/ +void proto_register_x509af(void) { + + /* List of fields */ + static hf_register_info hf[] = { + { &hf_x509af_algorithm_id, + { "Algorithm Id", "x509af.algorithm.id", + FT_STRING, BASE_NONE, NULL, 0, + "Algorithm Id", HFILL }}, + +/*--- Included file: packet-x509af-hfarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af-hfarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + + { &hf_x509af_signedCertificate, + { "signedCertificate", "x509af.signedCertificate", + FT_NONE, BASE_NONE, NULL, 0, + "Certificate/signedCertificate", HFILL }}, + { &hf_x509af_version, + { "version", "x509af.version", + FT_INT32, BASE_DEC, VALS(Version_vals), 0, + "", HFILL }}, + { &hf_x509af_serialNumber, + { "serialNumber", "x509af.serialNumber", + FT_INT32, BASE_DEC, NULL, 0, + "", HFILL }}, + { &hf_x509af_signature, + { "signature", "x509af.signature", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_issuer, + { "issuer", "x509af.issuer", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_validity, + { "validity", "x509af.validity", + FT_NONE, BASE_NONE, NULL, 0, + "Certificate/signedCertificate/validity", HFILL }}, + { &hf_x509af_subject, + { "subject", "x509af.subject", + FT_NONE, BASE_NONE, NULL, 0, + "Certificate/signedCertificate/subject", HFILL }}, + { &hf_x509af_subjectPublicKeyInfo, + { "subjectPublicKeyInfo", "x509af.subjectPublicKeyInfo", + FT_NONE, BASE_NONE, NULL, 0, + "Certificate/signedCertificate/subjectPublicKeyInfo", HFILL }}, + { &hf_x509af_issuerUniqueIdentifier, + { "issuerUniqueIdentifier", "x509af.issuerUniqueIdentifier", + FT_NONE, BASE_NONE, NULL, 0, + "Certificate/signedCertificate/issuerUniqueIdentifier", HFILL }}, + { &hf_x509af_subjectUniqueIdentifier, + { "subjectUniqueIdentifier", "x509af.subjectUniqueIdentifier", + FT_NONE, BASE_NONE, NULL, 0, + "Certificate/signedCertificate/subjectUniqueIdentifier", HFILL }}, + { &hf_x509af_extensions, + { "extensions", "x509af.extensions", + FT_UINT32, BASE_DEC, NULL, 0, + "", HFILL }}, + { &hf_x509af_algorithmIdentifier, + { "algorithmIdentifier", "x509af.algorithmIdentifier", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_encrypted, + { "encrypted", "x509af.encrypted", + FT_BYTES, BASE_HEX, NULL, 0, + "", HFILL }}, + { &hf_x509af_notBefore, + { "notBefore", "x509af.notBefore", + FT_UINT32, BASE_DEC, VALS(Time_vals), 0, + "Validity/notBefore", HFILL }}, + { &hf_x509af_notAfter, + { "notAfter", "x509af.notAfter", + FT_UINT32, BASE_DEC, VALS(Time_vals), 0, + "Validity/notAfter", HFILL }}, + { &hf_x509af_algorithm, + { "algorithm", "x509af.algorithm", + FT_NONE, BASE_NONE, NULL, 0, + "SubjectPublicKeyInfo/algorithm", HFILL }}, + { &hf_x509af_subjectPublicKey, + { "subjectPublicKey", "x509af.subjectPublicKey", + FT_BYTES, BASE_HEX, NULL, 0, + "SubjectPublicKeyInfo/subjectPublicKey", HFILL }}, + { &hf_x509af_utcTime, + { "utcTime", "x509af.utcTime", + FT_STRING, BASE_NONE, NULL, 0, + "Time/utcTime", HFILL }}, + { &hf_x509af_generalizedTime, + { "generalizedTime", "x509af.generalizedTime", + FT_STRING, BASE_NONE, NULL, 0, + "Time/generalizedTime", HFILL }}, + { &hf_x509af_Extensions_item, + { "Item[##]", "x509af.Extensions_item", + FT_NONE, BASE_NONE, NULL, 0, + "Extensions/_item", HFILL }}, + { &hf_x509af_critical, + { "critical", "x509af.critical", + FT_BOOLEAN, 8, NULL, 0, + "Extension/critical", HFILL }}, + { &hf_x509af_extnValue, + { "extnValue", "x509af.extnValue", + FT_BYTES, BASE_HEX, NULL, 0, + "Extension/extnValue", HFILL }}, + { &hf_x509af_userCertificate, + { "userCertificate", "x509af.userCertificate", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_certificationPath, + { "certificationPath", "x509af.certificationPath", + FT_UINT32, BASE_DEC, NULL, 0, + "Certificates/certificationPath", HFILL }}, + { &hf_x509af_ForwardCertificationPath_item, + { "Item[##]", "x509af.ForwardCertificationPath_item", + FT_UINT32, BASE_DEC, NULL, 0, + "ForwardCertificationPath/_item", HFILL }}, + { &hf_x509af_CrossCertificates_item, + { "Item(##)", "x509af.CrossCertificates_item", + FT_NONE, BASE_NONE, NULL, 0, + "CrossCertificates/_item", HFILL }}, + { &hf_x509af_theCACertificates, + { "theCACertificates", "x509af.theCACertificates", + FT_UINT32, BASE_DEC, NULL, 0, + "CertificationPath/theCACertificates", HFILL }}, + { &hf_x509af_theCACertificates_item, + { "Item[##]", "x509af.theCACertificates_item", + FT_NONE, BASE_NONE, NULL, 0, + "CertificationPath/theCACertificates/_item", HFILL }}, + { &hf_x509af_issuedByThisCA, + { "issuedByThisCA", "x509af.issuedByThisCA", + FT_NONE, BASE_NONE, NULL, 0, + "CertificatePair/issuedByThisCA", HFILL }}, + { &hf_x509af_issuedToThisCA, + { "issuedToThisCA", "x509af.issuedToThisCA", + FT_NONE, BASE_NONE, NULL, 0, + "CertificatePair/issuedToThisCA", HFILL }}, + { &hf_x509af_signedCertificateList, + { "signedCertificateList", "x509af.signedCertificateList", + FT_NONE, BASE_NONE, NULL, 0, + "CertificateList/signedCertificateList", HFILL }}, + { &hf_x509af_thisUpdate, + { "thisUpdate", "x509af.thisUpdate", + FT_UINT32, BASE_DEC, VALS(Time_vals), 0, + "CertificateList/signedCertificateList/thisUpdate", HFILL }}, + { &hf_x509af_nextUpdate, + { "nextUpdate", "x509af.nextUpdate", + FT_UINT32, BASE_DEC, VALS(Time_vals), 0, + "CertificateList/signedCertificateList/nextUpdate", HFILL }}, + { &hf_x509af_revokedCertificates, + { "revokedCertificates", "x509af.revokedCertificates", + FT_UINT32, BASE_DEC, NULL, 0, + "CertificateList/signedCertificateList/revokedCertificates", HFILL }}, + { &hf_x509af_revokedCertificates_item, + { "Item[##]", "x509af.revokedCertificates_item", + FT_NONE, BASE_NONE, NULL, 0, + "CertificateList/signedCertificateList/revokedCertificates/_item", HFILL }}, + { &hf_x509af_userCertificate1, + { "userCertificate", "x509af.userCertificate", + FT_INT32, BASE_DEC, NULL, 0, + "CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate", HFILL }}, + { &hf_x509af_revocationDate, + { "revocationDate", "x509af.revocationDate", + FT_UINT32, BASE_DEC, VALS(Time_vals), 0, + "CertificateList/signedCertificateList/revokedCertificates/_item/revocationDate", HFILL }}, + { &hf_x509af_crlEntryExtensions, + { "crlEntryExtensions", "x509af.crlEntryExtensions", + FT_UINT32, BASE_DEC, NULL, 0, + "CertificateList/signedCertificateList/revokedCertificates/_item/crlEntryExtensions", HFILL }}, + { &hf_x509af_crlExtensions, + { "crlExtensions", "x509af.crlExtensions", + FT_UINT32, BASE_DEC, NULL, 0, + "CertificateList/signedCertificateList/crlExtensions", HFILL }}, + { &hf_x509af_attributeCertificate, + { "attributeCertificate", "x509af.attributeCertificate", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_acPath, + { "acPath", "x509af.acPath", + FT_UINT32, BASE_DEC, NULL, 0, + "AttributeCertificationPath/acPath", HFILL }}, + { &hf_x509af_acPath_item, + { "Item[##]", "x509af.acPath_item", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificationPath/acPath/_item", HFILL }}, + { &hf_x509af_certificate, + { "certificate", "x509af.certificate", + FT_NONE, BASE_NONE, NULL, 0, + "ACPathData/certificate", HFILL }}, + { &hf_x509af_signedAttributeCertificateInfo, + { "signedAttributeCertificateInfo", "x509af.signedAttributeCertificateInfo", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificate/signedAttributeCertificateInfo", HFILL }}, + { &hf_x509af_info_subject, + { "subject", "x509af.subject", + FT_UINT32, BASE_DEC, VALS(InfoSubject_vals), 0, + "AttributeCertificateInfo/subject", HFILL }}, + { &hf_x509af_baseCertificateID, + { "baseCertificateID", "x509af.baseCertificateID", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_infoSubjectName, + { "subjectName", "x509af.subjectName", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateInfo/subject/subjectName", HFILL }}, + { &hf_x509af_issuer1, + { "issuer", "x509af.issuer", + FT_NONE, BASE_NONE, NULL, 0, + "", HFILL }}, + { &hf_x509af_attCertValidityPeriod, + { "attCertValidityPeriod", "x509af.attCertValidityPeriod", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateInfo/attCertValidityPeriod", HFILL }}, + { &hf_x509af_attributes, + { "attributes", "x509af.attributes", + FT_UINT32, BASE_DEC, NULL, 0, + "AttributeCertificateInfo/attributes", HFILL }}, + { &hf_x509af_attributes_item, + { "Item[##]", "x509af.attributes_item", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateInfo/attributes/_item", HFILL }}, + { &hf_x509af_issuerUniqueID, + { "issuerUniqueID", "x509af.issuerUniqueID", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateInfo/issuerUniqueID", HFILL }}, + { &hf_x509af_serial, + { "serial", "x509af.serial", + FT_INT32, BASE_DEC, NULL, 0, + "IssuerSerial/serial", HFILL }}, + { &hf_x509af_issuerUID, + { "issuerUID", "x509af.issuerUID", + FT_NONE, BASE_NONE, NULL, 0, + "IssuerSerial/issuerUID", HFILL }}, + { &hf_x509af_notBeforeTime, + { "notBeforeTime", "x509af.notBeforeTime", + FT_STRING, BASE_NONE, NULL, 0, + "AttCertValidityPeriod/notBeforeTime", HFILL }}, + { &hf_x509af_notAfterTime, + { "notAfterTime", "x509af.notAfterTime", + FT_STRING, BASE_NONE, NULL, 0, + "AttCertValidityPeriod/notAfterTime", HFILL }}, + { &hf_x509af_assertion_subject, + { "subject", "x509af.subject", + FT_UINT32, BASE_DEC, VALS(AssertionSubject_vals), 0, + "AttributeCertificateAssertion/subject", HFILL }}, + { &hf_x509af_assertionSubjectName, + { "subjectName", "x509af.subjectName", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateAssertion/subject/subjectName", HFILL }}, + { &hf_x509af_assertionIssuer, + { "issuer", "x509af.issuer", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateAssertion/issuer", HFILL }}, + { &hf_x509af_attCertValidity, + { "attCertValidity", "x509af.attCertValidity", + FT_STRING, BASE_NONE, NULL, 0, + "AttributeCertificateAssertion/attCertValidity", HFILL }}, + { &hf_x509af_attType, + { "attType", "x509af.attType", + FT_UINT32, BASE_DEC, NULL, 0, + "AttributeCertificateAssertion/attType", HFILL }}, + { &hf_x509af_attType_item, + { "Item(##)", "x509af.attType_item", + FT_NONE, BASE_NONE, NULL, 0, + "AttributeCertificateAssertion/attType/_item", HFILL }}, + +/*--- End of included file: packet-x509af-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + +/*--- Included file: packet-x509af-ettarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af-ettarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + + &ett_x509af_Certificate, + &ett_x509af_T_signedCertificate, + &ett_x509af_AlgorithmIdentifier, + &ett_x509af_Validity, + &ett_x509af_SubjectPublicKeyInfo, + &ett_x509af_Time, + &ett_x509af_Extensions, + &ett_x509af_Extension, + &ett_x509af_Certificates, + &ett_x509af_ForwardCertificationPath, + &ett_x509af_CrossCertificates, + &ett_x509af_CertificationPath, + &ett_x509af_SEQUNCE_OF_CertificatePair, + &ett_x509af_CertificatePair, + &ett_x509af_CertificateList, + &ett_x509af_T_signedCertificateList, + &ett_x509af_T_revokedCertificates, + &ett_x509af_T_revokedCertificates_item, + &ett_x509af_AttributeCertificationPath, + &ett_x509af_SEQUNCE_OF_ACPathData, + &ett_x509af_ACPathData, + &ett_x509af_AttributeCertificate, + &ett_x509af_AttributeCertificateInfo, + &ett_x509af_InfoSubject, + &ett_x509af_SEQUNCE_OF_Attribute, + &ett_x509af_IssuerSerial, + &ett_x509af_AttCertValidityPeriod, + &ett_x509af_AttributeCertificateAssertion, + &ett_x509af_AssertionSubject, + &ett_x509af_SET_OF_AttributeType, + +/*--- End of included file: packet-x509af-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_x509af = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_x509af, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_x509af -------------------------------------------*/ +void proto_reg_handoff_x509af(void) { +} + diff --git a/epan/dissectors/packet-x509af.h b/epan/dissectors/packet-x509af.h new file mode 100644 index 0000000000..a9eb7b5541 --- /dev/null +++ b/epan/dissectors/packet-x509af.h @@ -0,0 +1,55 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af.h */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + +/* Input file: packet-x509af-template.h */ +/* Include files: packet-x509af-exp.h, packet-x509af-valexp.h */ + +/* packet-x509af.h + * Routines for X.509 Authentication Framework packet dissection + * + * $Id: packet-x509af-template.h,v 1.1 2004/05/24 08:42:29 sahlberg Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_X509AF_H +#define PACKET_X509AF_H + +int dissect_x509af_AlgorithmIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index); + + +/*--- Included file: packet-x509af-exp.h ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509af-exp.h */ +/* ../../tools/asn2eth.py -X -b -p x509af -c x509af.cnf -s packet-x509af-template AuthenticationFramework.asn */ + +int dissect_x509af_Certificate(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_x509af_CertificateSerialNumber(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_x509af_CertificateList(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_x509af_AttributeCertificate(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +/*--- End of included file: packet-x509af-exp.h ---*/ + + +#endif /* PACKET_X509AF_H */ + diff --git a/epan/dissectors/packet-x509ce.c b/epan/dissectors/packet-x509ce.c new file mode 100644 index 0000000000..9bda753838 --- /dev/null +++ b/epan/dissectors/packet-x509ce.c @@ -0,0 +1,256 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce.c */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + +/* Input file: packet-x509ce-template.c */ +/* Include files: packet-x509ce-hf.c, packet-x509ce-ett.c, packet-x509ce-fn.c, packet-x509ce-hfarr.c, packet-x509ce-ettarr.c, packet-x509ce-val.h */ + +/* packet-x509ce.c + * Routines for X.509 Certificate Extensions packet dissection + * + * $Id: packet-x509ce-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" +#include "packet-x509ce.h" + +#define PNAME "X.509 Certificate Extensions" +#define PSNAME "X509CE" +#define PFNAME "x509ce" + +/* Initialize the protocol and registered fields */ +int proto_x509ce = -1; + +/*--- Included file: packet-x509ce-hf.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce-hf.c */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + +static int hf_x509ce_GeneralNames_item = -1; /* GeneralName */ +static int hf_x509ce_rfc822Name = -1; /* IA5String */ +static int hf_x509ce_dNSName = -1; /* IA5String */ +static int hf_x509ce_uniformResourceIdentifier = -1; /* IA5String */ +static int hf_x509ce_iPAddress = -1; /* OCTET_STRING */ +static int hf_x509ce_registeredID = -1; /* OBJECT_IDENTIFIER */ + +/*--- End of included file: packet-x509ce-hf.c ---*/ + + +/* Initialize the subtree pointers */ + +/*--- Included file: packet-x509ce-ett.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce-ett.c */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + +static gint ett_x509ce_GeneralNames = -1; +static gint ett_x509ce_GeneralName = -1; + +/*--- End of included file: packet-x509ce-ett.c ---*/ + + + +/*--- Included file: packet-x509ce-fn.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce-fn.c */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + + +static int +dissect_x509ce_IA5String(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_restricted_string(implicit_tag, 1, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_rfc822Name(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_IA5String(FALSE, tvb, offset, pinfo, tree, hf_x509ce_rfc822Name); +} +static int dissect_dNSName(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_IA5String(FALSE, tvb, offset, pinfo, tree, hf_x509ce_dNSName); +} +static int dissect_uniformResourceIdentifier(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_IA5String(FALSE, tvb, offset, pinfo, tree, hf_x509ce_uniformResourceIdentifier); +} + + +static int +dissect_x509ce_OCTET_STRING(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} +static int dissect_iPAddress(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_OCTET_STRING(FALSE, tvb, offset, pinfo, tree, hf_x509ce_iPAddress); +} + + +static int +dissect_x509ce_OBJECT_IDENTIFIER(gboolean implicit_tag, 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, + hf_index, NULL); + + return offset; +} +static int dissect_registeredID(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_OBJECT_IDENTIFIER(FALSE, tvb, offset, pinfo, tree, hf_x509ce_registeredID); +} + + +static const value_string GeneralName_vals[] = { + { 1, "rfc822Name" }, + { 2, "dNSName" }, + { 6, "uniformResourceIdentifier" }, + { 7, "iPAddress" }, + { 8, "registeredID" }, + { 0, NULL } +}; + +static ber_choice GeneralName_choice[] = { + { 1, BER_CLASS_CON, 1, 0, dissect_rfc822Name }, + { 2, BER_CLASS_CON, 2, 0, dissect_dNSName }, + { 6, BER_CLASS_CON, 6, 0, dissect_uniformResourceIdentifier }, + { 7, BER_CLASS_CON, 7, 0, dissect_iPAddress }, + { 8, BER_CLASS_CON, 8, 0, dissect_registeredID }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_x509ce_GeneralName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + GeneralName_choice, hf_index, ett_x509ce_GeneralName); + + return offset; +} +static int dissect_GeneralNames_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_GeneralName(FALSE, tvb, offset, pinfo, tree, hf_x509ce_GeneralNames_item); +} + +static ber_sequence GeneralNames_sequence_of[1] = { + { BER_CLASS_CON, -1/*choice*/, BER_FLAGS_NOOWNTAG|BER_FLAGS_NOTCHKTAG, dissect_GeneralNames_item }, +}; + +int +dissect_x509ce_GeneralNames(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + GeneralNames_sequence_of, hf_index, ett_x509ce_GeneralNames); + + return offset; +} + + +/*--- End of included file: packet-x509ce-fn.c ---*/ + + + +/*--- proto_register_x509ce ----------------------------------------------*/ +void proto_register_x509ce(void) { + + /* List of fields */ + static hf_register_info hf[] = { + +/*--- Included file: packet-x509ce-hfarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce-hfarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + + { &hf_x509ce_GeneralNames_item, + { "Item[##]", "x509ce.GeneralNames_item", + FT_UINT32, BASE_DEC, VALS(GeneralName_vals), 0, + "GeneralNames/_item", HFILL }}, + { &hf_x509ce_rfc822Name, + { "rfc822Name", "x509ce.rfc822Name", + FT_STRING, BASE_NONE, NULL, 0, + "GeneralName/rfc822Name", HFILL }}, + { &hf_x509ce_dNSName, + { "dNSName", "x509ce.dNSName", + FT_STRING, BASE_NONE, NULL, 0, + "GeneralName/dNSName", HFILL }}, + { &hf_x509ce_uniformResourceIdentifier, + { "uniformResourceIdentifier", "x509ce.uniformResourceIdentifier", + FT_STRING, BASE_NONE, NULL, 0, + "GeneralName/uniformResourceIdentifier", HFILL }}, + { &hf_x509ce_iPAddress, + { "iPAddress", "x509ce.iPAddress", + FT_BYTES, BASE_HEX, NULL, 0, + "GeneralName/iPAddress", HFILL }}, + { &hf_x509ce_registeredID, + { "registeredID", "x509ce.registeredID", + FT_STRING, BASE_NONE, NULL, 0, + "GeneralName/registeredID", HFILL }}, + +/*--- End of included file: packet-x509ce-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + +/*--- Included file: packet-x509ce-ettarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce-ettarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + + &ett_x509ce_GeneralNames, + &ett_x509ce_GeneralName, + +/*--- End of included file: packet-x509ce-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_x509ce = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_x509ce, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_x509ce -------------------------------------------*/ +void proto_reg_handoff_x509ce(void) { +} + diff --git a/epan/dissectors/packet-x509ce.h b/epan/dissectors/packet-x509ce.h new file mode 100644 index 0000000000..60e4afacd6 --- /dev/null +++ b/epan/dissectors/packet-x509ce.h @@ -0,0 +1,50 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce.h */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + +/* Input file: packet-x509ce-template.h */ +/* Include files: packet-x509ce-exp.h, packet-x509ce-valexp.h */ + +/* packet-x509ce.h + * Routines for X.509 Certificate Extensions packet dissection + * + * $Id: packet-x509ce-template.h,v 1.1 2004/05/24 08:42:29 sahlberg Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_X509CE_H +#define PACKET_X509CE_H + + +/*--- Included file: packet-x509ce-exp.h ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509ce-exp.h */ +/* ../../tools/asn2eth.py -X -b -p x509ce -c x509ce.cnf -s packet-x509ce-template CertificateExtensions.asn */ + +int dissect_x509ce_GeneralNames(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +/*--- End of included file: packet-x509ce-exp.h ---*/ + + +#endif /* PACKET_X509CE_H */ + diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c new file mode 100644 index 0000000000..219a93ba1c --- /dev/null +++ b/epan/dissectors/packet-x509if.c @@ -0,0 +1,332 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if.c */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + +/* Input file: packet-x509if-template.c */ +/* Include files: packet-x509if-hf.c, packet-x509if-ett.c, packet-x509if-fn.c, packet-x509if-hfarr.c, packet-x509if-ettarr.c, packet-x509if-val.h */ + +/* packet-x509if.c + * Routines for X.509 Information Framework packet dissection + * + * $Id: packet-x509if-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" +#include "packet-x509if.h" + +#define PNAME "X.509 Information Framework" +#define PSNAME "X509IF" +#define PFNAME "x509if" + +/* Initialize the protocol and registered fields */ +int proto_x509if = -1; + +/*--- Included file: packet-x509if-hf.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if-hf.c */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + +static int hf_x509if_rdnSequence = -1; /* RDNSequence */ +static int hf_x509if_RDNSequence_item = -1; /* RelativeDistinguishedName */ +static int hf_x509if_RelativeDistinguishedName_item = -1; /* AttributeTypeAndDistinguishedValue */ +/* named bits */ +static int hf_x509if_AllowedSubset_baseObject = -1; +static int hf_x509if_AllowedSubset_oneLevel = -1; +static int hf_x509if_AllowedSubset_wholeSubtree = -1; + +/*--- End of included file: packet-x509if-hf.c ---*/ + + +/* Initialize the subtree pointers */ +static gint ett_x509if_Attribute = -1; + +/*--- Included file: packet-x509if-ett.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if-ett.c */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + +static gint ett_x509if_Name = -1; +static gint ett_x509if_RDNSequence = -1; +static gint ett_x509if_RelativeDistinguishedName = -1; +static gint ett_x509if_AttributeTypeAndDistinguishedValue = -1; +static gint ett_x509if_AllowedSubset = -1; + +/*--- End of included file: packet-x509if-ett.c ---*/ + + +static ber_sequence Attribute_sequence[] = { + /* { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509if_type },*/ + /*XXX missing stuff here */ + { 0, 0, 0, NULL } +}; + +int +dissect_x509if_Attribute(gboolean implicit_tag, 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, + Attribute_sequence, hf_index, ett_x509if_Attribute); + + return offset; +} + + + +/*--- Included file: packet-x509if-fn.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if-fn.c */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + + +static int +dissect_x509if_AttributeId(gboolean implicit_tag, 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, + hf_index, NULL); + + return offset; +} + + +int +dissect_x509if_AttributeType(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509if_AttributeId(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} + +static ber_sequence AttributeTypeAndDistinguishedValue_sequence[] = { + { 0, 0, 0, NULL } +}; + +static int +dissect_x509if_AttributeTypeAndDistinguishedValue(gboolean implicit_tag, 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, + AttributeTypeAndDistinguishedValue_sequence, hf_index, ett_x509if_AttributeTypeAndDistinguishedValue); + + return offset; +} +static int dissect_RelativeDistinguishedName_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeTypeAndDistinguishedValue(FALSE, tvb, offset, pinfo, tree, hf_x509if_RelativeDistinguishedName_item); +} + +static ber_sequence RelativeDistinguishedName_set_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_RelativeDistinguishedName_item }, +}; + +static int +dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_set_of(implicit_tag, pinfo, tree, tvb, offset, + RelativeDistinguishedName_set_of, hf_index, ett_x509if_RelativeDistinguishedName); + + return offset; +} +static int dissect_RDNSequence_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_RelativeDistinguishedName(FALSE, tvb, offset, pinfo, tree, hf_x509if_RDNSequence_item); +} + +static ber_sequence RDNSequence_sequence_of[1] = { + { BER_CLASS_UNI, BER_UNI_TAG_SET, BER_FLAGS_NOOWNTAG, dissect_RDNSequence_item }, +}; + +static int +dissect_x509if_RDNSequence(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence_of(implicit_tag, pinfo, tree, tvb, offset, + RDNSequence_sequence_of, hf_index, ett_x509if_RDNSequence); + + return offset; +} +static int dissect_rdnSequence(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_RDNSequence(FALSE, tvb, offset, pinfo, tree, hf_x509if_rdnSequence); +} + + +const value_string Name_vals[] = { + { 0, "rdnSequence" }, + { 0, NULL } +}; + +static ber_choice Name_choice[] = { + { 0, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE, BER_FLAGS_NOOWNTAG, dissect_rdnSequence }, + { 0, 0, 0, 0, NULL } +}; + +int +dissect_x509if_Name(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + Name_choice, hf_index, ett_x509if_Name); + + return offset; +} + + +static int +dissect_x509if_DistinguishedName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_x509if_RDNSequence(implicit_tag, tvb, offset, pinfo, tree, hf_index); + + return offset; +} + + +static const value_string ObjectClassKind_vals[] = { + { 0, "abstract" }, + { 1, "structural" }, + { 2, "auxiliary" }, + { 0, NULL } +}; + + +static int +dissect_x509if_ObjectClassKind(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_integer(pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} + +static asn_namedbit AllowedSubset_bits[] = { + { 0, &hf_x509if_AllowedSubset_baseObject, -1, -1, NULL, NULL }, + { 1, &hf_x509if_AllowedSubset_oneLevel, -1, -1, NULL, NULL }, + { 2, &hf_x509if_AllowedSubset_wholeSubtree, -1, -1, NULL, NULL }, + { 0, NULL, 0, 0, NULL, NULL } +}; + +static int +dissect_x509if_AllowedSubset(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, + AllowedSubset_bits, hf_index, ett_x509if_AllowedSubset, + NULL); + + return offset; +} + + +static const value_string ImposedSubset_vals[] = { + { 0, "baseObject" }, + { 1, "oneLevel" }, + { 2, "wholeSubtree" }, + { 0, NULL } +}; + + +static int +dissect_x509if_ImposedSubset(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_integer(pinfo, tree, tvb, offset, hf_index, NULL); + + return offset; +} + + +/*--- End of included file: packet-x509if-fn.c ---*/ + + + +/*--- proto_register_x509if ----------------------------------------------*/ +void proto_register_x509if(void) { + + /* List of fields */ + static hf_register_info hf[] = { + +/*--- Included file: packet-x509if-hfarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if-hfarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + + { &hf_x509if_rdnSequence, + { "rdnSequence", "x509if.rdnSequence", + FT_UINT32, BASE_DEC, NULL, 0, + "Name/rdnSequence", HFILL }}, + { &hf_x509if_RDNSequence_item, + { "Item[##]", "x509if.RDNSequence_item", + FT_UINT32, BASE_DEC, NULL, 0, + "RDNSequence/_item", HFILL }}, + { &hf_x509if_RelativeDistinguishedName_item, + { "Item(##)", "x509if.RelativeDistinguishedName_item", + FT_NONE, BASE_NONE, NULL, 0, + "RelativeDistinguishedName/_item", HFILL }}, + { &hf_x509if_AllowedSubset_baseObject, + { "baseObject", "x509if.baseObject", + FT_BOOLEAN, 8, NULL, 0x80, + "", HFILL }}, + { &hf_x509if_AllowedSubset_oneLevel, + { "oneLevel", "x509if.oneLevel", + FT_BOOLEAN, 8, NULL, 0x40, + "", HFILL }}, + { &hf_x509if_AllowedSubset_wholeSubtree, + { "wholeSubtree", "x509if.wholeSubtree", + FT_BOOLEAN, 8, NULL, 0x20, + "", HFILL }}, + +/*--- End of included file: packet-x509if-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + &ett_x509if_Attribute, + +/*--- Included file: packet-x509if-ettarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if-ettarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + + &ett_x509if_Name, + &ett_x509if_RDNSequence, + &ett_x509if_RelativeDistinguishedName, + &ett_x509if_AttributeTypeAndDistinguishedValue, + &ett_x509if_AllowedSubset, + +/*--- End of included file: packet-x509if-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_x509if = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_x509if, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_x509if -------------------------------------------*/ +void proto_reg_handoff_x509if(void) { +} + diff --git a/epan/dissectors/packet-x509if.h b/epan/dissectors/packet-x509if.h new file mode 100644 index 0000000000..8231327ee2 --- /dev/null +++ b/epan/dissectors/packet-x509if.h @@ -0,0 +1,54 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if.h */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + +/* Input file: packet-x509if-template.h */ +/* Include files: packet-x509if-exp.h, packet-x509if-valexp.h */ + +/* packet-x509if.h + * Routines for X.509 Information Framework packet dissection + * + * $Id: packet-x509if-template.h,v 1.1 2004/05/24 08:42:29 sahlberg Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_X509IF_H +#define PACKET_X509IF_H + + +/*--- Included file: packet-x509if-exp.h ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509if-exp.h */ +/* ../../tools/asn2eth.py -X -b -p x509if -c x509if.cnf -s packet-x509if-template InformationFramework.asn */ + +extern const value_string Name_vals[]; +int dissect_x509if_AttributeType(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); +int dissect_x509if_Name(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +/*--- End of included file: packet-x509if-exp.h ---*/ + + +int dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +#endif /* PACKET_X509IF_H */ + diff --git a/epan/dissectors/packet-x509sat.c b/epan/dissectors/packet-x509sat.c new file mode 100644 index 0000000000..0478d9452d --- /dev/null +++ b/epan/dissectors/packet-x509sat.c @@ -0,0 +1,227 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat.c */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + +/* Input file: packet-x509sat-template.c */ +/* Include files: packet-x509sat-hf.c, packet-x509sat-ett.c, packet-x509sat-fn.c, packet-x509sat-hfarr.c, packet-x509sat-ettarr.c, packet-x509sat-val.h */ + +/* packet-x509sat.c + * Routines for X.509 Selected Attribute Types packet dissection + * + * $Id: packet-x509sat-template.c,v 1.2 2004/05/25 21:07:43 guy Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <glib.h> +#include <epan/packet.h> +#include <epan/conversation.h> + +#include <stdio.h> +#include <string.h> + +#include "packet-ber.h" +#include "packet-x509sat.h" +#include "packet-x509if.h" + +#define PNAME "X.509 Selected Attribute Types" +#define PSNAME "X509SAT" +#define PFNAME "x509sat" + +/* Initialize the protocol and registered fields */ +int proto_x509sat = -1; + +/*--- Included file: packet-x509sat-hf.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat-hf.c */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + +static int hf_x509sat_equality = -1; /* AttributeType */ +static int hf_x509sat_substrings = -1; /* AttributeType */ +static int hf_x509sat_greaterOrEqual = -1; /* AttributeType */ +static int hf_x509sat_lessOrEqual = -1; /* AttributeType */ +static int hf_x509sat_approximateMatch = -1; /* AttributeType */ + +/*--- End of included file: packet-x509sat-hf.c ---*/ + + +/* Initialize the subtree pointers */ + +/*--- Included file: packet-x509sat-ett.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat-ett.c */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + +static gint ett_x509sat_CriteriaItem = -1; + +/*--- End of included file: packet-x509sat-ett.c ---*/ + + + +/*--- Included file: packet-x509sat-fn.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat-fn.c */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + +static int dissect_equality(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509sat_equality); +} +static int dissect_substrings(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509sat_substrings); +} +static int dissect_greaterOrEqual(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509sat_greaterOrEqual); +} +static int dissect_lessOrEqual(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509sat_lessOrEqual); +} +static int dissect_approximateMatch(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeType(FALSE, tvb, offset, pinfo, tree, hf_x509sat_approximateMatch); +} + +int +dissect_x509sat_UniqueIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_bitstring(implicit_tag, pinfo, tree, tvb, offset, + NULL, hf_index, -1, + NULL); + + return offset; +} + + +static int +dissect_x509sat_CountryName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, + pinfo, tree, tvb, offset, hf_index, + NULL); + + return offset; +} + + +static const value_string CriteriaItem_vals[] = { + { 0, "equality" }, + { 1, "substrings" }, + { 2, "greaterOrEqual" }, + { 3, "lessOrEqual" }, + { 4, "approximateMatch" }, + { 0, NULL } +}; + +static ber_choice CriteriaItem_choice[] = { + { 0, BER_CLASS_CON, 0, 0, dissect_equality }, + { 1, BER_CLASS_CON, 1, 0, dissect_substrings }, + { 2, BER_CLASS_CON, 2, 0, dissect_greaterOrEqual }, + { 3, BER_CLASS_CON, 3, 0, dissect_lessOrEqual }, + { 4, BER_CLASS_CON, 4, 0, dissect_approximateMatch }, + { 0, 0, 0, 0, NULL } +}; + +static int +dissect_x509sat_CriteriaItem(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_choice(pinfo, tree, tvb, offset, + CriteriaItem_choice, hf_index, ett_x509sat_CriteriaItem); + + return offset; +} + + +/*--- End of included file: packet-x509sat-fn.c ---*/ + + + +/*--- proto_register_x509sat ----------------------------------------------*/ +void proto_register_x509sat(void) { + + /* List of fields */ + static hf_register_info hf[] = { + +/*--- Included file: packet-x509sat-hfarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat-hfarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + + { &hf_x509sat_equality, + { "equality", "x509sat.equality", + FT_NONE, BASE_NONE, NULL, 0, + "CriteriaItem/equality", HFILL }}, + { &hf_x509sat_substrings, + { "substrings", "x509sat.substrings", + FT_NONE, BASE_NONE, NULL, 0, + "CriteriaItem/substrings", HFILL }}, + { &hf_x509sat_greaterOrEqual, + { "greaterOrEqual", "x509sat.greaterOrEqual", + FT_NONE, BASE_NONE, NULL, 0, + "CriteriaItem/greaterOrEqual", HFILL }}, + { &hf_x509sat_lessOrEqual, + { "lessOrEqual", "x509sat.lessOrEqual", + FT_NONE, BASE_NONE, NULL, 0, + "CriteriaItem/lessOrEqual", HFILL }}, + { &hf_x509sat_approximateMatch, + { "approximateMatch", "x509sat.approximateMatch", + FT_NONE, BASE_NONE, NULL, 0, + "CriteriaItem/approximateMatch", HFILL }}, + +/*--- End of included file: packet-x509sat-hfarr.c ---*/ + + }; + + /* List of subtrees */ + static gint *ett[] = { + +/*--- Included file: packet-x509sat-ettarr.c ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat-ettarr.c */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + + &ett_x509sat_CriteriaItem, + +/*--- End of included file: packet-x509sat-ettarr.c ---*/ + + }; + + /* Register protocol */ + proto_x509sat = proto_register_protocol(PNAME, PSNAME, PFNAME); + + /* Register fields and subtrees */ + proto_register_field_array(proto_x509sat, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + +} + + +/*--- proto_reg_handoff_x509sat -------------------------------------------*/ +void proto_reg_handoff_x509sat(void) { +} + diff --git a/epan/dissectors/packet-x509sat.h b/epan/dissectors/packet-x509sat.h new file mode 100644 index 0000000000..c462a32a9b --- /dev/null +++ b/epan/dissectors/packet-x509sat.h @@ -0,0 +1,50 @@ +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat.h */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + +/* Input file: packet-x509sat-template.h */ +/* Include files: packet-x509sat-exp.h, packet-x509sat-valexp.h */ + +/* packet-x509sat.h + * Routines for X.509 Selected Attribute Types packet dissection + * + * $Id: packet-x509sat-template.h,v 1.1 2004/05/24 08:42:29 sahlberg Exp $ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef PACKET_X509SAT_H +#define PACKET_X509SAT_H + + +/*--- Included file: packet-x509sat-exp.h ---*/ + +/* Do not modify this file. */ +/* It is created automatically by the ASN.1 to Ethereal dissector compiler */ +/* packet-x509sat-exp.h */ +/* ../../tools/asn2eth.py -X -b -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn */ + +int dissect_x509sat_UniqueIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + +/*--- End of included file: packet-x509sat-exp.h ---*/ + + +#endif /* PACKET_X509SAT_H */ + |