diff options
-rw-r--r-- | asn1/x509af/AuthenticationFramework.asn | 4 | ||||
-rw-r--r-- | asn1/x509af/packet-x509af-template.c | 44 | ||||
-rw-r--r-- | asn1/x509af/x509af.cnf | 16 | ||||
-rw-r--r-- | epan/dissectors/packet-x509af.c | 118 | ||||
-rw-r--r-- | epan/dissectors/packet-x509af.h | 2 |
5 files changed, 90 insertions, 94 deletions
diff --git a/asn1/x509af/AuthenticationFramework.asn b/asn1/x509af/AuthenticationFramework.asn index 7799f8ddbf..8fd8064a04 100644 --- a/asn1/x509af/AuthenticationFramework.asn +++ b/asn1/x509af/AuthenticationFramework.asn @@ -82,8 +82,8 @@ Extensions ::= SEQUENCE OF Extension -- specification of those individual extensions shall include the rules for the significance of the order therein Extension ::= SEQUENCE { extnId OBJECT IDENTIFIER, - critical BOOLEAN DEFAULT FALSE, - extnValue Any + critical BOOLEAN OPTIONAL, + extnValue OCTET STRING -- contains a DER encoding of a value of type &ExtnType -- for the extension object identified by extnId } diff --git a/asn1/x509af/packet-x509af-template.c b/asn1/x509af/packet-x509af-template.c index b2d4eb9a77..e202523d5d 100644 --- a/asn1/x509af/packet-x509af-template.c +++ b/asn1/x509af/packet-x509af-template.c @@ -47,7 +47,6 @@ static int proto_x509af = -1; static int hf_x509af_algorithm_id = -1; static int hf_x509af_extension_id = -1; -static int hf_x509af_critical = -1; /* BOOLEAN */ #include "packet-x509af-hf.c" /* Initialize the subtree pointers */ @@ -57,46 +56,7 @@ static char algorithm_id[64]; /*64 chars should be long enough? */ static char extension_id[64]; /*64 chars should be long enough? */ -static int -dissect_hf_x509af_extension_id(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) -{ - offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, - hf_x509af_extension_id, extension_id); - return offset; -} -/* BOOLEAN from template, remove later if the compiler starts generating it */ -static int -dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, 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_hf_x509af_extension_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) -{ - offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree); - return offset; -} - -static const ber_sequence Extension_sequence[] = { - { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509af_extension_id }, - { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical }, - { BER_CLASS_ANY, 0, 0, dissect_hf_x509af_extension_type }, - { 0, 0, 0, NULL } -}; - -static int -dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, - Extension_sequence, hf_index, ett_x509af_Extension); - - return offset; -} #include "packet-x509af-fn.c" @@ -114,10 +74,6 @@ void proto_register_x509af(void) { { "Extension Id", "x509af.extension.id", FT_STRING, BASE_NONE, NULL, 0, "Extension Id", HFILL }}, - { &hf_x509af_critical, - { "critical", "x509af.critical", - FT_BOOLEAN, 8, NULL, 0, - "Extension/critical", HFILL }}, #include "packet-x509af-hfarr.c" }; diff --git a/asn1/x509af/x509af.cnf b/asn1/x509af/x509af.cnf index 51ad2154e2..54b4ec1f8e 100644 --- a/asn1/x509af/x509af.cnf +++ b/asn1/x509af/x509af.cnf @@ -38,8 +38,6 @@ CertificateList B "2.5.4.59" "id-at-attributeCertificateRevocationList" #.NO_EMIT -Extension - #.TYPE_RENAME AttributeCertificateInfo/subject InfoSubject AttributeCertificateAssertion/subject AssertionSubject @@ -64,3 +62,17 @@ CertificateList/signedCertificateList/revokedCertificates/_item/userCertificate #.FN_BODY AlgorithmIdentifier/parameters offset=call_ber_oid_callback(algorithm_id, tvb, offset, pinfo, tree); +#.FN_BODY Extension/extnId + offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, + hf_x509af_extension_id, extension_id); + +#.FN_BODY Extension/extnValue + guint8 class; + gboolean pc, ind; + guint32 tag; + guint32 len; + /* skip past the T and L */ + offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); + offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree); + diff --git a/epan/dissectors/packet-x509af.c b/epan/dissectors/packet-x509af.c index fa6053a2b3..d70be57cd0 100644 --- a/epan/dissectors/packet-x509af.c +++ b/epan/dissectors/packet-x509af.c @@ -8,7 +8,7 @@ /* packet-x509af.c * Routines for X.509 Authentication Framework packet dissection * - * $Id: packet-x509af-template.c 12392 2004-10-26 13:04:09Z sahlberg $ + * $Id: packet-x509af-template.c 12437 2004-10-30 02:18:44Z sahlberg $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -54,7 +54,6 @@ static int proto_x509af = -1; static int hf_x509af_algorithm_id = -1; static int hf_x509af_extension_id = -1; -static int hf_x509af_critical = -1; /* BOOLEAN */ /*--- Included file: packet-x509af-hf.c ---*/ @@ -84,6 +83,9 @@ 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_extnId = -1; /* T_extnId */ +static int hf_x509af_critical = -1; /* BOOLEAN */ +static int hf_x509af_extnValue = -1; /* T_extnValue */ static int hf_x509af_userCertificate = -1; /* Certificate */ static int hf_x509af_certificationPath = -1; /* ForwardCertificationPath */ static int hf_x509af_ForwardCertificationPath_item = -1; /* CrossCertificates */ @@ -170,46 +172,7 @@ static char algorithm_id[64]; /*64 chars should be long enough? */ static char extension_id[64]; /*64 chars should be long enough? */ -static int -dissect_hf_x509af_extension_id(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) -{ - offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, - hf_x509af_extension_id, extension_id); - return offset; -} -/* BOOLEAN from template, remove later if the compiler starts generating it */ -static int -dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, 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_hf_x509af_extension_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) -{ - offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree); - - return offset; -} - -static const ber_sequence Extension_sequence[] = { - { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_hf_x509af_extension_id }, - { BER_CLASS_UNI, BER_UNI_TAG_BOOLEAN, BER_FLAGS_OPTIONAL|BER_FLAGS_NOOWNTAG, dissect_critical }, - { BER_CLASS_ANY, 0, 0, dissect_hf_x509af_extension_type }, - { 0, 0, 0, NULL } -}; - -static int -dissect_x509af_Extension(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, - Extension_sequence, hf_index, ett_x509af_Extension); - - return offset; -} /*--- Included file: packet-x509af-fn.c ---*/ @@ -457,6 +420,63 @@ static int dissect_subjectPublicKeyInfo(packet_info *pinfo, proto_tree *tree, tv return dissect_x509af_SubjectPublicKeyInfo(FALSE, tvb, offset, pinfo, tree, hf_x509af_subjectPublicKeyInfo); } + +static int +dissect_x509af_T_extnId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, + hf_x509af_extension_id, extension_id); + + + return offset; +} +static int dissect_extnId(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_T_extnId(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnId); +} + + +static int +dissect_x509af_BOOLEAN(gboolean implicit_tag _U_, 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_T_extnValue(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + guint8 class; + gboolean pc, ind; + guint32 tag; + guint32 len; + /* skip past the T and L */ + offset = dissect_ber_identifier(pinfo, tree, tvb, offset, &class, &pc, &tag); + offset = dissect_ber_length(pinfo, tree, tvb, offset, &len, &ind); + offset=call_ber_oid_callback(extension_id, tvb, offset, pinfo, tree); + + + return offset; +} +static int dissect_extnValue(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509af_T_extnValue(FALSE, tvb, offset, pinfo, tree, hf_x509af_extnValue); +} + +static const ber_sequence Extension_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_extnId }, + { 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 _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { + offset = dissect_ber_sequence(implicit_tag, pinfo, tree, tvb, offset, + 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); } @@ -947,10 +967,6 @@ void proto_register_x509af(void) { { "Extension Id", "x509af.extension.id", FT_STRING, BASE_NONE, NULL, 0, "Extension Id", HFILL }}, - { &hf_x509af_critical, - { "critical", "x509af.critical", - FT_BOOLEAN, 8, NULL, 0, - "Extension/critical", HFILL }}, /*--- Included file: packet-x509af-hfarr.c ---*/ @@ -1058,6 +1074,18 @@ void proto_register_x509af(void) { { "Item", "x509af.Extensions_item", FT_NONE, BASE_NONE, NULL, 0, "Extensions/_item", HFILL }}, + { &hf_x509af_extnId, + { "extnId", "x509af.extnId", + FT_STRING, BASE_NONE, NULL, 0, + "Extension/extnId", 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, diff --git a/epan/dissectors/packet-x509af.h b/epan/dissectors/packet-x509af.h index 531e8cf181..14f6b27750 100644 --- a/epan/dissectors/packet-x509af.h +++ b/epan/dissectors/packet-x509af.h @@ -8,7 +8,7 @@ /* packet-x509af.h * Routines for X.509 Authentication Framework packet dissection * - * $Id: packet-x509af-template.h 12203 2004-10-05 09:18:55Z guy $ + * $Id: packet-x509af-template.h 12437 2004-10-30 02:18:44Z sahlberg $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> |