diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-09-06 09:12:17 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2004-09-06 09:12:17 +0000 |
commit | d163bab22e83244f293a4de30ed87762cc247b56 (patch) | |
tree | de736dab8bb1f645e01db554125fa719d4f1ed4a | |
parent | 343025b91ff92968c3e6e306eb500396670b1e37 (diff) |
Update x509SAT to export DirectoryString.
Update X509CE to dissect EDIPartyName now that DirectoryString can be dissected
svn path=/trunk/; revision=11910
-rw-r--r-- | asn1/x509ce/CertificateExtensions.asn | 16 | ||||
-rw-r--r-- | asn1/x509ce/x509ce.cnf | 2 | ||||
-rw-r--r-- | asn1/x509sat/packet-x509sat-template.c | 2 | ||||
-rw-r--r-- | asn1/x509sat/packet-x509sat-template.h | 2 | ||||
-rw-r--r-- | asn1/x509sat/x509sat_exp.cnf | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-x509ce.c | 42 | ||||
-rw-r--r-- | epan/dissectors/packet-x509sat.c | 2 | ||||
-rw-r--r-- | epan/dissectors/packet-x509sat.h | 2 |
8 files changed, 59 insertions, 11 deletions
diff --git a/asn1/x509ce/CertificateExtensions.asn b/asn1/x509ce/CertificateExtensions.asn index 06f8bb6b05..d8ab1b7ca1 100644 --- a/asn1/x509ce/CertificateExtensions.asn +++ b/asn1/x509ce/CertificateExtensions.asn @@ -16,7 +16,7 @@ IMPORTS Time, PolicyID FROM AuthenticationFramework {joint-iso-itu-t ds(5) module(1) authenticationFramework(7) 4} - DirectoryString{} + DirectoryString FROM SelectedAttributeTypes {joint-iso-itu-t ds(5) module(1) selectedAttributeTypes(5) 4} ub-name @@ -150,19 +150,19 @@ GeneralName ::= CHOICE { dNSName [2] IMPLICIT IA5String, -- x400Address [3] IMPLICIT ORAddress, directoryName [4] IMPLICIT Name, --- ediPartyName [5] IMPLICIT EDIPartyName, + ediPartyName [5] IMPLICIT EDIPartyName, uniformResourceIdentifier [6] IMPLICIT IA5String, iPAddress [7] IMPLICIT OCTET STRING, registeredID [8] IMPLICIT OBJECT IDENTIFIER } -- OTHER-NAME ::= TYPE-IDENTIFIER --- --- EDIPartyName ::= SEQUENCE { --- nameAssigner [0] IMPLICIT DirectoryString{ub-name} OPTIONAL, --- partyName [1] IMPLICIT DirectoryString{ub-name} --- } --- + +EDIPartyName ::= SEQUENCE { + nameAssigner [0] IMPLICIT DirectoryString OPTIONAL, + partyName [1] IMPLICIT DirectoryString +} + -- issuerAltName EXTENSION ::= { -- SYNTAX GeneralNames -- IDENTIFIED BY id-ce-issuerAltName diff --git a/asn1/x509ce/x509ce.cnf b/asn1/x509ce/x509ce.cnf index 56cb5ca4f9..fb0df7a8e0 100644 --- a/asn1/x509ce/x509ce.cnf +++ b/asn1/x509ce/x509ce.cnf @@ -6,9 +6,11 @@ #.MODULE_IMPORT
InformationFramework x509if
AuthenticationFramework x509af
+SelectedAttributeTypes x509sat
#.INCLUDE ../x509if/x509if_exp.cnf
#.INCLUDE ../x509af/x509af_exp.cnf
+#.INCLUDE ../x509sat/x509sat_exp.cnf
#.EXPORTS
diff --git a/asn1/x509sat/packet-x509sat-template.c b/asn1/x509sat/packet-x509sat-template.c index d06c24ddde..fd68d6daf1 100644 --- a/asn1/x509sat/packet-x509sat-template.c +++ b/asn1/x509sat/packet-x509sat-template.c @@ -135,7 +135,7 @@ static ber_choice DirectoryString_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { DirectoryString_hf_index = hf_index; offset = dissect_ber_choice(pinfo, tree, tvb, offset, diff --git a/asn1/x509sat/packet-x509sat-template.h b/asn1/x509sat/packet-x509sat-template.h index 4c62b7deec..8b820c485c 100644 --- a/asn1/x509sat/packet-x509sat-template.h +++ b/asn1/x509sat/packet-x509sat-template.h @@ -27,5 +27,7 @@ #include "packet-x509sat-exp.h" +int dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + #endif /* PACKET_X509SAT_H */ diff --git a/asn1/x509sat/x509sat_exp.cnf b/asn1/x509sat/x509sat_exp.cnf index ed8c43f443..e091fddeff 100644 --- a/asn1/x509sat/x509sat_exp.cnf +++ b/asn1/x509sat/x509sat_exp.cnf @@ -1,4 +1,4 @@ #.IMPORT_TAG
UniqueIdentifier BER_CLASS_UNI BER_UNI_TAG_BITSTRING
-
+DirectoryString BER_CLASS_UNI BER_UNI_TAG_CHOICE
diff --git a/epan/dissectors/packet-x509ce.c b/epan/dissectors/packet-x509ce.c index bf1ce1f7ca..127a4e20e2 100644 --- a/epan/dissectors/packet-x509ce.c +++ b/epan/dissectors/packet-x509ce.c @@ -106,9 +106,12 @@ 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_directoryName = -1; /* Name */ +static int hf_x509ce_ediPartyName = -1; /* EDIPartyName */ static int hf_x509ce_uniformResourceIdentifier = -1; /* IA5String */ static int hf_x509ce_iPAddress = -1; /* OCTET_STRING */ static int hf_x509ce_registeredID = -1; /* OBJECT_IDENTIFIER */ +static int hf_x509ce_nameAssigner = -1; /* DirectoryString */ +static int hf_x509ce_partyName = -1; /* DirectoryString */ static int hf_x509ce_AttributesSyntax_item = -1; /* Attribute */ static int hf_x509ce_cA = -1; /* BOOLEAN */ static int hf_x509ce_pathLenConstraint = -1; /* INTEGER */ @@ -206,6 +209,7 @@ static gint ett_x509ce_PolicyMappingsSyntax = -1; static gint ett_x509ce_PolicyMappingsSyntax_item = -1; static gint ett_x509ce_GeneralNames = -1; static gint ett_x509ce_GeneralName = -1; +static gint ett_x509ce_EDIPartyName = -1; static gint ett_x509ce_AttributesSyntax = -1; static gint ett_x509ce_BasicConstraintsSyntax = -1; static gint ett_x509ce_NameConstraintsSyntax = -1; @@ -247,6 +251,12 @@ static int dissect_authorityCertSerialNumber_impl(packet_info *pinfo, proto_tree static int dissect_directoryName_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_x509if_Name(TRUE, tvb, offset, pinfo, tree, hf_x509ce_directoryName); } +static int dissect_nameAssigner_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509sat_DirectoryString(TRUE, tvb, offset, pinfo, tree, hf_x509ce_nameAssigner); +} +static int dissect_partyName_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509sat_DirectoryString(TRUE, tvb, offset, pinfo, tree, hf_x509ce_partyName); +} static int dissect_AttributesSyntax_item(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { return dissect_x509if_Attribute(FALSE, tvb, offset, pinfo, tree, hf_x509ce_AttributesSyntax_item); } @@ -285,6 +295,23 @@ static int dissect_uniformResourceIdentifier_impl(packet_info *pinfo, proto_tree return dissect_x509ce_IA5String(TRUE, tvb, offset, pinfo, tree, hf_x509ce_uniformResourceIdentifier); } +static ber_sequence EDIPartyName_sequence[] = { + { BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_nameAssigner_impl }, + { BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_partyName_impl }, + { 0, 0, 0, NULL } +}; + +static int +dissect_x509ce_EDIPartyName(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, + EDIPartyName_sequence, hf_index, ett_x509ce_EDIPartyName); + + return offset; +} +static int dissect_ediPartyName_impl(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) { + return dissect_x509ce_EDIPartyName(TRUE, tvb, offset, pinfo, tree, hf_x509ce_ediPartyName); +} + static int dissect_x509ce_OCTET_STRING(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) { @@ -314,6 +341,7 @@ static const value_string GeneralName_vals[] = { { 1, "rfc822Name" }, { 2, "dNSName" }, { 4, "directoryName" }, + { 5, "ediPartyName" }, { 6, "uniformResourceIdentifier" }, { 7, "iPAddress" }, { 8, "registeredID" }, @@ -324,6 +352,7 @@ static ber_choice GeneralName_choice[] = { { 1, BER_CLASS_CON, 1, BER_FLAGS_IMPLTAG, dissect_rfc822Name_impl }, { 2, BER_CLASS_CON, 2, BER_FLAGS_IMPLTAG, dissect_dNSName_impl }, { 4, BER_CLASS_CON, 4, BER_FLAGS_IMPLTAG, dissect_directoryName_impl }, + { 5, BER_CLASS_CON, 5, BER_FLAGS_IMPLTAG, dissect_ediPartyName_impl }, { 6, BER_CLASS_CON, 6, BER_FLAGS_IMPLTAG, dissect_uniformResourceIdentifier_impl }, { 7, BER_CLASS_CON, 7, BER_FLAGS_IMPLTAG, dissect_iPAddress_impl }, { 8, BER_CLASS_CON, 8, BER_FLAGS_IMPLTAG, dissect_registeredID_impl }, @@ -1509,6 +1538,10 @@ void proto_register_x509ce(void) { { "directoryName", "x509ce.directoryName", FT_UINT32, BASE_DEC, VALS(Name_vals), 0, "GeneralName/directoryName", HFILL }}, + { &hf_x509ce_ediPartyName, + { "ediPartyName", "x509ce.ediPartyName", + FT_NONE, BASE_NONE, NULL, 0, + "GeneralName/ediPartyName", HFILL }}, { &hf_x509ce_uniformResourceIdentifier, { "uniformResourceIdentifier", "x509ce.uniformResourceIdentifier", FT_STRING, BASE_NONE, NULL, 0, @@ -1521,6 +1554,14 @@ void proto_register_x509ce(void) { { "registeredID", "x509ce.registeredID", FT_STRING, BASE_NONE, NULL, 0, "GeneralName/registeredID", HFILL }}, + { &hf_x509ce_nameAssigner, + { "nameAssigner", "x509ce.nameAssigner", + FT_NONE, BASE_NONE, NULL, 0, + "EDIPartyName/nameAssigner", HFILL }}, + { &hf_x509ce_partyName, + { "partyName", "x509ce.partyName", + FT_NONE, BASE_NONE, NULL, 0, + "EDIPartyName/partyName", HFILL }}, { &hf_x509ce_AttributesSyntax_item, { "Item[##]", "x509ce.AttributesSyntax_item", FT_NONE, BASE_NONE, NULL, 0, @@ -1832,6 +1873,7 @@ void proto_register_x509ce(void) { &ett_x509ce_PolicyMappingsSyntax_item, &ett_x509ce_GeneralNames, &ett_x509ce_GeneralName, + &ett_x509ce_EDIPartyName, &ett_x509ce_AttributesSyntax, &ett_x509ce_BasicConstraintsSyntax, &ett_x509ce_NameConstraintsSyntax, diff --git a/epan/dissectors/packet-x509sat.c b/epan/dissectors/packet-x509sat.c index 4a0794e344..09c3660940 100644 --- a/epan/dissectors/packet-x509sat.c +++ b/epan/dissectors/packet-x509sat.c @@ -292,7 +292,7 @@ static ber_choice DirectoryString_choice[] = { { 0, 0, 0, 0, NULL } }; -static int +int dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index) { DirectoryString_hf_index = hf_index; offset = dissect_ber_choice(pinfo, tree, tvb, offset, diff --git a/epan/dissectors/packet-x509sat.h b/epan/dissectors/packet-x509sat.h index c462a32a9b..20d107e2a9 100644 --- a/epan/dissectors/packet-x509sat.h +++ b/epan/dissectors/packet-x509sat.h @@ -46,5 +46,7 @@ int dissect_x509sat_UniqueIdentifier(gboolean implicit_tag, tvbuff_t *tvb, int o /*--- End of included file: packet-x509sat-exp.h ---*/ +int dissect_x509sat_DirectoryString(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, int hf_index); + #endif /* PACKET_X509SAT_H */ |