Allow EAP-Message APVs > 253 octets in EAP-TTLS module
authorTobias Brunner <tobias@strongswan.org>
Wed, 5 Dec 2012 11:51:31 +0000 (12:51 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 6 Dec 2012 16:59:44 +0000 (11:59 -0500)
According to RFC 5281, section 11.2.1 tunneled EAP packets that are
larger than 253 octets MUST be contained in a single EAP-Message AVP.

Also fixed the debug statement.

src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c

index 9ad6264..caaa62e 100644 (file)
@@ -201,8 +201,11 @@ static VALUE_PAIR *diameter2vp(REQUEST *request, SSL *ssl,
                        goto next_attr;
                }
 
-               if (size > 253) {
-                       RDEBUG2("WARNING: diameter2vp skipping long attribute %u, attr");
+               /*
+                * EAP-Message AVPs can be larger than 253 octets.
+                */
+               if ((size > 253) && !((VENDOR(attr) == 0) && (attr == PW_EAP_MESSAGE))) {
+                       RDEBUG2("WARNING: diameter2vp skipping long attribute %u", attr);
                        goto next_attr;
                }