diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-10-29 11:39:58 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-10-29 11:39:58 +0000 |
commit | 076d4710ecb611008ca83c42b422e8ed1745726c (patch) | |
tree | bb04d1c9fc62fe2ce3d63d17a4d2ad08c8db371b | |
parent | deae7590206bfa952383c03b6c3c5192592f6d81 (diff) |
more updates of x509if
svn path=/trunk/; revision=12433
-rw-r--r-- | asn1/x509if/InformationFramework.asn | 35 | ||||
-rw-r--r-- | asn1/x509if/packet-x509if-template.c | 18 | ||||
-rw-r--r-- | asn1/x509if/packet-x509if-template.h | 2 | ||||
-rw-r--r-- | asn1/x509if/x509if.cnf | 7 | ||||
-rw-r--r-- | epan/dissectors/packet-x509if.c | 60 | ||||
-rw-r--r-- | epan/dissectors/packet-x509if.h | 3 |
6 files changed, 47 insertions, 78 deletions
diff --git a/asn1/x509if/InformationFramework.asn b/asn1/x509if/InformationFramework.asn index 9224a4e52e..b26b5bd4d6 100644 --- a/asn1/x509if/InformationFramework.asn +++ b/asn1/x509if/InformationFramework.asn @@ -27,26 +27,26 @@ IMPORTS AttributeId ::= OBJECT IDENTIFIER +--AttributeValue ::= Any +-- -- attribute data types --- XXX This function is implemented by hand inside the template --- Attribute ::= SEQUENCE { --- type AttributeId, --- values --- SET SIZE (0..MAX) OF ATTRIBUTE.&Type({SupportedAttributes}{@type}), +Attribute ::= SEQUENCE { + type AttributeId +-- value +-- SET SIZE (0..MAX) OF AttributeValue -- valuesWithContext -- SET SIZE (1..MAX) OF --- SEQUENCE {value ATTRIBUTE.&Type({SupportedAttributes}{@type}), +-- SEQUENCE {value Any, -- contextList SET SIZE (1..MAX) OF Context} OPTIONAL --- } +} AttributeType ::= AttributeId --- AttributeValue ::= ATTRIBUTE.&Type -- -- Context ::= SEQUENCE { --- contextType CONTEXT.&id({SupportedContexts}), +-- contextType AttributeId, -- contextValues --- SET SIZE (1..MAX) OF CONTEXT.&Type({SupportedContexts}{@contextType}), +-- SET SIZE (1..MAX) OF Any, -- fallback BOOLEAN DEFAULT FALSE -- } -- @@ -98,13 +98,12 @@ RelativeDistinguishedName ::= AttributeTypeAndDistinguishedValue ::= SEQUENCE { type AttributeId, --- value ATTRIBUTE.&Type({SupportedAttributes}{@type}), value Any, primaryDistinguished BOOLEAN OPTIONAL -- valuesWithContext -- SET SIZE (1..MAX) OF -- SEQUENCE {distingAttrValue --- [0] ATTRIBUTE.&Type({SupportedAttributes}{@type}) OPTIONAL, +-- [0] Any OPTIONAL, -- contextList SET SIZE (1..MAX) OF Context} OPTIONAL } @@ -595,13 +594,13 @@ ImposedSubset ::= ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)} -- includeSubtypes [0] BOOLEAN DEFAULT FALSE, -- selectedValues -- [1] SEQUENCE SIZE (0..MAX) OF --- ATTRIBUTE.&Type({SupportedAttributes}{@attributeType}) OPTIONAL, +-- Any OPTIONAL, -- defaultValues -- [2] SEQUENCE SIZE (0..MAX) OF -- SEQUENCE {entryType OBJECT-CLASS.&id OPTIONAL, -- values -- SEQUENCE OF --- ATTRIBUTE.&Type({SupportedAttributes}{@attributeType}) +-- Any -- } OPTIONAL, -- contexts [3] SEQUENCE SIZE (0..MAX) OF ContextProfile OPTIONAL, -- contextCombination [4] ContextCombination DEFAULT and:{}, @@ -647,14 +646,14 @@ ImposedSubset ::= ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)} -- outputValues -- CHOICE {selectedValues -- SEQUENCE SIZE (1..MAX) OF --- ATTRIBUTE.&Type({SupportedAttributes}{@attributeType}), +-- Any, -- matchedValuesOnly NULL} OPTIONAL, -- contexts [0] SEQUENCE SIZE (1..MAX) OF ContextProfile OPTIONAL -- } -- -- OutputValues ::= CHOICE { -- selectedValues --- SEQUENCE SIZE (1..MAX) OF ATTRIBUTE.&Type({SupportedAttributes}), +-- SEQUENCE SIZE (1..MAX) OF Any, -- matchedValuesOnly NULL -- } -- @@ -738,9 +737,9 @@ ImposedSubset ::= ENUMERATED {baseObject(0), oneLevel(1), wholeSubtree(2)} -- -- REQUEST-ATTRIBUTE ::= CLASS { -- &attributeType AttributeId, --- &SelectedValues ATTRIBUTE.&Type OPTIONAL, +-- &SelectedValues Any OPTIONAL, -- &DefaultValues SEQUENCE {entryType OBJECT-CLASS.&id OPTIONAL, --- values SEQUENCE OF ATTRIBUTE.&Type +-- values SEQUENCE OF Any -- } OPTIONAL, -- &contexts SEQUENCE OF ContextProfile OPTIONAL, -- &contextCombination ContextCombination OPTIONAL, diff --git a/asn1/x509if/packet-x509if-template.c b/asn1/x509if/packet-x509if-template.c index 5c304b052d..306d671319 100644 --- a/asn1/x509if/packet-x509if-template.c +++ b/asn1/x509if/packet-x509if-template.c @@ -46,27 +46,10 @@ int hf_x509if_object_identifier_id = -1; #include "packet-x509if-hf.c" /* Initialize the subtree pointers */ -static gint ett_x509if_Attribute = -1; #include "packet-x509if-ett.c" static char object_identifier_id[64]; /*64 chars should be long enough? */ - -static const 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; -} - - #include "packet-x509if-fn.c" @@ -84,7 +67,6 @@ void proto_register_x509if(void) { /* List of subtrees */ static gint *ett[] = { - &ett_x509if_Attribute, #include "packet-x509if-ettarr.c" }; diff --git a/asn1/x509if/packet-x509if-template.h b/asn1/x509if/packet-x509if-template.h index a26f815ce8..70f826af9e 100644 --- a/asn1/x509if/packet-x509if-template.h +++ b/asn1/x509if/packet-x509if-template.h @@ -27,7 +27,5 @@ #include "packet-x509if-exp.h" -int dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); - #endif /* PACKET_X509IF_H */ diff --git a/asn1/x509if/x509if.cnf b/asn1/x509if/x509if.cnf index 86d6fd8f5e..68d8a15f42 100644 --- a/asn1/x509if/x509if.cnf +++ b/asn1/x509if/x509if.cnf @@ -8,7 +8,7 @@ #.INCLUDE ./x509if_dummy.cnf #.EXPORTS - +Attribute AttributeType Name RelativeDistinguishedName @@ -19,10 +19,13 @@ RelativeDistinguishedName #.FIELD_RENAME -#.FN_BODY AttributeTypeAndDistinguishedValue/type +#.FN_BODY AttributeId offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, hf_x509if_object_identifier_id, object_identifier_id); +#.FN_BODY AttributeValue + offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); + #.FN_BODY AttributeTypeAndDistinguishedValue/value offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree); diff --git a/epan/dissectors/packet-x509if.c b/epan/dissectors/packet-x509if.c index 03d05e0654..b278dad57c 100644 --- a/epan/dissectors/packet-x509if.c +++ b/epan/dissectors/packet-x509if.c @@ -8,7 +8,7 @@ /* packet-x509if.c * Routines for X.509 Information Framework packet dissection * - * $Id: packet-x509if-template.c 12245 2004-10-08 20:28:04Z guy $ + * $Id: packet-x509if-template.c 12431 2004-10-29 11:10:31Z sahlberg $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -53,10 +53,10 @@ int hf_x509if_object_identifier_id = -1; /*--- Included file: packet-x509if-hf.c ---*/ +static int hf_x509if_type = -1; /* AttributeId */ static int hf_x509if_rdnSequence = -1; /* RDNSequence */ static int hf_x509if_RDNSequence_item = -1; /* RelativeDistinguishedName */ static int hf_x509if_RelativeDistinguishedName_item = -1; /* AttributeTypeAndDistinguishedValue */ -static int hf_x509if_type = -1; /* T_type */ static int hf_x509if_value = -1; /* T_value */ static int hf_x509if_primaryDistinguished = -1; /* BOOLEAN */ /* named bits */ @@ -68,10 +68,10 @@ static int hf_x509if_AllowedSubset_wholeSubtree = -1; /* Initialize the subtree pointers */ -static gint ett_x509if_Attribute = -1; /*--- Included file: packet-x509if-ett.c ---*/ +static gint ett_x509if_Attribute = -1; static gint ett_x509if_Name = -1; static gint ett_x509if_RDNSequence = -1; static gint ett_x509if_RelativeDistinguishedName = -1; @@ -84,22 +84,6 @@ static gint ett_x509if_AllowedSubset = -1; static char object_identifier_id[64]; /*64 chars should be long enough? */ -static const 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 ---*/ /*--- Fields for imported types ---*/ @@ -108,32 +92,36 @@ dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packe static int dissect_x509if_AttributeId(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { - offset = dissect_ber_object_identifier(implicit_tag, pinfo, tree, tvb, offset, - hf_index, NULL); + offset = dissect_ber_object_identifier(FALSE, pinfo, tree, tvb, offset, + hf_x509if_object_identifier_id, object_identifier_id); + return offset; } +static int dissect_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509if_AttributeId(FALSE, tvb, offset, pinfo, tree, hf_x509if_type); +} +static const ber_sequence Attribute_sequence[] = { + { BER_CLASS_UNI, BER_UNI_TAG_OID, BER_FLAGS_NOOWNTAG, dissect_type }, + { 0, 0, 0, NULL } +}; int -dissect_x509if_AttributeType(gboolean implicit_tag _U_, 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); +dissect_x509if_Attribute(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, + Attribute_sequence, hf_index, ett_x509if_Attribute); return offset; } -static int -dissect_x509if_T_type(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_x509if_object_identifier_id, object_identifier_id); - +int +dissect_x509if_AttributeType(gboolean implicit_tag _U_, 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 int dissect_type(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { - return dissect_x509if_T_type(FALSE, tvb, offset, pinfo, tree, hf_x509if_type); -} static int @@ -299,6 +287,10 @@ void proto_register_x509if(void) { /*--- Included file: packet-x509if-hfarr.c ---*/ + { &hf_x509if_type, + { "type", "x509if.type", + FT_STRING, BASE_NONE, NULL, 0, + "", HFILL }}, { &hf_x509if_rdnSequence, { "rdnSequence", "x509if.rdnSequence", FT_UINT32, BASE_DEC, NULL, 0, @@ -311,10 +303,6 @@ void proto_register_x509if(void) { { "Item", "x509if.RelativeDistinguishedName_item", FT_NONE, BASE_NONE, NULL, 0, "RelativeDistinguishedName/_item", HFILL }}, - { &hf_x509if_type, - { "type", "x509if.type", - FT_STRING, BASE_NONE, NULL, 0, - "AttributeTypeAndDistinguishedValue/type", HFILL }}, { &hf_x509if_value, { "value", "x509if.value", FT_NONE, BASE_NONE, NULL, 0, @@ -342,10 +330,10 @@ void proto_register_x509if(void) { /* List of subtrees */ static gint *ett[] = { - &ett_x509if_Attribute, /*--- Included file: packet-x509if-ettarr.c ---*/ + &ett_x509if_Attribute, &ett_x509if_Name, &ett_x509if_RDNSequence, &ett_x509if_RelativeDistinguishedName, diff --git a/epan/dissectors/packet-x509if.h b/epan/dissectors/packet-x509if.h index ee50a56c47..a5e7f0fcd5 100644 --- a/epan/dissectors/packet-x509if.h +++ b/epan/dissectors/packet-x509if.h @@ -36,6 +36,7 @@ /*--- Included file: packet-x509if-exp.h ---*/ extern const value_string Name_vals[]; +int dissect_x509if_Attribute(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); 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); int dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); @@ -43,7 +44,5 @@ int dissect_x509if_RelativeDistinguishedName(gboolean implicit_tag, tvbuff_t *tv /*--- 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 */ |