Patch EAP-SIM module in FreeRADIUS
This commit is contained in:
@@ -80,6 +80,7 @@ mount -o bind $ROOTFSCOMPILEDIR $LOOPDIR/root/compile >> $LOGFILE 2>&1
|
|||||||
cecho " * Installing software from source.."
|
cecho " * Installing software from source.."
|
||||||
RECPDIR=$UMLTESTDIR/testing/scripts/recipes
|
RECPDIR=$UMLTESTDIR/testing/scripts/recipes
|
||||||
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
|
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
|
||||||
|
cp -r $RECPDIR/patches $LOOPDIR/root/compile
|
||||||
for r in $RECIPES
|
for r in $RECIPES
|
||||||
do
|
do
|
||||||
cecho-n " - $r.."
|
cecho-n " - $r.."
|
||||||
|
|||||||
@@ -14,19 +14,29 @@ CONFIG_OPTS = \
|
|||||||
--enable-developer \
|
--enable-developer \
|
||||||
--with-experimental-modules
|
--with-experimental-modules
|
||||||
|
|
||||||
|
PATCHES = \
|
||||||
|
freeradius-eap-sim-identity
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
$(TAR):
|
$(TAR):
|
||||||
wget $(SRC)
|
wget $(SRC)
|
||||||
|
|
||||||
$(PKG): $(TAR)
|
.$(PKG)-unpacked: $(TAR)
|
||||||
tar xfj $(TAR)
|
tar xfj $(TAR)
|
||||||
|
@touch $@
|
||||||
|
|
||||||
configure: $(PKG)
|
.$(PKG)-patches-applied: .$(PKG)-unpacked
|
||||||
|
cd $(PKG) && cat $(addprefix ../patches/, $(PATCHES)) | patch -p1
|
||||||
|
@touch $@
|
||||||
|
|
||||||
|
.$(PKG)-configured: .$(PKG)-patches-applied
|
||||||
cd $(PKG) && ./configure $(CONFIG_OPTS)
|
cd $(PKG) && ./configure $(CONFIG_OPTS)
|
||||||
|
@touch $@
|
||||||
|
|
||||||
build: configure
|
.$(PKG)-built: .$(PKG)-configured
|
||||||
cd $(PKG) && make -j $(NUM_CPUS)
|
cd $(PKG) && make -j $(NUM_CPUS)
|
||||||
|
@touch $@
|
||||||
|
|
||||||
install: build
|
install: .$(PKG)-built
|
||||||
cd $(PKG) && make install
|
cd $(PKG) && make install
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
--- a/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c 2012-11-28 11:03:05.081225276 +0100
|
||||||
|
+++ b/src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c 2012-11-28 11:46:59.746289881 +0100
|
||||||
|
@@ -246,14 +246,21 @@
|
||||||
|
newvp->vp_integer = ess->sim_id++;
|
||||||
|
pairreplace(outvps, newvp);
|
||||||
|
|
||||||
|
+ ess->keys.identitylen = strlen(handler->identity);
|
||||||
|
+ memcpy(ess->keys.identity, handler->identity, ess->keys.identitylen);
|
||||||
|
+
|
||||||
|
/* make a copy of the identity */
|
||||||
|
newvp = pairfind(*invps, ATTRIBUTE_EAP_SIM_BASE + PW_EAP_SIM_IDENTITY);
|
||||||
|
- if (newvp) {
|
||||||
|
- ess->keys.identitylen = newvp->length;
|
||||||
|
- memcpy(ess->keys.identity, newvp->vp_octets, newvp->length);
|
||||||
|
- } else {
|
||||||
|
- ess->keys.identitylen = strlen(handler->identity);
|
||||||
|
- memcpy(ess->keys.identity, handler->identity, ess->keys.identitylen);
|
||||||
|
+ if (newvp && newvp->length > 2) {
|
||||||
|
+ uint16_t len;
|
||||||
|
+
|
||||||
|
+ memcpy(&len, newvp->vp_octets, sizeof(uint16_t));
|
||||||
|
+ len = ntohs(len);
|
||||||
|
+ if (len <= newvp->length - 2 && len <= MAX_STRING_LEN) {
|
||||||
|
+ ess->keys.identitylen = len;
|
||||||
|
+ memcpy(ess->keys.identity, newvp->vp_octets + 2,
|
||||||
|
+ ess->keys.identitylen);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* all set, calculate keys! */
|
||||||
Reference in New Issue
Block a user