diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-10-30 02:36:58 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-10-30 02:36:58 +0000 |
commit | b1e1e18ad1f62329131c8c4a40ce76be48a84374 (patch) | |
tree | 9876efaf78a3e323698f54968bdc88e935e27481 /epan/dissectors/packet-x509af.c | |
parent | 805f948c298ce5b3613328b5c20cd56b78e8fe95 (diff) |
change Extension to be implemented inside the conformance file and remove it from the template
svn path=/trunk/; revision=12438
Diffstat (limited to 'epan/dissectors/packet-x509af.c')
-rw-r--r-- | epan/dissectors/packet-x509af.c | 118 |
1 files changed, 73 insertions, 45 deletions
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, |