Port fix for bug #419 from branch_1_1
authoraland <aland>
Thu, 15 Feb 2007 12:52:35 +0000 (12:52 +0000)
committeraland <aland>
Thu, 15 Feb 2007 12:52:35 +0000 (12:52 +0000)
src/modules/rlm_eap/libeap/eap_sim.h
src/modules/rlm_eap/libeap/eapsimlib.c
src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c

index aa12633..84503c5 100644 (file)
@@ -58,7 +58,8 @@ enum eapsim_subtype {
   eapsim_challenge   = 11,
   eapsim_notification= 12,
   eapsim_reauth      = 13,
-  eapsim_max_subtype = 14
+  eapsim_client_error = 14,
+  eapsim_max_subtype = 15
 };
 
 enum eapsim_clientstates {
index 8e67ea0..2c1c589 100644 (file)
@@ -346,6 +346,7 @@ int unmap_eapsim_basictypes(RADIUS_PACKET *r,
        }
 
        newvp = paircreate(ATTRIBUTE_EAP_SIM_SUBTYPE, PW_TYPE_INTEGER);
+       if (!newvp) return 0;
        newvp->lvalue = attr[0];
        newvp->length = 1;
        pairadd(&(r->vps), newvp);
@@ -532,6 +533,7 @@ const char *subtypes[]={ "subtype0", "subtype1", "subtype2", "subtype3",
                         "challenge",
                         "notification",
                         "reauth",
+                        "client-error",
                         NULL };
 
 const char *sim_subtype2name(enum eapsim_subtype subtype,
index 628b6ae..168e5e2 100644 (file)
@@ -560,6 +560,13 @@ static int eap_sim_authenticate(void *arg, EAP_HANDLER *handler)
        }
        subtype = vp->lvalue;
 
+       /*
+        *      Client error supersedes anything else.
+        */
+       if (subtype == eapsim_client_error) {
+               return 0;
+       }
+
        switch(ess->state) {
        case eapsim_server_start:
                switch(subtype) {
@@ -603,7 +610,7 @@ static int eap_sim_authenticate(void *arg, EAP_HANDLER *handler)
                 * is a coding error!
                 */
                DEBUG2("  illegal-unknown state reached in eap_sim_authenticate\n");
-               abort();
+               rad_assert(0 == 1);
        }
 
        return 0;