From ffe710ae7136874aed62ca849c523fa62a0cdce9 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 4 Dec 2012 18:43:30 +0100 Subject: [PATCH] Patch AVP parsing in EAP-TTLS module in FreeRADIUS --- testing/scripts/recipes/freeradius.mk | 1 + testing/scripts/recipes/patches/freeradius-avp-size | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 testing/scripts/recipes/patches/freeradius-avp-size diff --git a/testing/scripts/recipes/freeradius.mk b/testing/scripts/recipes/freeradius.mk index ec530a8..7b7a5fe 100644 --- a/testing/scripts/recipes/freeradius.mk +++ b/testing/scripts/recipes/freeradius.mk @@ -16,6 +16,7 @@ CONFIG_OPTS = \ PATCHES = \ freeradius-eap-sim-identity \ + freeradius-avp-size \ freeradius-tnc-fhh all: install diff --git a/testing/scripts/recipes/patches/freeradius-avp-size b/testing/scripts/recipes/patches/freeradius-avp-size new file mode 100644 index 0000000..e7e1f63 --- /dev/null +++ b/testing/scripts/recipes/patches/freeradius-avp-size @@ -0,0 +1,18 @@ +diff --git a/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c b/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c +index 6c9bd13..3344c53 100644 +--- a/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c ++++ b/src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c +@@ -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; + } + -- 2.7.4