Ethereal-dev: [Ethereal-dev] [patch] AFS dissector

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Loic Tortay <tortay@xxxxxxxxxxx>
Date: Sat, 28 Sep 2002 20:28:20 +0200
Hello,
I sent a patch for "packet-afs.c" regarding AFS KAUTH dissection a few
monthes ago.

Unfortunately, my patch was overly simplistic.  At the time I was
mostly interested in avoiding the core dump generated when reading an
AFS KAUTH packet, and did not pay much attention to the KAUTH details.

More specifically, the patch I provided avoided the core dump but did
not display the KAUTH information correctly and even displayed a
'Malformed Packet' tag in the decode window.

I hope it's not too late to have this included in the coming new release.

Attached are: a correct patch (against a 0.9.7 CVS checkout), and an
ASCII dump of a sample AFS KAUTH packet.


Loïc.

--- packet-afs.c.orig	Wed Aug 28 23:00:07 2002
+++ packet-afs.c	Sat Sep 28 17:35:55 2002
@@ -1105,11 +1105,7 @@
 			break;
 		case 3: /* getticket-old */
 		case 23: /* getticket */
-			OUT_UINT(hf_afs_kauth_kvno);
-			OUT_RXString(hf_afs_kauth_domain);
-			OUT_BYTES_ALL(hf_afs_kauth_data);
-			OUT_RXString(hf_afs_kauth_princ);
-			OUT_RXString(hf_afs_kauth_realm);
+			OUT_KAUTH_GetTicket();
 			break;
 		case 4: /* set pass */
 			OUT_RXString(hf_afs_kauth_princ);
--- packet-afs-macros.h.orig	Wed Aug 28 23:00:07 2002
+++ packet-afs-macros.h	Sat Sep 28 17:37:40 2002
@@ -506,3 +506,17 @@
 			sizeof(guint32),counter); \
 		tree = save; \
 	}
+
+/* Output a kauth getticket request */
+#define OUT_KAUTH_GetTicket() \
+	{ \
+		int len = 0; \
+		OUT_UINT(hf_afs_kauth_kvno); \
+		OUT_RXString(hf_afs_kauth_domain); \
+		len = tvb_get_ntohl(tvb, offset); \
+		offset += 4; \
+		OUT_BYTES(hf_afs_kauth_data, len); \
+		OUT_RXString(hf_afs_kauth_princ); \
+		OUT_RXString(hf_afs_kauth_realm); \
+	}
+
  1   0.000000 134.158.105.131 -> 134.158.232.11 AFS (RX) KAUTH Request: get-ticket (23)

0000  00 50 80 19 6a 0a 00 c0 4f 60 1c 30 08 00 45 00   .P..j...O`.0..E.
0010  00 a0 f1 b1 00 00 40 11 29 d0 86 9e 69 83 86 9e   ......@.)...i...
0020  e8 0b 07 29 1b 5c 00 8c 84 83 3d 07 69 59 f4 28   ...).\....=.iY.(
0030  34 d8 00 00 00 01 00 00 00 01 00 00 00 01 01 05   4...............
0040  00 00 00 00 02 dc 00 00 00 17 00 00 00 78 00 00   .............x..
0050  00 08 49 4e 32 50 33 2e 46 52 00 00 00 30 97 47   ..IN2P3.FR...0.G
0060  ea c2 50 cd 97 55 2b a9 53 70 06 0a 36 0d e7 1c   ..P..U+.Sp..6...
0070  ae 49 3a 96 ac 2f c9 cd af bd 49 31 2a 58 66 94   .I:../....I1*Xf.
0080  79 2e 6c fe 1f 0b e4 60 6c bd 8e c0 cf 22 00 00   y.l....`l...."..
0090  00 03 61 66 73 00 00 00 00 00 00 00 00 08 1e ca   ..afs...........
00a0  1d 7b bd 2e b5 c6 00 00 02 bc 00 00 00 00         .{............