Hi!

It is happening for quite long time already, as I have to deal with
RADIUS traffic, it came to the point where I can't bear it no more.
All the traffic I see contains raw binary Class fields.

RFC2865 WRT Class field content says the following:

      The String field is one or more octets.  The actual format of the
      information is site or application specific, and a robust
      implementation SHOULD support the field as undistinguished octets.

      The codification of the range of allowed usage of this field is
      outside the scope of this specification.

Also the field is of a "string" type, and the type described by the same RFC as:

      string    1-253 octets containing binary data (values 0 through
                255 decimal, inclusive).  Strings of length zero (0)
                MUST NOT be sent; omit the entire attribute instead.

>From my experience with RADIUS traffic, it looks like it is an
implementation dependent identifier used to relate Access-Accept and
Accounting-Request. Thus it may have any value that is generated and
accepted by the server.

Default tcpdump has print-radius.c, which treats Class field as text
(it is like this since the very beginning dated 1997). So tcpdump
makes a copy of the value of maximum length of 127 octets and then
fprintfs it as "%s". With binary data going out like this it does some
weird things to PuTTy, so that it shows all kinds of graphics symbols
instead of ASCII characters.

Does anybody experience this too?

So if the RFC says it is a binary field, may be we need to change
tcpdump to make it treat the field as hex? I found myself being unable
to  live without a little change like:

Index: print-radius.c
===================================================================
RCS file: /home/cyxob/cvs/src/usr.sbin/tcpdump/print-radius.c,v
retrieving revision 1.8
diff -u -p -r1.8 print-radius.c
--- print-radius.c      23 May 2006 21:57:15 -0000      1.8
+++ print-radius.c      15 Dec 2009 11:42:44 -0000
@@ -125,7 +125,7 @@ static struct radius_atable radius_atts[
 { RADIUS_ATT_FRAMED_ROUTE,     RD_STRING,      "F-Rt",         { NULL } },
 { RADIUS_ATT_FRAMED_IPX,       RD_ADDRESS,     "F-IPX",        { NULL } },
 { RADIUS_ATT_CHALLENGE_STATE,  RD_STRING,      "CState",       { NULL } },
-{ RADIUS_ATT_CLASS,            RD_STRING,      "Class",        { NULL } },
+{ RADIUS_ATT_CLASS,            RD_HEX,         "Class",        { NULL } },
 { RADIUS_ATT_VENDOR_SPECIFIC,  RD_HEX,         "Vendor",       { NULL } },
 { RADIUS_ATT_SESSION_TIMEOUT,  RD_INT,         "S-TO",         { NULL } },
 { RADIUS_ATT_IDLE_TIMEOUT,     RD_INT,         "I-TO",         { NULL } },

Reply via email to