add support to call krb4 for suspected krb4 stuff soming in on udp port 88
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 25 Feb 2005 11:38:56 +0000 (11:38 +0000)
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 25 Feb 2005 11:38:56 +0000 (11:38 +0000)
weirdo krb4 implementations apparently do this.

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

epan/dissectors/packet-kerberos.c
epan/dissectors/packet-kerberos4.c

index 81015e056ea2cb2ab3bf7b27b239d2d6927de2a2..f2c5ca1d22663cdd48be1b94da100260b5fe7a6a 100644 (file)
@@ -287,6 +287,8 @@ static gint ett_krb_e_checksum = -1;
 guint32 krb5_errorcode;
 
 
+dissector_handle_t krb4_handle=NULL;
+
 static int do_col_info;
 
 
@@ -3645,6 +3647,21 @@ dissect_kerberos_main(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int d
 static void
 dissect_kerberos_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
+    /* Some weird kerberos implementation apparently do krb4 on the krb5 port.
+       Since all (except weirdo transarc krb4 stuff) use 
+       an opcode <=16 in the first byte, use this to see if it might
+       be krb4.
+       All krb5 commands start with an APPL tag and thus is >=0x60
+       so if first byte is <=16  just blindly assume it is krb4 then
+    */
+    if(tvb_get_guint8(tvb, 0)<=0x10){
+      if(krb4_handle){ 
+       call_dissector(krb4_handle, tvb, pinfo, tree);
+      }
+      return;
+    }
+
+
     if (check_col(pinfo->cinfo, COL_PROTOCOL))
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "KRB5");
 
@@ -4244,6 +4261,7 @@ proto_register_kerberos(void)
                                   "The keytab file containing all the secrets",
                                   &keytab_filename);
 #endif
+
 }
 
 static int wrap_dissect_gss_kerb(tvbuff_t *tvb, int offset, packet_info *pinfo,
@@ -4277,6 +4295,8 @@ proto_reg_handoff_kerberos(void)
 {
     dissector_handle_t kerberos_handle_tcp;
 
+    krb4_handle = find_dissector("krb4");
+
     kerberos_handle_udp = create_dissector_handle(dissect_kerberos_udp,
        proto_kerberos);
     kerberos_handle_tcp = create_dissector_handle(dissect_kerberos_tcp,
index 1b2e1c95b581f8d7d2476f007fa05ee4ccdde1c5..b19db07ff188dcf95d80436f251220928d9e45b7 100644 (file)
@@ -432,6 +432,7 @@ proto_register_krb4(void)
 
   proto_krb4 = proto_register_protocol("Kerberos v4",
                                       "KRB4", "krb4");
+  register_dissector("krb4", dissect_krb4, proto_krb4);
   proto_register_field_array(proto_krb4, hf, array_length(hf));
   proto_register_subtree_array(ett, array_length(ett));
 }