Ethereal-dev: [patch]Re: [Ethereal-dev] AFP decodes

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

From: didier <dgautheron@xxxxxxxx>
Date: Fri, 25 Oct 2002 12:21:13 +0000
Esh, Andrew wrote:
While decoding some netatalk traffic, I noticed that the decode of a MacOS X AFP login packet, when it's using the "Cleartxt Passwd" UAM, is not decoding the user password properly. Note that in the AFP doc, the password must be pre-padded with nulls to start on an even byte, and

Yes, patch attached.

Index: packet-afp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-afp.c,v
retrieving revision 1.24
diff -u -r1.24 packet-afp.c
--- packet-afp.c	2002/10/17 22:38:19	1.24
+++ packet-afp.c	2002/10/25 12:04:51
@@ -2060,7 +2064,8 @@
 		len = tvb_get_guint8(tvb, offset);
 		proto_tree_add_item(tree, hf_afp_user, tvb, offset, 1,FALSE);
 		offset += len +1;
-
+		if ((offset & 1))
+			PAD(1);
 		len = 8; /* tvb_strsize(tvb, offset);*/
 		proto_tree_add_item(tree, hf_afp_passwd, tvb, offset, len,FALSE);
 		offset += len;