Fixes to make more modules build
authorAlan T. DeKok <aland@freeradius.org>
Fri, 11 Jun 2010 12:54:07 +0000 (14:54 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 11 Jun 2010 12:54:07 +0000 (14:54 +0200)
src/modules/rlm_cram/rlm_cram.c
src/modules/rlm_jradius/rlm_jradius.c
src/modules/rlm_sim_files/rlm_sim_files.c
src/modules/rlm_wimax/rlm_wimax.c

index 77fd14a..c3c0376 100644 (file)
@@ -51,10 +51,10 @@ RCSID("$Id$")
 
 #include       <ctype.h>
 
-
-#define                SM_AUTHTYPE     ((11406<<16)|101)
-#define                SM_CHALLENGE    ((11406<<16)|102)
-#define                SM_RESPONSE     ((11406<<16)|103)
+#define VENDORPEC_SM  11406
+#define                SM_AUTHTYPE     101
+#define                SM_CHALLENGE    102
+#define                SM_RESPONSE     103
 
 
 
@@ -137,17 +137,17 @@ static int cram_authenticate(UNUSED void * instance, REQUEST *request)
                radlog(L_AUTH, "rlm_cram: Cleartext-Password is required for authentication.");
                return RLM_MODULE_INVALID;
        }
-       authtype = pairfind(request->packet->vps, SM_AUTHTYPE);
+       authtype = pairfind(request->packet->vps, SM_AUTHTYPE, VENDORPEC_SM);
        if(!authtype) {
                radlog(L_AUTH, "rlm_cram: Required attribute Sandy-Mail-Authtype missed");
                return RLM_MODULE_INVALID;
        }
-       challenge = pairfind(request->packet->vps, SM_CHALLENGE);
+       challenge = pairfind(request->packet->vps, SM_CHALLENGE, VENDORPEC_SM);
        if(!challenge) {
                radlog(L_AUTH, "rlm_cram: Required attribute Sandy-Mail-Challenge missed");
                return RLM_MODULE_INVALID;
        }
-       response = pairfind(request->packet->vps, SM_RESPONSE);
+       response = pairfind(request->packet->vps, SM_RESPONSE, VENDORPEC_SM);
        if(!response) {
                radlog(L_AUTH, "rlm_cram: Required attribute Sandy-Mail-Response missed");
                return RLM_MODULE_INVALID;
index fbbf4e2..3dd362f 100644 (file)
@@ -784,7 +784,7 @@ static int read_vps(JRADIUS *inst, JRSOCK *jrsock, VALUE_PAIR **pl, int plen)
     /*
      *     Create new attribute
      */
-    vp = paircreate(atype, -1);
+    vp = paircreate(atype, 0, -1);
     vp->operator = aop;
 
     if (vp->type == -1) {
index 7eff843..4999092 100644 (file)
@@ -203,16 +203,16 @@ static int sim_file_authorize(void *instance, REQUEST *request)
                }
 
 
-               r = paircreate(ATTRIBUTE_EAP_SIM_RAND1 + imsicount, PW_TYPE_OCTETS);
+               r = paircreate(ATTRIBUTE_EAP_SIM_RAND1 + imsicount, 0, PW_TYPE_OCTETS);
                r = pairparsevalue(r, chal);
                pairadd(reply_pairs, r);
 
-               k = paircreate(ATTRIBUTE_EAP_SIM_KC1 + imsicount, PW_TYPE_OCTETS);
+               k = paircreate(ATTRIBUTE_EAP_SIM_KC1 + imsicount, 0, PW_TYPE_OCTETS);
                k = pairparsevalue(k, kc);
                rad_assert(k != NULL);
                pairadd(reply_pairs, k);
 
-               s = paircreate(ATTRIBUTE_EAP_SIM_SRES1 + imsicount, PW_TYPE_OCTETS);
+               s = paircreate(ATTRIBUTE_EAP_SIM_SRES1 + imsicount, 0, PW_TYPE_OCTETS);
                s = pairparsevalue(s, sres);
                pairadd(reply_pairs, s);
 
index bb1b458..d88d06d 100644 (file)
@@ -178,8 +178,8 @@ static int wimax_postauth(void *instance, REQUEST *request)
        uint8_t mip_rk_1[EVP_MAX_MD_SIZE], mip_rk_2[EVP_MAX_MD_SIZE];
        uint8_t mip_rk[2 * EVP_MAX_MD_SIZE];
 
-       msk = pairfind(request->reply->vps, 1129);
-       emsk = pairfind(request->reply->vps, 1130);
+       msk = pairfind(request->reply->vps, 1129, 0);
+       emsk = pairfind(request->reply->vps, 1130, 0);
        if (!msk || !emsk) {
                RDEBUG("No EAP-MSK or EAP-EMSK.  Cannot create WiMAX keys.");
                return RLM_MODULE_NOOP;
@@ -270,8 +270,8 @@ static int wimax_postauth(void *instance, REQUEST *request)
        /*
         *      Calculate mobility keys
         */
-       mn_nai = pairfind(request->packet->vps, 1900);
-       if (!mn_nai) mn_nai = pairfind(request->reply->vps, 1900);
+       mn_nai = pairfind(request->packet->vps, 1900, 0);
+       if (!mn_nai) mn_nai = pairfind(request->reply->vps, 1900, 0);
        if (!mn_nai) {
                RDEBUG("WARNING: WiMAX-MN-NAI was not found in the request or in the reply.");
                RDEBUG("WARNING: We cannot calculate MN-HA keys.");
@@ -281,7 +281,7 @@ static int wimax_postauth(void *instance, REQUEST *request)
         *      WiMAX-IP-Technology
         */
        vp = NULL;
-       if (mn_nai) vp = pairfind(request->reply->vps, WIMAX2ATTR(23));
+       if (mn_nai) vp = pairfind(request->reply->vps, 23, VENDORPEC_WIMAX);
        if (!vp) {
                RDEBUG("WARNING: WiMAX-IP-Technology not found in reply.");
                RDEBUG("WARNING: Not calculating MN-HA keys");
@@ -486,7 +486,7 @@ static int wimax_postauth(void *instance, REQUEST *request)
        /*
         *      Generate MN-FA = H(FA-RK, "MN FA" | FA-IP | MN-NAI)
         */
-       ip = pairfind(request->reply->vps, 1901);
+       ip = pairfind(request->reply->vps, 1901, 0);
        if (fa_rk && ip && mn_nai) {
                HMAC_CTX_init(&hmac);
                HMAC_Init_ex(&hmac, fa_rk->vp_octets, fa_rk->length,
@@ -499,7 +499,7 @@ static int wimax_postauth(void *instance, REQUEST *request)
                HMAC_Final(&hmac, &mip_rk_1[0], &rk1_len);
 
                vp = radius_paircreate(request, &request->reply->vps,
-                                      1902, PW_TYPE_OCTETS);
+                                      1902, 0, PW_TYPE_OCTETS);
                if (!vp) {
                        RDEBUG("WARNING: Failed creating WiMAX-MN-FA");
                } else {