X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Frlm_soh%2Frlm_soh.c;h=00b0f607e53aaa2f8658d99d0165073b292f0a54;hb=9281c0d880d418101ad9a29d22ec5d386d13a9c6;hp=027e0f6441508ca8753cd9057881b663c26fe8f0;hpb=fa70d7266bc56dbaa70cb9a690f230492b3c1279;p=freeradius.git diff --git a/src/modules/rlm_soh/rlm_soh.c b/src/modules/rlm_soh/rlm_soh.c index 027e0f6..00b0f60 100644 --- a/src/modules/rlm_soh/rlm_soh.c +++ b/src/modules/rlm_soh/rlm_soh.c @@ -48,19 +48,19 @@ static size_t soh_xlat(UNUSED void *instance, REQUEST *request, char *fmt, char * FIXME: should have a #define for the attribute... * SoH-Supported == 2119 in dictionary.freeradius.internal */ - vp[0] = pairfind(request->packet->vps, 2119); + vp[0] = pairfind(request->packet->vps, 2119, 0); if (!vp[0]) return 0; if (strncasecmp(fmt, "OS", 2) == 0) { /* OS vendor */ - vp[0] = pairfind(request->packet->vps, 2100); - vp[1] = pairfind(request->packet->vps, 2101); - vp[2] = pairfind(request->packet->vps, 2102); - vp[3] = pairfind(request->packet->vps, 2103); - vp[4] = pairfind(request->packet->vps, 2104); - vp[5] = pairfind(request->packet->vps, 2105); + vp[0] = pairfind(request->packet->vps, 2100, 0); + vp[1] = pairfind(request->packet->vps, 2101, 0); + vp[2] = pairfind(request->packet->vps, 2102, 0); + vp[3] = pairfind(request->packet->vps, 2103, 0); + vp[4] = pairfind(request->packet->vps, 2104, 0); + vp[5] = pairfind(request->packet->vps, 2105, 0); if (vp[0] && vp[0]->vp_integer == 311) { if (!vp[1]) { @@ -140,6 +140,7 @@ static int soh_instantiate(CONF_SECTION *conf, void **instance) { static int soh_postauth(UNUSED void * instance, REQUEST *request) { #ifdef WITH_DHCP + int rcode; VALUE_PAIR *vp; vp = pairfind(request->packet->vps, DHCP2ATTR(43)); @@ -176,7 +177,10 @@ static int soh_postauth(UNUSED void * instance, REQUEST *request) } else { RDEBUG("SoH decoding NAP from DHCP request"); /* SoH payload */ - soh_verify(request->packet->vps, data, vlen); + rcode = soh_verify(request, request->packet->vps, data, vlen); + if (rcode < 0) { + return RLM_MODULE_FAIL; + } } break; default: @@ -205,7 +209,10 @@ static int soh_authorize(UNUSED void * instance, REQUEST *request) RDEBUG("SoH radius VP found"); /* decode it */ - rv = soh_verify(request->packet->vps, vp->vp_octets, vp->length); + rv = soh_verify(request, request->packet->vps, vp->vp_octets, vp->length); + if (rv < 0) { + return RLM_MODULE_FAIL; + } return RLM_MODULE_OK; }