From Grame Lunt:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 14 Dec 2005 21:02:56 +0000 (21:02 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 14 Dec 2005 21:02:56 +0000 (21:02 +0000)
Attached is a patch that updates -

* DOP - This has now been successfully tested and so is now enabled by default and workaround code removed.
Also now uses the correct EXPORTs from the other modules/dissectors.

* X509SAT - Most of the selected attributes are now supported in addition to the DirectoryString syntax attributes. This includes restoring the correct DirectoryString syntax and also providing the basic syntaxes (e.g. OBJECT IDENTIFIER, PrintableString). The latter requires a sed line in the Makefile which I assume should be OK? Not all the SAT can be defined in x509sat - so some have been included in x509if and x509af - though x509sat.cnf contains the master list and references the other dissectors where appropriate.

(I still prefer a syntax registration approach but I don't think that is going to be agreed in the short term.)

* X509IF - a mechanism to register some formating, based upon the hf_index, that is used in the cnf file.

* A couple of fixes identified by Stig.

Note the patc for dop did not apply don't regenerate dissectors yet.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16799 f5534014-38df-0310-8fa8-9805f1628bb7

22 files changed:
asn1/dap/dap-exp.cnf
asn1/dap/dap.asn
asn1/dap/dap.cnf
asn1/dap/packet-dap-template.c
asn1/disp/disp.asn
asn1/disp/disp.cnf
asn1/disp/packet-disp-template.c
asn1/disp/packet-disp-template.h
asn1/dop/dop-exp.cnf
asn1/dop/dop.cnf
asn1/dop/packet-dop-template.c
asn1/dsp/dsp.asn
asn1/ros/packet-ros-template.c
asn1/rtse/packet-rtse-template.c
asn1/x411/Makefile
asn1/x509if/packet-x509if-template.c
asn1/x509if/packet-x509if-template.h
asn1/x509if/x509if.cnf
asn1/x509sat/Makefile
asn1/x509sat/SelectedAttributeTypes.asn
asn1/x509sat/x509sat-exp.cnf
asn1/x509sat/x509sat.cnf

index aa8d99abe29df391570ce7ea845317c4be4a6951..60efa31464f6c717b70511e96f3d1901771f58b5 100644 (file)
@@ -31,7 +31,6 @@ Referral                 BER_CLASS_ANY/*choice*/ -1/*choice*/
 SecurityError            BER_CLASS_ANY/*choice*/ -1/*choice*/
 ServiceError             BER_CLASS_ANY/*choice*/ -1/*choice*/
 UpdateError              BER_CLASS_ANY/*choice*/ -1/*choice*/
-OperationalBindingID     BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
 #.END
 
 #.TYPE_ATTR
@@ -67,6 +66,5 @@ Referral                 TYPE = FT_UINT32  DISPLAY = BASE_DEC   STRINGS = VALS(d
 SecurityError            TYPE = FT_UINT32  DISPLAY = BASE_DEC   STRINGS = VALS(dap_SecurityError_vals)  BITMASK = 0
 ServiceError             TYPE = FT_UINT32  DISPLAY = BASE_DEC   STRINGS = VALS(dap_ServiceError_vals)  BITMASK = 0
 UpdateError              TYPE = FT_UINT32  DISPLAY = BASE_DEC   STRINGS = VALS(dap_UpdateError_vals)  BITMASK = 0
-OperationalBindingID     TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
 #.END
 
index dd165f9eb3f1decfd38baec7822896d4cbd92745..9edcea388af9351d5f8bbf7ba5cf46fda65f85d7 100644 (file)
@@ -45,9 +45,9 @@ IMPORTS
     id-opcode-search
     FROM DirectoryAccessProtocol {joint-iso-itu-t ds(5) module(1) dap(11) 4}
   -- from ITU-T Rec. X.520 | ISO/IEC 9594-6
---  DirectoryString{}
---    FROM SelectedAttributeTypes {joint-iso-itu-t ds(5) module(1)
---      selectedAttributeTypes(5) 4}
+  DirectoryString
+    FROM SelectedAttributeTypes {joint-iso-itu-t ds(5) module(1)
+      selectedAttributeTypes(5) 4}
   ub-domainLocalID
     FROM UpperBounds {joint-iso-itu-t ds(5) module(1) upperBounds(10) 4}
   -- from ITU-T Rec. X.509 | ISO/IEC 9594-8
@@ -58,9 +58,9 @@ IMPORTS
     FROM AttributeCertificateDefinitions {joint-iso-itu-t ds(5) module(1)
       attributeCertificateDefinitions(32) 4}
   -- from ITU-T Rec. X.525 | ISO/IEC 9594-9
---  AgreementID
---    FROM DirectoryShadowAbstractService {joint-iso-itu-t ds(5) module(1)
---      directoryShadowAbstractService(15) 4}
+  AgreementID
+    FROM DirectoryShadowAbstractService {joint-iso-itu-t ds(5) module(1)
+      directoryShadowAbstractService(15) 4}
   -- from ITU-T Rec. X.880 | ISO/IEC 13712-1
   Code, ERROR, OPERATION
     FROM Remote-Operations-Information-Objects {joint-iso-itu-t
@@ -1265,24 +1265,6 @@ UpdateProblem ::= INTEGER {
 -- attribute types 
 --id-at-family-information OBJECT IDENTIFIER ::= {id-at 64}
 
-AgreementID ::= OperationalBindingID
-
-OperationalBindingID ::= SEQUENCE {
-  identifier   INTEGER,
-  version      INTEGER
-}
-
-
--- local definition as one in x509sat is wrong! */
-DirectoryString ::= CHOICE {
-  teletexString    TeletexString,
-  printableString  PrintableString,
-  universalString  UniversalString,
-  bmpString        BMPString,
-  uTF8String       UTF8String
-}
-
-
 END -- DirectoryAbstractService
 
 -- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
index 1a7fee85bb1dd389f8c90c1556df0f5571602312..a44d0289d5712c2339302c3ff185dbec6698f35b 100644 (file)
@@ -5,6 +5,8 @@ ServiceAdministration   x509if
 AuthenticationFramework        x509af
 AttributeCertificateDefinitions        x509af
 
+SelectedAttributeTypes x509sat
+
 BasicAccessControl     crmf
 
 Remote-Operations-Generic-ROS-PDUs     ros
@@ -12,11 +14,14 @@ Remote-Operations-Information-Objects       ros
 
 ACSE-1                 acse
 DistributedOperations  dsp
+DirectoryShadowAbstractService disp
 
 #.INCLUDE      ../x509if/x509if-exp.cnf
 #.INCLUDE      ../x509af/x509af-exp.cnf
+#.INCLUDE      ../x509sat/x509sat-exp.cnf
 #.INCLUDE      ../pkixcrmf/crmf-exp.cnf
 #.INCLUDE      ../dsp/dsp-exp.cnf
+#.INCLUDE      ../disp/disp-exp.cnf
 #.INCLUDE      ../ros/ros-exp.cnf
 #.INCLUDE      ../acse/acse-exp.cnf
 
@@ -26,7 +31,6 @@ Referral
 SecurityParameters
 EntryModification
 ContextSelection
-OperationalBindingID
 DirectoryBindArgument
 DirectoryBindError
 ReadArgument
@@ -161,24 +165,8 @@ ModifyRights/_item/item/value                      value-assertion
        if(check_col(pinfo->cinfo, COL_INFO))   
                col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", x509if_get_last_dn());
 
-#.FN_PARS INTEGER
-       VAL_PTR = &value
-
-#.FN_BODY INTEGER
-       guint32 value;
-
-       %(DEFAULT_BODY)s
-
-       if (check_col(pinfo->cinfo, COL_INFO)) {
-               if(hf_index == hf_dap_identifier) {
-                       col_append_fstr(pinfo->cinfo, COL_INFO, " id=%%d", value);
-               } else if (hf_index == hf_dap_version) {
-                       col_append_fstr(pinfo->cinfo, COL_INFO, ",%%d", value);
-               }
-       }
-
 #.FN_PARS OCTET_STRING
-       VAL_PTR=&out_tvb
+       VAL_PTR=&out_tvb 
        
 #.FN_BODY OCTET_STRING
        tvbuff_t *out_tvb;
@@ -275,3 +263,13 @@ ModifyRights/_item/item/value                      value-assertion
                col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", (dn && *dn) ? dn : "(root)");
        }
 
+#.FN_BODY T_subordinates_item
+       proto_item *sub_item;
+
+       %(DEFAULT_BODY)s
+
+       if((sub_item = get_ber_last_created_item())) {
+               
+               proto_item_append_text(sub_item," (%%s)", x509if_get_last_dn());
+       }
+
index 695e5f0484b3ed3276501c16f1402722f99f4b1d..9d5a0e24f947b314202d143b4883af9cdcd2117f 100644 (file)
@@ -327,6 +327,15 @@ void proto_reg_handoff_dap(void) {
   /* remember the tpkt handler for change in preferences */
   tpkt_handle = find_dissector("tpkt");
 
+  /* AttributeValueAssertions */
+  x509if_register_fmt(hf_dap_equality, "=");
+  x509if_register_fmt(hf_dap_greaterOrEqual, ">=");
+  x509if_register_fmt(hf_dap_lessOrEqual, "<=");
+  x509if_register_fmt(hf_dap_approximateMatch, "=~");
+  /* AttributeTypes */
+  x509if_register_fmt(hf_dap_present, "= *");
+
+
 }
 
 
index 05a75c2598a9e4db4eb166b57e26bc119cb88643..f52e41935a89e5d0eca465aeb6e26f7432cc39c3 100644 (file)
@@ -134,7 +134,7 @@ AttributeSelection ::= SET OF ClassAttributeSelection
 
 ClassAttributeSelection ::= SEQUENCE {
   class            OBJECT IDENTIFIER OPTIONAL,
-  classAttributes  ClassAttributes -- DEFAULT allAttributes:NULL
+  classAttributes  ClassAttributes -- DEFAULT allAttributes:NULL -- OPTIONAL
 }
 
 ClassAttributes ::= CHOICE {
index 1114e9dbec35a712894aa7eede8fa3d6e38f3884..f8fe639e3dc2381f3c4d3a455aae087f70ff6844 100644 (file)
@@ -8,7 +8,7 @@ ACSE-1                  acse
 DirectoryAbstractService       dap
 DistributedOperations          dsp
 DSAOperationalAttributeTypes   dop
-OperationalBindingManagement   dap
+OperationalBindingManagement   dop
 
 #.INCLUDE ../x509if/x509if-exp.cnf
 #.INCLUDE ../x509af/x509af-exp.cnf
@@ -17,6 +17,9 @@ OperationalBindingManagement  dap
 #.INCLUDE ../dop/dop-exp.cnf
 #.INCLUDE ../acse/acse-exp.cnf
 
+#.EXPORTS
+AgreementID
+
 #.TYPE_RENAME
 CoordinateShadowUpdateArgumentData/updateStrategy/standard     StandardUpdate
 
@@ -35,13 +38,6 @@ EstablishParameter   B "dop.establish.roleb.2.5.19.1"        "shadow-establish-roleb"
 ModificationParameter  B "dop.modify.rolea.2.5.19.1"   "shadow-modify-rolea"
 ModificationParameter  B "dop.modify.roleb.2.5.19.1"   "shadow-modify-roleb"
 
-# these are useful to Thales DOP 
-ShadowingAgreementInfo B "dop.agreement.2.5.1.0.2.1"   "shadow-agreement"
-EstablishParameter     B "dop.establish.rolea.2.5.1.0.2.1"     "shadow-establish-rolea"
-EstablishParameter     B "dop.establish.roleb.2.5.1.0.2.1"     "shadow-establish-roleb"
-ModificationParameter  B "dop.modify.rolea.2.5.1.0.2.1"        "shadow-modify-rolea"
-ModificationParameter  B "dop.modify.roleb.2.5.1.0.2.1"        "shadow-modify-roleb"
-
 #.FN_PARS T_standard
        VAL_PTR = &update
 
@@ -125,4 +121,3 @@ ModificationParameter       B "dop.modify.roleb.2.5.1.0.2.1"        "shadow-modify-roleb"
   if (check_col(pinfo->cinfo, COL_INFO)) {
        col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", val_to_str(problem, disp_ShadowProblem_vals, "ShadowProblem(%%d)"));
   }
-
index 9087fa8181e297004aef2c69f56731d387f56872..3870a42ca2d530cd83bf10d87c12e9acb4e97af8 100644 (file)
@@ -263,6 +263,9 @@ void proto_reg_handoff_disp(void) {
 
   tpkt_handle = find_dissector("tpkt");
 
+  /* DNs */
+  x509if_register_fmt(hf_disp_contextPrefix, "cp=");
+
 }
 
 
index 7f5d212e5ac274c9cc3e4879334071dfc484f541..bb6f8f3503539f09131ed146c07863726e519a07 100644 (file)
@@ -26,5 +26,6 @@
 #ifndef PACKET_DISP_H
 #define PACKET_DISP_H
 
+#include "packet-disp-exp.h"
 
 #endif  /* PACKET_DISP_H */
index 13540a392f3836d4add99698ee1aa5eb7a170342..645660e5861ac42fa5465d6496086be50e964987 100644 (file)
@@ -1,10 +1,12 @@
 #.IMPORT_TAG
 DSEType                  BER_CLASS_UNI BER_UNI_TAG_BITSTRING
 SupplierAndConsumers     BER_CLASS_UNI BER_UNI_TAG_SET
+OperationalBindingID     BER_CLASS_UNI BER_UNI_TAG_SEQUENCE
 #.END
 
 #.TYPE_ATTR
 DSEType                  TYPE = FT_BYTES   DISPLAY = BASE_HEX   STRINGS = NULL  BITMASK = 0
 SupplierAndConsumers     TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
+OperationalBindingID     TYPE = FT_NONE    DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
 #.END
 
index de6d15fe2ec042ce90015a666f72aa7e9a6ea239..ad192bde1e9965d5d7062d2001533655a977678b 100644 (file)
@@ -14,6 +14,7 @@ AuthenticationFramework               x509af
 #.EXPORTS
 DSEType
 SupplierAndConsumers
+OperationalBindingID
 
 #.TYPE_RENAME
 EstablishOperationalBindingArgumentData/initiator      EstablishArgumentInitiator
@@ -87,66 +88,94 @@ NHOBSubordinateToSuperior           B "dop.modify.roleb.2.5.19.3"  "non-specific-hierarch
 #.FN_PARS      OBJECT_IDENTIFIER
        FN_VARIANT = _str VAL_PTR = &binding_type
 
+#.FN_BODY      OBJECT_IDENTIFIER
+  const char *name;
+
+  %(DEFAULT_BODY)s
+
+  if(check_col(pinfo->cinfo, COL_INFO)) {
+    name = get_ber_oid_name(binding_type);
+    col_append_fstr(pinfo->cinfo, COL_INFO, " %%s", name ? name : binding_type);
+  }
+
 #.FN_BODY      EstablishSymmetric
 
-  offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, pinfo, tree, "symmetric");
 
 #.FN_BODY      EstablishRoleAInitiates
 
-  offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, pinfo, tree, "roleA");
 
 #.FN_BODY      EstablishRoleBInitiates
 
-  offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, pinfo, tree, "roleB");
 
 #.FN_BODY      ModifySymmetric
 
-  offset = call_dop_oid_callback("dop.modify.symmetric", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.modify.symmetric", tvb, offset, pinfo, tree, "symmetric");
 
 #.FN_BODY      ModifyRoleAInitiates
 
-  offset = call_dop_oid_callback("dop.modify.rolea", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.modify.rolea", tvb, offset, pinfo, tree, "roleA");
 
 #.FN_BODY      ModifyRoleBInitiates
 
-  offset = call_dop_oid_callback("dop.modify.roleb", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.modify.roleb", tvb, offset, pinfo, tree, "roleB");
 
 #.FN_BODY      TerminateSymmetric
 
-  offset = call_dop_oid_callback("dop.terminate.symmetric", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.terminate.symmetric", tvb, offset, pinfo, tree, "symmetric");
 
 #.FN_BODY      TerminateRoleAInitiates
 
-  offset = call_dop_oid_callback("dop.terminate.rolea", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.terminate.rolea", tvb, offset, pinfo, tree, "roleA");
 
 #.FN_BODY      TerminateRoleBInitiates
 
-  offset = call_dop_oid_callback("dop.terminate.roleb", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.terminate.roleb", tvb, offset, pinfo, tree, "roleB");
 
 #.FN_BODY      T_agreement
 
-  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL);
 
 #.FN_BODY      T_symmetric
 
-  offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, pinfo, tree); 
+  offset = call_dop_oid_callback("dop.establish.symmetric", tvb, offset, pinfo, tree, "symmetric"); 
 
 #.FN_BODY      T_roleA_replies
 
-  offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.establish.rolea", tvb, offset, pinfo, tree, "roleA");
 
 #.FN_BODY      T_roleB_replies
 
-  offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.establish.roleb", tvb, offset, pinfo, tree, "roleB");
 
 #.FN_BODY      T_agreementProposal
 
-  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL);
 
 #.FN_BODY      ResultNewAgreement
 
-  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL);
 
 #.FN_BODY      ArgumentNewAgreement
 
-  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree);
+  offset = call_dop_oid_callback("dop.agreement", tvb, offset, pinfo, tree, NULL);
+
+
+#.FN_PARS INTEGER
+       VAL_PTR = &value
+
+#.FN_BODY INTEGER
+       guint32 value;
+
+       %(DEFAULT_BODY)s
+
+       if (check_col(pinfo->cinfo, COL_INFO)) {
+               if(hf_index == hf_dop_identifier) {
+                       col_append_fstr(pinfo->cinfo, COL_INFO, " id=%%d", value);
+               } else if (hf_index == hf_dop_version) {
+                       col_append_fstr(pinfo->cinfo, COL_INFO, ",%%d", value);
+               }
+       }
+
index 395d62bafa87f17827a902b7c777e5c09e1463ed..da0c9f6572017a7fe7d66d8c2c9a30eb4209281c 100644 (file)
@@ -63,7 +63,7 @@ int proto_dop = -1;
 static struct SESSION_DATA_STRUCTURE* session = NULL;
 static const char *binding_type = NULL; /* binding_type */
 
-static int call_dop_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
+static int call_dop_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *col_info);
 
 #include "packet-dop-hf.c"
 
@@ -74,18 +74,16 @@ static gint ett_dop = -1;
 #include "packet-dop-fn.c"
 
 static int
-call_dop_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
+call_dop_oid_callback(char *base_oid, tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *col_info)
 {
-  const char *name = NULL;
   char binding_param[BER_MAX_OID_STR_LEN];
 
-  sprintf(binding_param, "%s.%s", base_oid, binding_type ? binding_type : ""); 
+  g_snprintf(binding_param, BER_MAX_OID_STR_LEN, "%s.%s", base_oid, binding_type ? binding_type : ""); 
 
-  name = get_ber_oid_name(binding_param);
-  proto_item_append_text(tree, " (%s)", name ? name : binding_param); 
+  if (col_info && (check_col(pinfo->cinfo, COL_INFO))) 
+    col_append_fstr(pinfo->cinfo, COL_INFO, " %s", col_info);
 
   return call_ber_oid_callback(binding_param, tvb, offset, pinfo, tree);
-
 }
 
 
@@ -230,9 +228,6 @@ void proto_register_dop(void) {
   /* Register protocol */
   proto_dop = proto_register_protocol(PNAME, PSNAME, PFNAME);
 
-  /* initially disable the protocol */
-  proto_set_decoding(proto_dop, FALSE);
-
   register_dissector("dop", dissect_dop, proto_dop);
 
   /* Register fields and subtrees */
@@ -272,6 +267,12 @@ void proto_reg_handoff_dop(void) {
     register_ros_oid_dissector_handle("2.5.9.4", handle, 0, "id-as-directory-operational-binding-management", FALSE); 
   }
 
+  /* BINDING TYPES */
+
+  register_ber_oid_name("2.5.19.1", "shadow-agreement");
+  register_ber_oid_name("2.5.19.2", "hierarchical-agreement");
+  register_ber_oid_name("2.5.19.3", "non-specific-hierarchical-agreement");
+
   /* remember the tpkt handler for change in preferences */
   tpkt_handle = find_dissector("tpkt");
 
index 5bc30f58ea3fa6f4feb46afac7c87f7db079eaf2..3f72c1514c7a2e3576be4471ac5205eb8e878003 100644 (file)
@@ -424,8 +424,6 @@ ReferenceType ::= ENUMERATED {
   supplier(5), master(6), immediateSuperior(7), self(8)}
 
 AccessPoint ::= SET {
--- The following line, whilst wrong, helps with Thales DOP dissection
---  ae-title             [0] IMPLICIT NULL,
   ae-title             [0]  Name,
   address              [1]  PresentationAddress,
   protocolInformation  [2]  SET --SIZE (1..MAX)-- OF ProtocolInformation OPTIONAL
index 4ec41b33b0cb00367699a0c7aca88c5c3b586142..b0c97dcb2f3ce42347b12a759c57d37c7895b8b2 100644 (file)
@@ -174,12 +174,14 @@ void proto_register_ros(void) {
 
   ros_oid_dissector_table = register_dissector_table("ros.oid", "ROS OID Dissectors", FT_STRING, BASE_NONE);
   oid_table=g_hash_table_new(g_str_hash, g_str_equal);
+
+  ros_handle = find_dissector("ros");
+
 }
 
 
 /*--- proto_reg_handoff_ros --- */
 void proto_reg_handoff_ros(void) {
 
-  ros_handle = find_dissector("ros");
 
 }
index 27c2b9f6cb41710383a49649983654bb2d311d93..cbe514952c835aa247feb5e50c18950b80dd114d 100644 (file)
@@ -198,12 +198,14 @@ void proto_register_rtse(void) {
   rtse_oid_dissector_table = register_dissector_table("rtse.oid", "RTSE OID Dissectors", FT_STRING, BASE_NONE);
   oid_table=g_hash_table_new(g_str_hash, g_str_equal);
 
+  rtse_handle = find_dissector("rtse");
+  ros_handle = find_dissector("ros");
+
 }
 
 
 /*--- proto_reg_handoff_rtse --- */
 void proto_reg_handoff_rtse(void) {
 
-  rtse_handle = find_dissector("rtse");
-  ros_handle = find_dissector("ros");
+
 }
index 69bae85136600cbb7b32b3cf46b7968f3e2c6fa8..98a612167a8607871612317e5414cc62d5cd3a8d 100644 (file)
@@ -10,7 +10,7 @@ $(DISSECTOR_FILES): ../../tools/asn2eth.py x411.asn packet-x411-template.c packe
        python ../../tools/asn2eth.py -X -b -e -p x411 -c x411.cnf -s packet-x411-template  x411.asn
 
 clean:
-       rm -f parsetab.py $(DISSECTOR_FILES)
+       rm -f parsetab.py $(DISSECTOR_FILES) *~
 
 copy_files: generate_dissector
        cp $(DISSECTOR_FILES) ../../epan/dissectors
index 16bf152eba175e26b3a074546dd4c7a1756513a8..d184bfb10e6fa34366d9705235597103a717dd92 100644 (file)
@@ -67,6 +67,12 @@ static gboolean doing_dn = TRUE;
 static char *last_dn = NULL;
 static char *last_rdn = NULL;
 
+static int ava_hf_index;
+#define MAX_FMT_VALS   32
+static value_string fmt_vals[MAX_FMT_VALS];
+#define MAX_AVA_STR_LEN   64
+static char *last_ava = NULL;
+
 #include "packet-x509if-fn.c"
 
 const char * x509if_get_last_dn(void)
@@ -74,6 +80,32 @@ const char * x509if_get_last_dn(void)
   return last_dn;
 }
 
+gboolean x509if_register_fmt(int hf_index, const gchar *fmt)
+{
+  static int idx = 0;
+
+  if(idx < (MAX_FMT_VALS - 1)) {
+
+    fmt_vals[idx].value = hf_index;
+    fmt_vals[idx].strptr = fmt;
+
+    idx++;
+
+    fmt_vals[idx].value = 0;
+    fmt_vals[idx].strptr = NULL;
+
+    return TRUE;
+
+  } else 
+    return FALSE; /* couldn't register it */
+
+}
+
+const char * x509if_get_last_ava(void)
+{
+  return last_ava;
+}
+
 /*--- proto_register_x509if ----------------------------------------------*/
 void proto_register_x509if(void) {
 
@@ -101,6 +133,10 @@ void proto_register_x509if(void) {
   proto_register_field_array(proto_x509if, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
 
+  /* initialise array */
+  fmt_vals[0].value = 0;
+  fmt_vals[0].strptr = NULL;
+
 }
 
 
index 1be265ab240e11627844ba024cada4bfe6a76a67..6936986057de8256b8cefbb32f60198087037bfe 100644 (file)
@@ -30,5 +30,8 @@
 
 extern const char * x509if_get_last_dn(void);
 
+extern gboolean x509if_register_fmt(int hf_index, const gchar *fmt);
+extern const char * x509if_get_last_ava(void);
+
 #endif  /* PACKET_X509IF_H */
 
index 1a24ae1c211be778ea8b4a322b837fa3ab8e7bda..23cff72f4b676537efb317f6b3038ddbf7e255b3 100644 (file)
@@ -89,6 +89,16 @@ RequestAttribute/defaultValues/_item/values/_item    ra_values_item
 RequestAttribute/selectedValues                                ra_selectedValues
 RequestAttribute/selectedValues/_item                  ra_selectedValues_item
 
+#.REGISTER
+DistinguishedName      B       "2.5.4.1"       "id-at-aliasedEntryName"
+DistinguishedName      B       "2.5.4.31"      "id-at-member"
+DistinguishedName      B       "2.5.4.32"      "id-at-owner"
+DistinguishedName      B       "2.5.4.33"      "id-at-roleOccupant"
+DistinguishedName      B       "2.5.4.34"      "id-at-seeAlso"
+DistinguishedName      B       "2.5.4.49"      "id-at-distinguishedName"
+
+
+
 #.FN_PARS ContextId
   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id
 
@@ -99,6 +109,7 @@ RequestAttribute/selectedValues/_item                        ra_selectedValues_item
   FN_VARIANT = _str  HF_INDEX = hf_x509if_object_identifier_id  VAL_PTR = &object_identifier_id
 
 #.FN_BODY AttributeId
+  const char *fmt; 
   const char *name;
 
   %(DEFAULT_BODY)s
@@ -115,18 +126,33 @@ RequestAttribute/selectedValues/_item                     ra_selectedValues_item
      /* append it to the tree */
      proto_item_append_text(tree, " (%%s=", name);
     }
+
+    if((fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
+      /* we have a format */
+      last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';
+
+      g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s", name, fmt);
+
+      proto_item_append_text(tree, " %%s", last_ava);
+
+    }
   }
 
 #.FN_BODY AttributeValue
   int old_offset = offset;
   tvbuff_t     *out_tvb;
-  char *value = NULL;
+  char         *value = NULL;
+  const char   *fmt; 
+  const char   *name = NULL;
+
   offset=call_ber_oid_callback(object_identifier_id, tvb, offset, pinfo, tree);
 
   /* try and dissect as a string */
   dissect_ber_octet_string(FALSE, pinfo, NULL, tvb, old_offset, hf_x509if_any_string, &out_tvb);
   
+  /* should also try and dissect as an OID and integer */
+  /* of course, if I can look up the syntax .... */
+
   if(out_tvb) {
     /* it was a string - format it */
     value = tvb_format_text(out_tvb, 0, tvb_length(out_tvb));
@@ -138,6 +164,16 @@ RequestAttribute/selectedValues/_item                      ra_selectedValues_item
       proto_item_append_text(tree, "%%s)", value);
     }
 
+    if((fmt = val_to_str(ava_hf_index, fmt_vals, "")) && *fmt) {
+      /* we have a format */
+
+    if(!(name = get_ber_oid_name(object_identifier_id)))
+      name = object_identifier_id;
+    g_snprintf(last_ava, MAX_AVA_STR_LEN, "%%s %%s %%s", name, fmt, value);
+
+    proto_item_append_text(tree, " %%s", last_ava);
+
+    }
   }
 
 #.FN_BODY SelectedValues
@@ -193,6 +229,7 @@ RequestAttribute/selectedValues/_item                       ra_selectedValues_item
   rdn_one_value = TRUE;
 
 #.FN_BODY RDNSequence
+  const char *fmt; 
 
   dn_one_rdn = FALSE; /* reset */
   last_dn = ep_alloc(MAX_RDN_STR_LEN); *last_dn = '\0';
@@ -203,6 +240,12 @@ RequestAttribute/selectedValues/_item                      ra_selectedValues_item
   /* we've finished - append the dn */
   proto_item_append_text(top_of_dn, " (%%s)", last_dn);
 
+ /* see if we should append this to the col info */
+  if(check_col(pinfo->cinfo, COL_INFO) &&
+     (fmt = val_to_str(hf_index, fmt_vals, "")) && *fmt) {
+      /* we have a format */
+       col_append_fstr(pinfo->cinfo, COL_INFO, " %%s%%s", fmt, last_dn);
+    }
 
 #.FN_BODY RDNSequence/_item
 
@@ -215,6 +258,15 @@ RequestAttribute/selectedValues/_item                      ra_selectedValues_item
 
   dn_one_rdn = TRUE;
 
+#.FN_BODY AttributeValueAssertion
+
+       ava_hf_index = hf_index;
+       last_ava = ep_alloc(MAX_AVA_STR_LEN); *last_ava = '\0';
+
+       %(DEFAULT_BODY)s
+
+       ava_hf_index=-1;
+
 #.END
 
 
index 7d18fcc873d8d6157b04b31eaa7757846de7c7a4..71177d43682e6021e55c60ee53254b59934b3e00 100644 (file)
@@ -8,6 +8,7 @@ generate_dissector: $(DISSECTOR_FILES)
 
 $(DISSECTOR_FILES): ../../tools/asn2eth.py SelectedAttributeTypes.asn packet-x509sat-template.c packet-x509sat-template.h x509sat.cnf ../x509if/x509if-exp.cnf
        python ../../tools/asn2eth.py -X -b -e -p x509sat -c x509sat.cnf -s packet-x509sat-template SelectedAttributeTypes.asn
+       sed -e "s/\([\"\.]\)Syntax/\1/g" -i.orig packet-x509sat.c
 
 clean:
        rm -f parsetab.py $(DISSECTOR_FILES)
index e4f3fc647421b1aa7c3cd558932101a8f20f7af4..31f8eedc0e5f6adfae97a571a3e8be04996fea2e 100644 (file)
@@ -39,14 +39,15 @@ IMPORTS
 -- Directory string type 
 --This one is much better declared as this,  it is prettier at least
 --the octet string dissector can handle all of them
-DirectoryString ::= PrintableString
---DirectoryString ::= CHOICE {
---  teletexString    TeletexString,
---  printableString  PrintableString,
---  universalString  UniversalString,
---  bmpString        BMPString,
---  uTF8String       UTF8String
---}
+--DirectoryString ::= PrintableString
+
+DirectoryString ::= CHOICE {
+  teletexString    TeletexString,
+  printableString  PrintableString,
+  universalString  UniversalString,
+  bmpString        BMPString,
+  uTF8String       UTF8String
+}
 
 
 -- Attribute types 
@@ -1451,6 +1452,37 @@ id-at-pseudonym OBJECT IDENTIFIER ::= {id-at 65}
 -- 
 -- id-cat-selectedContexts OBJECT IDENTIFIER ::= {id-cat 4}
 
+--
+-- We add these in to give the low-level ASN.1 syntaxes
+-- PrintableString and ObjectIdentifier are the most useful
+-- Note the "Syntax" will be removed during the "make" - it is 
+-- present to stop asn2eth complaining about reserved words
+--
+
+ObjectIdentifier ::= OBJECT IDENTIFIER
+OctetString ::= OCTET STRING
+BitString ::= BIT STRING
+Integer ::= INTEGER
+Boolean ::= BOOLEAN
+
+-- these are reserved words, so we need to prefix them
+SyntaxGeneralizedTime ::= GeneralizedTime
+SyntaxUTCTime ::= UTCTime
+SyntaxNumericString ::= NumericString
+SyntaxPrintableString ::= PrintableString
+SyntaxIA5String ::= IA5String
+SyntaxBMPString ::= BMPString
+SyntaxUniversalString ::= UniversalString
+SyntaxUTF8String ::= UTF8String
+SyntaxTeletexString ::= TeletexString
+SyntaxT61String ::= T61String
+SyntaxVideotexString ::= VideotexString
+SyntaxGraphicString ::= GraphicString
+SyntaxISO646String ::= ISO646String
+SyntaxVisibleString ::= VisibleString
+SyntaxGeneralString ::= GeneralString
+
+
 END -- SelectedAttributeTypes
 
 -- Generated by Asnp, the ASN.1 pretty-printer of France Telecom R&D
index 6f411f0608386cdea618939d7b1440da40c2779b..36a3c3e2600eadbf296e5ade40fb46c4b691f291 100644 (file)
@@ -1,5 +1,5 @@
 #.IMPORT_TAG
-DirectoryString          BER_CLASS_UNI BER_UNI_TAG_PrintableString
+DirectoryString          BER_CLASS_ANY/*choice*/ -1/*choice*/
 UniqueIdentifier         BER_CLASS_UNI BER_UNI_TAG_BITSTRING
 CountryName              BER_CLASS_UNI BER_UNI_TAG_PrintableString
 Criteria                 BER_CLASS_ANY/*choice*/ -1/*choice*/
@@ -32,7 +32,7 @@ LocaleContextSyntax      BER_CLASS_ANY/*choice*/ -1/*choice*/
 #.END
 
 #.TYPE_ATTR
-DirectoryString          TYPE = FT_STRING  DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
+DirectoryString          TYPE = FT_UINT32  DISPLAY = BASE_DEC   STRINGS = VALS(x509sat_DirectoryString_vals)  BITMASK = 0
 UniqueIdentifier         TYPE = FT_BYTES   DISPLAY = BASE_HEX   STRINGS = NULL  BITMASK = 0
 CountryName              TYPE = FT_STRING  DISPLAY = BASE_NONE  STRINGS = NULL  BITMASK = 0
 Criteria                 TYPE = FT_UINT32  DISPLAY = BASE_DEC   STRINGS = VALS(x509sat_Criteria_vals)  BITMASK = 0
index c112117295d4ee54ca779e7e266d30a3532bffb6..46344a2fc9940ccfbfc1557f25542bd2bc02f5eb 100644 (file)
@@ -61,41 +61,108 @@ TelexNumber
 UniqueIdentifier
 X121Address
 
+ObjectIdentifier
+OctetString
+BitString
+Integer
+Boolean
+SyntaxGeneralizedTime
+SyntaxUTCTime
+SyntaxNumericString
+SyntaxPrintableString
+SyntaxIA5String
+SyntaxBMPString
+SyntaxUniversalString
+SyntaxUTF8String
+SyntaxTeletexString
+SyntaxT61String
+SyntaxVideotexString
+SyntaxGraphicString
+SyntaxISO646String
+SyntaxVisibleString
+SyntaxGeneralString
+
 #.REGISTER
-CountryName     B "2.5.4.6"    "id-at-countryName"
-DirectoryString B "2.5.4.2"    "id-at-knowledgeInformation"
-DirectoryString B "2.5.4.10"   "id-at-organizationName"
-DirectoryString B "2.5.4.7.1"  "id-at-collectiveLocalityName"
-DirectoryString B "2.5.4.3"    "id-at-commonName"
-DirectoryString B "2.5.4.4"    "id-at-surname"
-DirectoryString B "2.5.4.42"   "id-at-givenName"
-DirectoryString B "2.5.4.43"   "id-at-initials"
-DirectoryString B "2.5.4.44"   "id-at-generationQualifier"
-DirectoryString B "2.5.4.51"   "id-at-houseIdentifier"
-DirectoryString B "2.5.4.54"   "id-at-dmdName"
-DirectoryString B "2.5.4.65"   "id-at-pseudonym"
-DirectoryString B "2.5.4.41"   "id-at-name"
-DirectoryString B "2.5.4.8.1"  "id-at-collectiveStateOrProvinceName"
-DirectoryString B "2.5.4.8"    "id-at-stateOrProvinceName"
-DirectoryString B "2.5.4.9"    "id-at-streetAddress"
-DirectoryString B "2.5.4.9.1"  "id-at-collectiveStreetAddress"
-DirectoryString B "2.5.4.10.1" "id-at-collectiveOrganizationName"
-DirectoryString B "2.5.4.7"    "id-at-localityName"
-DirectoryString B "2.5.4.11"   "id-at-organizationalUnitName"
-DirectoryString B "2.5.4.11.1" "id-at-collectiveOrganizationalUnitName"
-DirectoryString B "2.5.4.12"   "id-at-title"
-DirectoryString B "2.5.4.13"   "id-at-description"
-DirectoryString B "2.5.4.15"   "id-at-businessCategory"
-DirectoryString B "2.5.4.17"   "id-at-postalCode"
-DirectoryString B "2.5.4.17.1" "id-at-collectivePostalCode"
-DirectoryString B "2.5.4.18"   "id-at-postOfficeBox"
-DirectoryString B "2.5.4.18.1" "id-at-collectivePostOfficeBox"
-DirectoryString B "2.5.4.19"   "id-at-physicalDeliveryOfficeName"
-DirectoryString B "2.5.4.19.1" "id-at-collectivePhysicalDeliveryOfficeName"
-TelephoneNumber B "2.5.4.20"   "id-at-telephoneNumber"
-TelephoneNumber B "2.5.4.20.1" "id-at-collectiveTelephoneNumber"
-TelexNumber     B "2.5.4.21"   "id-at-telexNumber"
-TelexNumber     B "2.5.4.21.1" "id-at-collectiveTelexNumber"
+ObjectIdentifier        B "2.5.4.0"   "id-at-objectClass"
+#  - see x509if.cnf for "id-at-aliasedEntryName"
+DirectoryString         B "2.5.4.2"    "id-at-knowledgeInformation"
+DirectoryString         B "2.5.4.3"    "id-at-commonName"
+DirectoryString         B "2.5.4.4"    "id-at-surname"
+SyntaxPrintableString  B "2.5.4.5"    "id-at-serialNumber"
+CountryName             B "2.5.4.6"    "id-at-countryName"
+DirectoryString         B "2.5.4.7"    "id-at-localityName"
+DirectoryString         B "2.5.4.7.1"  "id-at-collectiveLocalityName"
+DirectoryString         B "2.5.4.8"    "id-at-stateOrProvinceName"
+DirectoryString         B "2.5.4.8.1"  "id-at-collectiveStateOrProvinceName"
+DirectoryString         B "2.5.4.9"    "id-at-streetAddress"
+DirectoryString         B "2.5.4.9.1"  "id-at-collectiveStreetAddress"
+DirectoryString         B "2.5.4.10.1" "id-at-collectiveOrganizationName"
+DirectoryString         B "2.5.4.10"   "id-at-organizationName"
+DirectoryString         B "2.5.4.11"   "id-at-organizationalUnitName"
+DirectoryString         B "2.5.4.11.1" "id-at-collectiveOrganizationalUnitName"
+DirectoryString         B "2.5.4.12"   "id-at-title"
+DirectoryString         B "2.5.4.13"   "id-at-description"
+EnhancedGuide          B "2.5.4.14"   "id-at-searchGuide"
+DirectoryString         B "2.5.4.15"   "id-at-businessCategory"
+PostalAddress           B "2.5.4.16"   "id-at-postalAddress"
+DirectoryString         B "2.5.4.17"   "id-at-postalCode"
+DirectoryString         B "2.5.4.17.1" "id-at-collectivePostalCode"
+DirectoryString         B "2.5.4.18"   "id-at-postOfficeBox"
+DirectoryString         B "2.5.4.18.1" "id-at-collectivePostOfficeBox"
+DirectoryString         B "2.5.4.19"   "id-at-physicalDeliveryOfficeName"
+DirectoryString         B "2.5.4.19.1" "id-at-collectivePhysicalDeliveryOfficeName"
+TelephoneNumber         B "2.5.4.20"   "id-at-telephoneNumber"
+TelephoneNumber         B "2.5.4.20.1" "id-at-collectiveTelephoneNumber"
+TelexNumber             B "2.5.4.21"   "id-at-telexNumber"
+TelexNumber             B "2.5.4.21.1" "id-at-collectiveTelexNumber"
+# "id-at-teletexTerminalIdentifier" - what syntax?
+FacsimileTelephoneNumber B "2.5.4.23" "id-at-facsimileTelephoneNumber"
+FacsimileTelephoneNumber B "2.5.4.23.1" "id-at-collectiveFacsimileTelephoneNumber"
+X121Address             B "2.5.4.24"   "id-at-x121Address"
+InternationalISDNNumber B "2.5.4.25" "id-at-internationalISDNNumber"
+InternationalISDNNumber B "2.5.4.25.1" "id-at-collectiveInternationalISDNNumber"
+PostalAddress           B "2.5.4.26" "id-at-registeredAddress"
+DestinationIndicator    B "2.5.4.27" "id-at-destinationIndicator"
+PreferredDeliveryMethod B "2.5.4.28" "id-at-preferredDeliveryMethod"
+PresentationAddress     B "2.5.4.29" "id-at-presentationAddress"
+ObjectIdentifier        B "2.5.4.30" "id-at-supportedApplicationContext"
+# "id-at-member" - see x509if.cnf
+# "id-at-owner" - see x509if.cnf
+# "id-at-roleOccupant" - see x509if.cnf
+# "id-at-seeAlso" - see x509if.cnf
+OctetString        B "2.5.4.35" "id-at-userPassword"
+# "id-at-userCertificate" - see x509af.cnf
+# "id-at-cACertificate" - see x509af.cnf
+# "id-at-authorityRevocationList" - see x509af.cnf
+# "id-at-certificateRevocationList" - see x509af.cnf
+# "id-at-crossCertificatePair" - see x509af.cnf
+DirectoryString         B "2.5.4.41"   "id-at-name"
+DirectoryString         B "2.5.4.42"   "id-at-givenName"
+DirectoryString         B "2.5.4.43"   "id-at-initials"
+DirectoryString         B "2.5.4.44"   "id-at-generationQualifier"
+UniqueIdentifier        B "2.5.4.45"  "id-at-uniqueIdedntifier"
+SyntaxPrintableString    B "2.5.4.46"  "id-at-dnQualifier"
+EnhancedGuide           B "2.5.4.47"   "id-at-enhancedSearchGuide"
+ProtocolInformation     B "2.5.4.48" "id-at-protocolInformation"
+# 49 "id-at-distinguishedName" - see x509if.cnf
+NameAndOptionalUID      B "2.5.4.50" "id-at-uniqueMember"
+DirectoryString         B "2.5.4.51"   "id-at-houseIdentifier"
+ObjectIdentifier        B "2.5.4.52"   "id-at-supportedAlgorithms"
+# 53 "id-at-deltaRevocationList" - what syntax?
+DirectoryString         B "2.5.4.54"   "id-at-dmdName"
+# 55 "id-at-clearance" - what syntax (or rather where?)
+# 56 "id-at-defaultDirQop" - what syntax?
+# 56 "id-at-attributeIntegrityInfo" - what syntax?
+# 58 "id-at-attributeCertificate" - see x509af.cnf
+# 59 "id-at-attributeCertificateRevocationLIst" - see x509af.cnf
+# 60 "id-at-confKeyInfo" - what syntax?
+# 61 ?
+# 62 ?
+# 63 ?
+# 64 "id-at-familyInformation" - what syntax?
+DirectoryString        B "2.5.4.65"   "id-at-pseudonym"
+ObjectIdentifier       B "2.5.4.66" "id-at-communuicationsService"
+ObjectIdentifier       B "2.5.4.67" "id-at-communuicationsNetwork"
 
 #.NO_EMIT
 
@@ -111,9 +178,6 @@ XDayOf/third                                third_dayof
 XDayOf/fourth                          fourth_dayof
 XDayOf/fifth                           fifth_dayof
 
-#.FN_BODY DirectoryString
-       offset = dissect_ber_octet_string(implicit_tag, pinfo, tree, tvb, offset, hf_index, NULL);
-
 #.END