forked from osmocom/wireshark
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. svn path=/trunk/; revision=11440
This commit is contained in:
parent
d23af58fd6
commit
723d3dbe44
|
@ -51,6 +51,13 @@ int proto_cms = -1;
|
|||
#include "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) {
|
||||
|
||||
|
@ -76,5 +83,6 @@ void proto_register_cms(void) {
|
|||
|
||||
/*--- 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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__ */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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 */
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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 */
|
||||
|
|
@ -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) {
|
||||
}
|
||||
|
|
@ -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 */
|
||||
|
|
@ -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) {
|
||||
}
|
||||
|
|
@ -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 */
|
||||
|
|
@ -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) {
|
||||
}
|
||||
|
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue