]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Qualify EAP-Method macros
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 29 Apr 2019 21:05:40 +0000 (17:05 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 29 Apr 2019 21:06:38 +0000 (17:06 -0400)
27 files changed:
src/lib/eap/base.c
src/lib/eap/base.h
src/lib/eap/compose.c
src/lib/eap/compose.h
src/lib/eap/session.c
src/lib/eap/session.h
src/lib/eap/types.c
src/lib/eap/types.h
src/modules/rlm_eap/rlm_eap.c
src/modules/rlm_eap/rlm_eap.h
src/modules/rlm_eap/types/rlm_eap_aka/rlm_eap_aka.c
src/modules/rlm_eap/types/rlm_eap_fast/eap_fast.c
src/modules/rlm_eap/types/rlm_eap_fast/rlm_eap_fast.c
src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
src/modules/rlm_eap/types/rlm_eap_leap/eap_leap.c
src/modules/rlm_eap/types/rlm_eap_leap/rlm_eap_leap.c
src/modules/rlm_eap/types/rlm_eap_md5/eap_md5.c
src/modules/rlm_eap/types/rlm_eap_md5/rlm_eap_md5.c
src/modules/rlm_eap/types/rlm_eap_mschapv2/rlm_eap_mschapv2.c
src/modules/rlm_eap/types/rlm_eap_peap/peap.c
src/modules/rlm_eap/types/rlm_eap_peap/rlm_eap_peap.c
src/modules/rlm_eap/types/rlm_eap_pwd/eap_pwd.c
src/modules/rlm_eap/types/rlm_eap_pwd/rlm_eap_pwd.c
src/modules/rlm_eap/types/rlm_eap_sim/rlm_eap_sim.c
src/modules/rlm_eap/types/rlm_eap_tls/rlm_eap_tls.c
src/modules/rlm_eap/types/rlm_eap_ttls/rlm_eap_ttls.c
src/modules/rlm_eap/types/rlm_eap_ttls/ttls.c

index 999d351dad0ee3c6020acda2c6ebc1f6ffcdbd3d..18c9329f2a9ad8ef511616cb56e256a89c163473 100644 (file)
@@ -198,7 +198,7 @@ static bool eap_is_valid(eap_packet_raw_t **eap_packet_p)
        }
 
        if ((eap_packet->data[0] == 0) ||
-           (eap_packet->data[0] >= FR_EAP_MAX_TYPES)) {
+           (eap_packet->data[0] >= FR_EAP_METHOD_MAX)) {
                /*
                 *      Handle expanded types by smashing them to
                 *      normal types.
@@ -226,13 +226,13 @@ static bool eap_is_valid(eap_packet_raw_t **eap_packet_p)
                        }
 
                        if ((eap_packet->data[7] == 0) ||
-                           (eap_packet->data[7] >= FR_EAP_MAX_TYPES)) {
+                           (eap_packet->data[7] >= FR_EAP_METHOD_MAX)) {
                                fr_strerror_printf("Unsupported Expanded EAP type %s (%u): ignoring the packet",
                                                   eap_type2name(eap_packet->data[7]), eap_packet->data[7]);
                                return false;
                        }
 
-                       if (eap_packet->data[7] == FR_EAP_NAK) {
+                       if (eap_packet->data[7] == FR_EAP_METHOD_NAK) {
                                fr_strerror_printf("Unsupported Expanded EAP-NAK: ignoring the packet");
                                return false;
                        }
@@ -265,7 +265,7 @@ static bool eap_is_valid(eap_packet_raw_t **eap_packet_p)
        }
 
        /* we don't expect notification, but we send it */
-       if (eap_packet->data[0] == FR_EAP_NOTIFICATION) {
+       if (eap_packet->data[0] == FR_EAP_METHOD_NOTIFICATION) {
                fr_strerror_printf("Got NOTIFICATION, Ignoring the packet");
                return false;
        }
index 381baa5a36e78ca4698bbf19f993ad761ff1aec6..3b8cd64d48c320e8a02af437188773f16f58a795 100644 (file)
@@ -43,7 +43,7 @@ RCSIDH(lib_eap_base_h, "$Id$")
 #define EAP_STATE_LEN (RADIUS_AUTH_VECTOR_LENGTH)
 
 #define REQUEST_DATA_EAP_TUNNEL_CALLBACK FR_EAP_MESSAGE
-#define REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK ((FR_EAP_MESSAGE << 16) | FR_EAP_MSCHAPV2)
+#define REQUEST_DATA_EAP_MSCHAP_TUNNEL_CALLBACK ((FR_EAP_MESSAGE << 16) | FR_EAP_METHOD_MSCHAPV2)
 
 
 /*
index 45b31d4e1b1f277103459666a7dd183cd30f65df..fcf1defb8e38c598c6571f3ecb11e8d536fc14ab 100644 (file)
@@ -221,8 +221,8 @@ rlm_rcode_t eap_compose(eap_session_t *eap_session)
        if (((eap_round->request->code == FR_EAP_CODE_REQUEST) ||
             (eap_round->request->code == FR_EAP_CODE_RESPONSE)) &&
            (eap_round->request->type.num == 0)) {
-               rad_assert(eap_session->type >= FR_EAP_MD5);
-               rad_assert(eap_session->type < FR_EAP_MAX_TYPES);
+               rad_assert(eap_session->type >= FR_EAP_METHOD_MD5);
+               rad_assert(eap_session->type < FR_EAP_METHOD_MAX);
 
                eap_round->request->type.num = eap_session->type;
        }
@@ -352,7 +352,7 @@ int eap_start(REQUEST *request, rlm_eap_method_t const methods[], bool ignore_un
                p[1] = 0; /* ID */
                p[2] = 0;
                p[3] = 5; /* length */
-               p[4] = FR_EAP_IDENTITY;
+               p[4] = FR_EAP_METHOD_IDENTITY;
                fr_pair_value_memsteal(vp, p);
 
                return RLM_MODULE_HANDLED;
@@ -426,10 +426,10 @@ int eap_start(REQUEST *request, rlm_eap_method_t const methods[], bool ignore_un
         *      EAP-Identity, Notification, and NAK are all handled
         *      internally, so they never have eap_sessions.
         */
-       if ((eap_msg->vp_octets[4] >= FR_EAP_MD5) &&
+       if ((eap_msg->vp_octets[4] >= FR_EAP_METHOD_MD5) &&
            ignore_unknown_types &&
            ((eap_msg->vp_octets[4] == 0) ||
-            (eap_msg->vp_octets[4] >= FR_EAP_MAX_TYPES) ||
+            (eap_msg->vp_octets[4] >= FR_EAP_METHOD_MAX) ||
             (!methods[eap_msg->vp_octets[4]].submodule))) {
                RDEBUG2("Ignoring Unknown EAP type");
                return RLM_MODULE_NOOP;
@@ -450,18 +450,18 @@ int eap_start(REQUEST *request, rlm_eap_method_t const methods[], bool ignore_un
         *      returns NOOP, and another module may choose to proxy
         *      the request.
         */
-       if ((eap_msg->vp_octets[4] == FR_EAP_NAK) &&
+       if ((eap_msg->vp_octets[4] == FR_EAP_METHOD_NAK) &&
            (eap_msg->vp_length >= (EAP_HEADER_LEN + 2)) &&
            ignore_unknown_types &&
            ((eap_msg->vp_octets[5] == 0) ||
-            (eap_msg->vp_octets[5] >= FR_EAP_MAX_TYPES) ||
+            (eap_msg->vp_octets[5] >= FR_EAP_METHOD_MAX) ||
             (!methods[eap_msg->vp_octets[5]].submodule))) {
                RDEBUG2("Ignoring NAK with request for unknown EAP type");
                return RLM_MODULE_NOOP;
        }
 
-       if ((eap_msg->vp_octets[4] == FR_EAP_TTLS) ||
-           (eap_msg->vp_octets[4] == FR_EAP_PEAP)) {
+       if ((eap_msg->vp_octets[4] == FR_EAP_METHOD_TTLS) ||
+           (eap_msg->vp_octets[4] == FR_EAP_METHOD_PEAP)) {
                RDEBUG2("Continuing tunnel setup");
                return RLM_MODULE_OK;
        }
@@ -477,7 +477,7 @@ int eap_start(REQUEST *request, rlm_eap_method_t const methods[], bool ignore_un
         *
         * ...in the inner-tunnel, to avoid expensive and unnecessary SQL/LDAP lookups
         */
-       if (eap_msg->vp_octets[4] == FR_EAP_IDENTITY) {
+       if (eap_msg->vp_octets[4] == FR_EAP_METHOD_IDENTITY) {
                RDEBUG2("Peer sent EAP-Identity.  Returning 'ok' so we can short-circuit the rest of authorize");
                return RLM_MODULE_OK;
        }
index d3d9f0ab7aa3e491bc8fcf16097e9811941c28eb..cd51b6ad85aec00bee676fb8287771fb34020eff 100644 (file)
@@ -23,6 +23,8 @@
  * @copyright 2019  The FreeRADIUS server project
  */
 
+#include <stdbool.h>
+
 #include "types.h"
 
 /** Structure to hold EAP data
index 6e2664d99ccc7e9c1be093d029b03fb01957b646..d64187ce62d1f47926c86a866f8672c5f5274c50 100644 (file)
@@ -210,7 +210,7 @@ static char *eap_identity(REQUEST *request, eap_session_t *eap_session, eap_pack
 
        if (!eap_packet ||
            (eap_packet->code != FR_EAP_CODE_RESPONSE) ||
-           (eap_packet->data[0] != FR_EAP_IDENTITY)) return NULL;
+           (eap_packet->data[0] != FR_EAP_METHOD_IDENTITY)) return NULL;
 
        memcpy(&len, eap_packet->length, sizeof(uint16_t));
        len = ntohs(len);
@@ -321,7 +321,7 @@ eap_session_t *eap_session_continue(void *instance, eap_packet_raw_t **eap_packe
                 *      All fields in the eap_session are set to zero.
                 */
                switch (eap_packet->data[0]) {
-               case FR_EAP_IDENTITY:
+               case FR_EAP_METHOD_IDENTITY:
                        eap_session->identity = eap_identity(request, eap_session, eap_packet);
                        if (!eap_session->identity) {
                                REDEBUG("Invalid identity response");
@@ -332,23 +332,16 @@ eap_session_t *eap_session_continue(void *instance, eap_packet_raw_t **eap_packe
                         *      Sometimes we need the hex stream to determine where
                         *      random junk is coming from.
                         */
-                       if (DEBUG_ENABLED3) {
-                               RHEXDUMP(L_DBG_LVL_3, (uint8_t *const)eap_session->identity,
-                                        talloc_array_length(eap_session->identity) - 1,
-                                        "EAP Identity Response - \"%pV\"",
-                                        fr_box_strvalue_len(eap_session->identity,
-                                                            talloc_array_length(eap_session->identity) - 1));
-                       } else {
-                               RDEBUG2("EAP Identity Response - \"%pV\"",
-                                       fr_box_strvalue_len(eap_session->identity,
-                                                           talloc_array_length(eap_session->identity) - 1));
-                       }
-
+                       RHEXDUMP(L_DBG_LVL_3, (uint8_t *const)eap_session->identity,
+                                talloc_array_length(eap_session->identity) - 1,
+                                "EAP Identity Response - \"%pV\"",
+                                fr_box_strvalue_len(eap_session->identity,
+                                                    talloc_array_length(eap_session->identity) - 1));
                        break;
 
-               case FR_EAP_INVALID:
-               case FR_EAP_NOTIFICATION:
-               case FR_EAP_NAK:
+               case FR_EAP_METHOD_INVALID:
+               case FR_EAP_METHOD_NOTIFICATION:
+               case FR_EAP_METHOD_NAK:
                        REDEBUG("Initial EAP method %s(%u) invalid",
                                eap_type2name(eap_packet->data[0]), eap_packet->data[0]);
                        goto error_session;
@@ -404,7 +397,7 @@ eap_session_t *eap_session_continue(void *instance, eap_packet_raw_t **eap_packe
                 *      to a request for a particular type, but it's NOT
                 *      OK to blindly return data for another type.
                 */
-               if ((eap_packet->data[0] != FR_EAP_NAK) &&
+               if ((eap_packet->data[0] != FR_EAP_METHOD_NAK) &&
                    (eap_packet->data[0] != eap_session->type)) {
                        RERROR("Response appears to match a previous request, but the EAP type is wrong");
                        RERROR("We expected EAP type %s, but received type %s",
index 1a0d2fd8ea546820051e1b5b53323142b7e893f0..7bdad9121f3d34aceb15a6e7b064633d3eb5316c 100644 (file)
@@ -22,6 +22,9 @@
  *
  * @copyright 2019  The FreeRADIUS server project
  */
+#include <freeradius-devel/server/request.h>
+#include <freeradius-devel/server/module.h>
+
 #include "compose.h"
 #include "types.h"
 
index 8f52b8fcde78fc95941464f9a1bef44e6b7d72c0..63294374b2e4cc70904a1197823b8bc77e997401 100644 (file)
  * @param name to convert.
  * @return
  *     - IANA EAP type.
- *     - #FR_EAP_INVALID if the name doesn't match any known types.
+ *     - #FR_EAP_METHOD_INVALID if the name doesn't match any known types.
  */
 eap_type_t eap_name2type(char const *name)
 {
        fr_dict_enum_t  *dv;
 
        dv = fr_dict_enum_by_alias(attr_eap_type, name, -1);
-       if (!dv) return FR_EAP_INVALID;
+       if (!dv) return FR_EAP_METHOD_INVALID;
 
-       if (dv->value->vb_uint32 >= FR_EAP_MAX_TYPES) return FR_EAP_INVALID;
+       if (dv->value->vb_uint32 >= FR_EAP_METHOD_MAX) return FR_EAP_METHOD_INVALID;
 
        return dv->value->vb_uint32;
 }
index 8ef49b3db4f6871ac0d621a8b000c03911fa0c25..c795ca3a6884d2cea6624223ef4c023922faf83b 100644 (file)
@@ -27,8 +27,8 @@
 
 RCSIDH(lib_eap_types, "$Id$")
 
-#include <freeradius-devel/server/base.h>
-#include <freeradius-devel/server/module.h>
+#include <stdint.h>
+#include <stddef.h>
 
 /* Code (1) + Identifier (1) + Length (2) */
 #define EAP_HEADER_LEN                 4
@@ -42,64 +42,64 @@ typedef enum eap_code {
 } eap_code_t;
 
 typedef enum eap_method {
-       FR_EAP_INVALID = 0,             /* 0 */
-       FR_EAP_IDENTITY,                /* 1 */
-       FR_EAP_NOTIFICATION,            /* 2 */
-       FR_EAP_NAK,                     /* 3 */
-       FR_EAP_MD5,                     /* 4 */
-       FR_EAP_OTP,                     /* 5 */
-       FR_EAP_GTC,                     /* 6 */
-       FR_EAP_7,                       /* 7  - unused */
-       FR_EAP_8,                       /* 8  - unused */
-       FR_EAP_RSA_PUBLIC_KEY,          /* 9 */
-       FR_EAP_DSS_UNILATERAL,          /* 10 */
-       FR_EAP_KEA,                     /* 11 */
-       FR_EAP_KEA_VALIDATE,            /* 12 */
-       FR_EAP_TLS,                     /* 13 */
-       FR_EAP_DEFENDER_TOKEN,          /* 14 */
-       FR_EAP_RSA_SECURID,             /* 15 */
-       FR_EAP_ARCOT_SYSTEMS,           /* 16 */
-       FR_EAP_LEAP,                    /* 17 */
-       FR_EAP_SIM,                     /* 18 */
-       FR_EAP_SRP_SHA1,                /* 19 */
-       FR_EAP_20,                      /* 20 - unassigned */
-       FR_EAP_TTLS,                    /* 21 */
-       FR_EAP_REMOTE_ACCESS_SERVICE,   /* 22 */
-       FR_EAP_AKA,                     /* 23 */
-       FR_EAP_3COM,                    /* 24 - should this be EAP-HP now? */
-       FR_EAP_PEAP,                    /* 25 */
-       FR_EAP_MSCHAPV2,                /* 26 */
-       FR_EAP_MAKE,                    /* 27 */
-       FR_EAP_CRYPTOCARD,              /* 28 */
-       FR_EAP_CISCO_MSCHAPV2,          /* 29 */
-       FR_EAP_DYNAMID,                 /* 30 */
-       FR_EAP_ROB,                     /* 31 */
-       FR_EAP_POTP,                    /* 32 */
-       FR_EAP_MS_ATLV,                 /* 33 */
-       FR_EAP_SENTRINET,               /* 34 */
-       FR_EAP_ACTIONTEC,               /* 35 */
-       FR_EAP_COGENT_BIOMETRIC,        /* 36 */
-       FR_EAP_AIRFORTRESS,             /* 37 */
-       FR_EAP_TNC,                     /* 38 - fixme conflicts with HTTP DIGEST */
-//     FR_EAP_HTTP_DIGEST,             /* 38 */
-       FR_EAP_SECURISUITE,             /* 39 */
-       FR_EAP_DEVICECONNECT,           /* 40 */
-       FR_EAP_SPEKE,                   /* 41 */
-       FR_EAP_MOBAC,                   /* 42 */
-       FR_EAP_FAST,                    /* 43 */
-       FR_EAP_ZONELABS,                /* 44 */
-       FR_EAP_LINK,                    /* 45 */
-       FR_EAP_PAX,                     /* 46 */
-       FR_EAP_PSK,                     /* 47 */
-       FR_EAP_SAKE,                    /* 48 */
-       FR_EAP_IKEV2,                   /* 49 */
-       FR_EAP_AKA_PRIME,               /* 50 */
-       FR_EAP_GPSK,                    /* 51 */
-       FR_EAP_PWD,                     /* 52 */
-       FR_EAP_EKE,                     /* 53 */
-       FR_EAP_PT,                      /* 54 */
-       FR_EAP_TEAP,                    /* 55 */
-       FR_EAP_MAX_TYPES                /* 56 - for validation */
+       FR_EAP_METHOD_INVALID = 0,              /* 0 */
+       FR_EAP_METHOD_IDENTITY,                 /* 1 */
+       FR_EAP_METHOD_NOTIFICATION,             /* 2 */
+       FR_EAP_METHOD_NAK,                      /* 3 */
+       FR_EAP_METHOD_MD5,                      /* 4 */
+       FR_EAP_METHOD_OTP,                      /* 5 */
+       FR_EAP_METHOD_GTC,                      /* 6 */
+       FR_EAP_METHOD_7,                        /* 7  - unused */
+       FR_EAP_METHOD_8,                        /* 8  - unused */
+       FR_EAP_METHOD_RSA_PUBLIC_KEY,           /* 9 */
+       FR_EAP_METHOD_DSS_UNILATERAL,           /* 10 */
+       FR_EAP_METHOD_KEA,                      /* 11 */
+       FR_EAP_METHOD_KEA_VALIDATE,             /* 12 */
+       FR_EAP_METHOD_TLS,                      /* 13 */
+       FR_EAP_METHOD_DEFENDER_TOKEN,           /* 14 */
+       FR_EAP_METHOD_RSA_SECURID,              /* 15 */
+       FR_EAP_METHOD_ARCOT_SYSTEMS,            /* 16 */
+       FR_EAP_METHOD_LEAP,                     /* 17 */
+       FR_EAP_METHOD_SIM,                      /* 18 */
+       FR_EAP_METHOD_SRP_SHA1,                 /* 19 */
+       FR_EAP_METHOD_20,                       /* 20 - unassigned */
+       FR_EAP_METHOD_TTLS,                     /* 21 */
+       FR_EAP_METHOD_REMOTE_ACCESS_SERVICE,    /* 22 */
+       FR_EAP_METHOD_AKA,                      /* 23 */
+       FR_EAP_METHOD_3COM,                     /* 24 - should this be EAP-HP now? */
+       FR_EAP_METHOD_PEAP,                     /* 25 */
+       FR_EAP_METHOD_MSCHAPV2,                 /* 26 */
+       FR_EAP_METHOD_MAKE,                     /* 27 */
+       FR_EAP_METHOD_CRYPTOCARD,               /* 28 */
+       FR_EAP_METHOD_CISCO_MSCHAPV2,           /* 29 */
+       FR_EAP_METHOD_DYNAMID,                  /* 30 */
+       FR_EAP_METHOD_ROB,                      /* 31 */
+       FR_EAP_METHOD_POTP,                     /* 32 */
+       FR_EAP_METHOD_MS_ATLV,                  /* 33 */
+       FR_EAP_METHOD_SENTRINET,                /* 34 */
+       FR_EAP_METHOD_ACTIONTEC,                /* 35 */
+       FR_EAP_METHOD_COGENT_BIOMETRIC,         /* 36 */
+       FR_EAP_METHOD_AIRFORTRESS,              /* 37 */
+       FR_EAP_METHOD_TNC,                      /* 38 - fixme conflicts with HTTP DIGEST */
+//     FR_EAP_METHOD_HTTP_DIGEST,              /* 38 */
+       FR_EAP_METHOD_SECURISUITE,              /* 39 */
+       FR_EAP_METHOD_DEVICECONNECT,            /* 40 */
+       FR_EAP_METHOD_SPEKE,                    /* 41 */
+       FR_EAP_METHOD_MOBAC,                    /* 42 */
+       FR_EAP_METHOD_FAST,                     /* 43 */
+       FR_EAP_METHOD_ZONELABS,                 /* 44 */
+       FR_EAP_METHOD_LINK,                     /* 45 */
+       FR_EAP_METHOD_PAX,                      /* 46 */
+       FR_EAP_METHOD_PSK,                      /* 47 */
+       FR_EAP_METHOD_SAKE,                     /* 48 */
+       FR_EAP_METHOD_IKEV2,                    /* 49 */
+       FR_EAP_METHOD_AKA_PRIME,                /* 50 */
+       FR_EAP_METHOD_GPSK,                     /* 51 */
+       FR_EAP_METHOD_PWD,                      /* 52 */
+       FR_EAP_METHOD_EKE,                      /* 53 */
+       FR_EAP_METHOD_PT,                       /* 54 */
+       FR_EAP_METHOD_TEAP,                     /* 55 */
+       FR_EAP_METHOD_MAX                       /* 56 - for validation */
 } eap_type_t;
 
 #define FR_EAP_EXPANDED_TYPE   (254)
index 3135f2cb4b9cbf4575bc810a5fdaee3af9faa23c..dc6e7af5bc23f42684f9b1d70a59e70a10b7fba2 100644 (file)
@@ -125,7 +125,7 @@ static int submodule_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *paren
        eap_type_t      method;
 
        method = eap_name2type(name);
-       if (method == FR_EAP_INVALID) {
+       if (method == FR_EAP_METHOD_INVALID) {
                cf_log_err(ci, "Unknown EAP type %s", name);
                return -1;
        }
@@ -144,12 +144,12 @@ static int submodule_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *paren
         *      have EAP without the TLS types.
         */
        switch (method) {
-       case FR_EAP_TLS:
-       case FR_EAP_TTLS:
-       case FR_EAP_PEAP:
-       case FR_EAP_PWD:
-       case FR_EAP_AKA:
-       case FR_EAP_SIM:
+       case FR_EAP_METHOD_TLS:
+       case FR_EAP_METHOD_TTLS:
+       case FR_EAP_METHOD_PEAP:
+       case FR_EAP_METHOD_PWD:
+       case FR_EAP_METHOD_AKA:
+       case FR_EAP_METHOD_SIM:
        {
                rlm_eap_t *inst = ((dl_instance_t *)cf_data_value(cf_data_find(eap_cs,
                                                                               dl_instance_t, "rlm_eap")))->data;
@@ -201,7 +201,7 @@ static int eap_type_parse(UNUSED TALLOC_CTX *ctx, void *out, UNUSED void *parent
         *      Ensure that the default EAP type is loaded.
         */
        method = eap_name2type(default_method_name);
-       if (method == FR_EAP_INVALID) {
+       if (method == FR_EAP_METHOD_INVALID) {
                cf_log_err(ci, "Unknown EAP type %s", default_method_name);
                return -1;
        }
@@ -220,7 +220,7 @@ static eap_type_t eap_process_nak(rlm_eap_t *inst, REQUEST *request,
 {
        unsigned int i;
        VALUE_PAIR *vp;
-       eap_type_t method = FR_EAP_INVALID;
+       eap_type_t method = FR_EAP_METHOD_INVALID;
 
        /*
         *      The NAK data is the preferred EAP type(s) of
@@ -233,7 +233,7 @@ static eap_type_t eap_process_nak(rlm_eap_t *inst, REQUEST *request,
        if (!nak->data) {
                REDEBUG("Peer sent empty (invalid) NAK. Can't select method to continue with");
 
-               return FR_EAP_INVALID;
+               return FR_EAP_METHOD_INVALID;
        }
 
        /*
@@ -249,20 +249,20 @@ static eap_type_t eap_process_nak(rlm_eap_t *inst, REQUEST *request,
                if (nak->data[i] == 0) {
                        REDEBUG("Peer NAK'd indicating it is not willing to continue ");
 
-                       return FR_EAP_INVALID;
+                       return FR_EAP_METHOD_INVALID;
                }
 
                /*
                 *      It is invalid to request identity,
                 *      notification & nak in nak.
                 */
-               if (nak->data[i] < FR_EAP_MD5) {
+               if (nak->data[i] < FR_EAP_METHOD_MD5) {
                        REDEBUG("Peer NAK'd asking for bad type %s (%d)", eap_type2name(nak->data[i]), nak->data[i]);
 
-                       return FR_EAP_INVALID;
+                       return FR_EAP_METHOD_INVALID;
                }
 
-               if ((nak->data[i] >= FR_EAP_MAX_TYPES) ||
+               if ((nak->data[i] >= FR_EAP_METHOD_MAX) ||
                    !inst->methods[nak->data[i]].submodule) {
                        RDEBUG2("Peer NAK'd asking for unsupported EAP type %s (%d), skipping...",
                                eap_type2name(nak->data[i]),
@@ -309,7 +309,7 @@ static eap_type_t eap_process_nak(rlm_eap_t *inst, REQUEST *request,
                break;
        }
 
-       if (method == FR_EAP_INVALID) REDEBUG("No mutually acceptable types found");
+       if (method == FR_EAP_METHOD_INVALID) REDEBUG("No mutually acceptable types found");
 
        return method;
 }
@@ -375,7 +375,7 @@ static rlm_rcode_t mod_authenticate_result(REQUEST *request, UNUSED void *instan
         *      it's LEAP, and a response.
         */
        if (((eap_session->this_round->request->code == FR_EAP_CODE_REQUEST) &&
-           (eap_session->this_round->request->type.num >= FR_EAP_MD5)) ||
+           (eap_session->this_round->request->type.num >= FR_EAP_METHOD_MD5)) ||
 
                /*
                 *      LEAP is a little different.  At Stage 4,
@@ -387,7 +387,7 @@ static rlm_rcode_t mod_authenticate_result(REQUEST *request, UNUSED void *instan
                 *      isn't put into the list.
                 */
            ((eap_session->this_round->response->code == FR_EAP_CODE_RESPONSE) &&
-            (eap_session->this_round->response->type.num == FR_EAP_LEAP) &&
+            (eap_session->this_round->response->type.num == FR_EAP_METHOD_LEAP) &&
             (eap_session->this_round->request->code == FR_EAP_CODE_SUCCESS) &&
             (eap_session->this_round->request->type.num == 0))) {
                talloc_free(eap_session->prev_round);
@@ -483,7 +483,7 @@ static rlm_rcode_t eap_method_select(rlm_eap_t *inst, UNUSED void *thread, eap_s
        /*
         *      Don't trust anyone.
         */
-       if ((type->num == 0) || (type->num >= FR_EAP_MAX_TYPES)) {
+       if ((type->num == 0) || (type->num >= FR_EAP_METHOD_MAX)) {
                REDEBUG("Peer sent EAP type number %d, which is outside known range", type->num);
 
                return RLM_MODULE_INVALID;
@@ -512,7 +512,7 @@ static rlm_rcode_t eap_method_select(rlm_eap_t *inst, UNUSED void *thread, eap_s
         *      Figure out what to do.
         */
        switch (type->num) {
-       case FR_EAP_IDENTITY:
+       case FR_EAP_METHOD_IDENTITY:
                /*
                 *      Allow per-user configuration of EAP types.
                 */
@@ -525,7 +525,7 @@ static rlm_rcode_t eap_method_select(rlm_eap_t *inst, UNUSED void *thread, eap_s
                /*
                 *      Ensure it's valid.
                 */
-               if ((next < FR_EAP_MD5) || (next >= FR_EAP_MAX_TYPES) || (!inst->methods[next].submodule)) {
+               if ((next < FR_EAP_METHOD_MD5) || (next >= FR_EAP_METHOD_MAX) || (!inst->methods[next].submodule)) {
                        REDEBUG2("Tried to start unsupported EAP type %s (%d)",
                                 eap_type2name(next), next);
                        return RLM_MODULE_INVALID;
@@ -535,15 +535,15 @@ static rlm_rcode_t eap_method_select(rlm_eap_t *inst, UNUSED void *thread, eap_s
                /*
                 *      If any of these fail, we messed badly somewhere
                 */
-               rad_assert(next >= FR_EAP_MD5);
-               rad_assert(next < FR_EAP_MAX_TYPES);
+               rad_assert(next >= FR_EAP_METHOD_MD5);
+               rad_assert(next < FR_EAP_METHOD_MAX);
                rad_assert(inst->methods[next].submodule);
 
                eap_session->process = inst->methods[next].submodule->session_init;
                eap_session->type = next;
                goto module_call;
 
-       case FR_EAP_NAK:
+       case FR_EAP_METHOD_NAK:
                /*
                 *      Delete old data, if necessary.  If we called a method
                 *      before, and it initialized itself, we need to free
@@ -750,7 +750,7 @@ static rlm_rcode_t mod_post_proxy(void *instance, UNUSED void *thread, REQUEST *
                 *      it's LEAP, and a response.
                 */
                if ((eap_session->this_round->request->code == FR_EAP_CODE_REQUEST) &&
-                   (eap_session->this_round->request->type.num >= FR_EAP_MD5)) {
+                   (eap_session->this_round->request->type.num >= FR_EAP_METHOD_MD5)) {
                        talloc_free(eap_session->prev_round);
                        eap_session->prev_round = eap_session->this_round;
                        eap_session->this_round = NULL;
index d706f8766af60bae8f0663bebb644ad2f9c484db..55fe1cfa5bcd54e1a17ca471229912323eb23886 100644 (file)
@@ -37,7 +37,7 @@ RCSIDH(rlm_eap_h, "$Id$")
 typedef struct {
        CONF_SECTION                    **submodule_cs;                 //!< Configuration sections for the submodules
                                                                        ///< we're going to load.
-       rlm_eap_method_t                methods[FR_EAP_MAX_TYPES];      //!< Array of loaded (or not), submodules.
+       rlm_eap_method_t                methods[FR_EAP_METHOD_MAX];     //!< Array of loaded (or not), submodules.
 
        char const                      *default_method_name;           //!< Default method to attempt to start.
        eap_type_t                      default_method;                 //!< Resolved default_method_name.
index 89622fa16117a8a31f6a231f5ac6e1d075657fca..2c4394f09bf537c6e5c6caab6bcef8097fc0388d 100644 (file)
@@ -337,7 +337,7 @@ static int eap_aka_send_challenge(eap_session_t *eap_session)
        /*
         *      Toggle the AMF high bit to indicate we're doing AKA'
         */
-       if (eap_aka_session->type == FR_EAP_AKA_PRIME) {
+       if (eap_aka_session->type == FR_EAP_METHOD_AKA_PRIME) {
                uint8_t amf_buff[2] = { 0x80, 0x00 };   /* Set the AMF separation bit high */
 
                MEM(pair_update_control(&vp, attr_sim_amf) >= 0);
@@ -356,7 +356,7 @@ static int eap_aka_send_challenge(eap_session_t *eap_session)
        /*
         *      Don't leave the AMF hanging around
         */
-       if (eap_aka_session->type == FR_EAP_AKA_PRIME) pair_delete_control(attr_sim_amf);
+       if (eap_aka_session->type == FR_EAP_METHOD_AKA_PRIME) pair_delete_control(attr_sim_amf);
 
        /*
         *      All set, calculate keys!
@@ -404,7 +404,7 @@ static int eap_aka_send_challenge(eap_session_t *eap_session)
        /*
         *      Send the network name and KDF to the peer
         */
-       if (eap_aka_session->type == FR_EAP_AKA_PRIME) {
+       if (eap_aka_session->type == FR_EAP_METHOD_AKA_PRIME) {
                if (!eap_aka_session->keys.network_len) {
                        REDEBUG2("No network name available, can't set EAP-AKA-KDF-Input");
                failure:
@@ -1155,10 +1155,10 @@ static rlm_rcode_t mod_session_init(void *instance, UNUSED void *thread, REQUEST
         *      binds authentication to the network.
         */
        switch (eap_session->type) {
-       case FR_EAP_AKA_PRIME:
+       case FR_EAP_METHOD_AKA_PRIME:
        default:
                RDEBUG2("New EAP-AKA' session");
-               eap_aka_session->type = FR_EAP_AKA_PRIME;
+               eap_aka_session->type = FR_EAP_METHOD_AKA_PRIME;
                eap_aka_session->kdf = FR_EAP_AKA_KDF_VALUE_EAP_AKA_PRIME_WITH_CK_PRIME_IK_PRIME;
                eap_aka_session->checkcode_md = eap_aka_session->mac_md = EVP_sha256();
                eap_aka_session->keys.network = (uint8_t *)talloc_bstrndup(eap_aka_session, inst->network_name,
@@ -1176,9 +1176,9 @@ static rlm_rcode_t mod_session_init(void *instance, UNUSED void *thread, REQUEST
                }
                break;
 
-       case FR_EAP_AKA:
+       case FR_EAP_METHOD_AKA:
                RDEBUG2("New EAP-AKA session");
-               eap_aka_session->type = FR_EAP_AKA;
+               eap_aka_session->type = FR_EAP_METHOD_AKA;
                eap_aka_session->kdf = FR_EAP_AKA_KDF_VALUE_EAP_AKA;    /* Not actually sent */
                eap_aka_session->checkcode_md = eap_aka_session->mac_md = EVP_sha1();
                eap_aka_session->send_at_bidding = true;
@@ -1387,7 +1387,7 @@ rlm_eap_submodule_t rlm_eap_aka = {
        .name           = "eap_aka",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_AKA, FR_EAP_AKA_PRIME },
+       .provides       = { FR_EAP_METHOD_AKA, FR_EAP_METHOD_AKA_PRIME },
        .inst_size      = sizeof(rlm_eap_aka_t),
        .inst_type      = "rlm_eap_aka_t",
        .config         = submodule_config,
index 2f98b02418400d09bd43792c92813099ca3da62c..8cf1ed8889cbf425b043f556c7ff3fc8314cd709 100644 (file)
@@ -145,7 +145,7 @@ static void eap_fast_send_identity_request(REQUEST *request, tls_session_t *tls_
        eap_packet.id = eap_session->this_round->response->id + 1;
        eap_packet.length[0] = 0;
        eap_packet.length[1] = EAP_HEADER_LEN + 1;
-       eap_packet.data[0] = FR_EAP_IDENTITY;
+       eap_packet.data[0] = FR_EAP_METHOD_IDENTITY;
 
        eap_fast_tlv_append(tls_session, attr_eap_fast_eap_payload, true, sizeof(eap_packet), &eap_packet);
 }
@@ -622,7 +622,7 @@ static FR_CODE eap_fast_eap_payload(REQUEST *request, eap_session_t *eap_session
                        if (vp &&
                            (vp->vp_length >= EAP_HEADER_LEN + 2) &&
                            (vp->vp_strvalue[0] == FR_EAP_CODE_RESPONSE) &&
-                           (vp->vp_strvalue[EAP_HEADER_LEN] == FR_EAP_IDENTITY) &&
+                           (vp->vp_strvalue[EAP_HEADER_LEN] == FR_EAP_METHOD_IDENTITY) &&
                            (vp->vp_strvalue[EAP_HEADER_LEN + 1] != 0)) {
                                /*
                                 * Create & remember a User-Name
index 75fad5ace02d12fc5ff199d53c7f0f36c51ce455..2663bee1820c117c41b1a7ba388cae8accecafb8 100644 (file)
@@ -652,7 +652,7 @@ rlm_eap_submodule_t rlm_eap_fast = {
        .name           = "eap_fast",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_FAST },
+       .provides       = { FR_EAP_METHOD_FAST },
        .inst_size      = sizeof(rlm_eap_fast_t),
        .config         = submodule_config,
        .instantiate    = mod_instantiate,      /* Create new submodule instance */
index 5762813c4c85639f1c0e307baae3ce461688b593..07f2f312541e240fc48606a3f1027f00e5861d53 100644 (file)
@@ -244,7 +244,7 @@ rlm_eap_submodule_t rlm_eap_gtc = {
        .name           = "eap_gtc",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_GTC },
+       .provides       = { FR_EAP_METHOD_GTC },
        .inst_size      = sizeof(rlm_eap_gtc_t),
        .config         = submodule_config,
 
index 09367b6937fb84e19119b73912461ac2fd55ba97..2f67d19255326d7f6c8553945b1606ab3461285f 100644 (file)
@@ -68,7 +68,7 @@ leap_packet_t *eap_leap_extract(REQUEST *request, eap_round_t *eap_round)
         */
        if (!eap_round || !eap_round->response ||
            ((eap_round->response->code != FR_EAP_CODE_RESPONSE) && (eap_round->response->code != FR_EAP_CODE_REQUEST)) ||
-            (eap_round->response->type.num != FR_EAP_LEAP) || !eap_round->response->type.data ||
+            (eap_round->response->type.num != FR_EAP_METHOD_LEAP) || !eap_round->response->type.data ||
             (eap_round->response->length < LEAP_HEADER_LEN) ||
             (eap_round->response->type.data[0] != 0x01)) {     /* version 1 */
                REDEBUG("Corrupted data");
@@ -401,7 +401,7 @@ int eap_leap_compose(REQUEST *request, eap_round_t *eap_round, leap_packet_t *re
        switch (reply->code) {
        case FR_EAP_CODE_REQUEST:
        case FR_EAP_CODE_RESPONSE:
-               eap_round->request->type.num = FR_EAP_LEAP;
+               eap_round->request->type.num = FR_EAP_METHOD_LEAP;
                eap_round->request->type.length = reply->length;
 
                eap_round->request->type.data = talloc_array(eap_round->request, uint8_t, reply->length);
index f57408cd6b8bc05879b39e490871fe036cd0aa45..94635bbdd0280a1775b556403de06d6ac2699bbb 100644 (file)
@@ -208,7 +208,7 @@ rlm_eap_submodule_t rlm_eap_leap = {
        .name           = "eap_leap",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_LEAP },
+       .provides       = { FR_EAP_METHOD_LEAP },
        .session_init   = mod_session_init,     /* Initialise a new EAP session */
        .entry_point    = mod_process           /* Process next round of EAP method */
 };
index 21ab2feb4c2d617c91e916ee22bf961d69889deb..4c76fadd90240e9ee8feadf9fbf011b19548c30d 100644 (file)
@@ -62,7 +62,7 @@ MD5_PACKET *eap_md5_extract(eap_round_t *eap_round)
        if (!eap_round                                   ||
            !eap_round->response                                 ||
            (eap_round->response->code != FR_MD5_RESPONSE)       ||
-           eap_round->response->type.num != FR_EAP_MD5  ||
+           eap_round->response->type.num != FR_EAP_METHOD_MD5   ||
            !eap_round->response->type.data              ||
            (eap_round->response->length <= MD5_HEADER_LEN) ||
            (eap_round->response->type.data[0] == 0)) {
@@ -188,7 +188,7 @@ int eap_md5_compose(eap_round_t *eap_round, MD5_PACKET *reply)
         *      and EAP-Success, and EAP-Failure.
         */
        if (reply->code < 3) {
-               eap_round->request->type.num = FR_EAP_MD5;
+               eap_round->request->type.num = FR_EAP_METHOD_MD5;
 
                rad_assert(reply->length > 0);
 
index 8b4990645a27e248a77a72ac6108f15ddde55b5c..6c4c91ef070b07ff399d4efa63e0a30be254d044 100644 (file)
@@ -165,7 +165,7 @@ extern rlm_eap_submodule_t rlm_eap_md5;
 rlm_eap_submodule_t rlm_eap_md5 = {
        .name           = "eap_md5",
 
-       .provides       = { FR_EAP_MD5 },
+       .provides       = { FR_EAP_METHOD_MD5 },
        .magic          = RLM_MODULE_INIT,
        .session_init   = mod_session_init,     /* Initialise a new EAP session */
        .entry_point    = mod_process           /* Process next round of EAP method */
index 78ffebe3ba6effd589d47564fe91591548f25e27..8ef9771d5a16ad87680ebbd492a3c48b9f91ae91 100644 (file)
@@ -144,7 +144,7 @@ static int eapmschapv2_compose(rlm_eap_mschapv2_t const *inst, eap_session_t *ea
        REQUEST                 *request = eap_session->request;
 
        eap_round->request->code = FR_EAP_CODE_REQUEST;
-       eap_round->request->type.num = FR_EAP_MSCHAPV2;
+       eap_round->request->type.num = FR_EAP_METHOD_MSCHAPV2;
 
        /*
         *      Always called with vendor Microsoft
@@ -871,7 +871,7 @@ rlm_eap_submodule_t rlm_eap_mschapv2 = {
        .name           = "eap_mschapv2",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_MSCHAPV2 },
+       .provides       = { FR_EAP_METHOD_MSCHAPV2 },
        .inst_size      = sizeof(rlm_eap_mschapv2_t),
        .config         = submodule_config,
        .instantiate    = mod_instantiate,      /* Create new submodule instance */
index 29a23e05edf1e82b3ba0671e181e389880f88df9..b42c74f6b7f725dd7096d095b0286338d3df0750 100644 (file)
@@ -107,7 +107,7 @@ static int eap_peap_identity(eap_session_t *eap_session, tls_session_t *tls_sess
        eap_packet.id = eap_session->this_round->response->id + 1;
        eap_packet.length[0] = 0;
        eap_packet.length[1] = EAP_HEADER_LEN + 1;
-       eap_packet.data[0] = FR_EAP_IDENTITY;
+       eap_packet.data[0] = FR_EAP_METHOD_IDENTITY;
 
        (tls_session->record_from_buff)(&tls_session->clean_in, &eap_packet, sizeof(eap_packet));
        tls_session_send(eap_session->request, tls_session);
@@ -168,7 +168,7 @@ static void eap_peap_soh_verify(REQUEST *request, RADIUS_PACKET *packet,
        vp->vp_bool = false;
        fr_pair_add(&packet->vps, vp);
 
-       if (data && data[0] == FR_EAP_NAK) {
+       if (data && data[0] == FR_EAP_METHOD_NAK) {
                REDEBUG("SoH - client NAKed");
                return;
        }
@@ -217,7 +217,7 @@ static int eap_peap_verify(REQUEST *request, peap_tunnel_t *peap_tunnel,
        /*
         *      No data, OR only 1 byte of EAP type.
         */
-       if (!data || (data_len == 0) || ((data_len <= 1) && (data[0] != FR_EAP_IDENTITY))) return 0;
+       if (!data || (data_len == 0) || ((data_len <= 1) && (data[0] != FR_EAP_METHOD_IDENTITY))) return 0;
 
        /*
         *  Since the full EAP header is sent for the EAP Extensions type (Type 33),
@@ -243,7 +243,7 @@ static int eap_peap_verify(REQUEST *request, peap_tunnel_t *peap_tunnel,
 
        eap_method = data[0];   /* Inner EAP header misses off code and identifier */
        switch (eap_method) {
-       case FR_EAP_IDENTITY:
+       case FR_EAP_METHOD_IDENTITY:
                RDEBUG2("Received EAP-Identity-Response");
                return 0;
 
@@ -251,7 +251,7 @@ static int eap_peap_verify(REQUEST *request, peap_tunnel_t *peap_tunnel,
         *      We normally do Microsoft MS-CHAPv2 (26), versus
         *      Cisco MS-CHAPv2 (29).
         */
-       case FR_EAP_MSCHAPV2:
+       case FR_EAP_METHOD_MSCHAPV2:
        default:
                RDEBUG2("EAP method %s (%d)", eap_type2name(eap_method), eap_method);
                return 0;
@@ -537,7 +537,7 @@ rlm_rcode_t eap_peap_process(eap_session_t *eap_session, tls_session_t *tls_sess
 
        case PEAP_STATUS_INNER_IDENTITY_REQ_SENT:
                /* we're expecting an identity response */
-               if (data[0] != FR_EAP_IDENTITY) {
+               if (data[0] != FR_EAP_METHOD_IDENTITY) {
                        REDEBUG("Expected EAP-Identity, got something else");
                        rcode = RLM_MODULE_REJECT;
                        goto finish;
@@ -690,7 +690,7 @@ rlm_rcode_t eap_peap_process(eap_session_t *eap_session, tls_session_t *tls_sess
                q[1] = eap_round->response->id;
                q[2] = (len >> 8) & 0xff;
                q[3] = len & 0xff;
-               q[4] = FR_EAP_IDENTITY;
+               q[4] = FR_EAP_METHOD_IDENTITY;
                memcpy(q + EAP_HEADER_LEN + 1,
                       t->username->vp_strvalue, t->username->vp_length);
 
@@ -728,7 +728,7 @@ rlm_rcode_t eap_peap_process(eap_session_t *eap_session, tls_session_t *tls_sess
                 *      so we add one here, by pulling it out of the
                 *      EAP-Identity packet.
                 */
-               if ((data[0] == FR_EAP_IDENTITY) && (data_len > 1)) {
+               if ((data[0] == FR_EAP_METHOD_IDENTITY) && (data_len > 1)) {
                        t->username = fr_pair_afrom_da(t, attr_user_name);
                        rad_assert(t->username != NULL);
                        t->username->vp_tainted = true;
index 0ebff9b5310b81d367bf07fa3ec2976f368c1a48..3c5f6fa5203060f94d91cf5d6969e3c8eb7a96ba 100644 (file)
@@ -363,7 +363,7 @@ rlm_eap_submodule_t rlm_eap_peap = {
        .name           = "eap_peap",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_PEAP },
+       .provides       = { FR_EAP_METHOD_PEAP },
        .inst_size      = sizeof(rlm_eap_peap_t),
        .config         = submodule_config,
        .onload         = mod_load,
index 62f05640bd65705d8fab95659f1f960cb6bbf2f6..0b38598ca53ff2200246cc44d30f4622468f1389 100644 (file)
@@ -640,7 +640,7 @@ int compute_keys(UNUSED REQUEST *request, pwd_session_t *session, uint8_t *peer_
         * first compute the session-id = TypeCode | H(ciphersuite | scal_p |
         *      scal_s)
         */
-       session_id[0] = FR_EAP_PWD;
+       session_id[0] = FR_EAP_METHOD_PWD;
        HMAC_Init_ex(hmac_ctx, allzero, SHA256_DIGEST_LENGTH, EVP_sha256(), NULL);
        HMAC_Update(hmac_ctx, (uint8_t *)&session->ciphersuite, sizeof(session->ciphersuite));
        offset = BN_num_bytes(session->order) - BN_num_bytes(session->peer_scalar);
index 6fb7720b4bc6f3b7861c0eb9b9d929266d6266d7..45b1f2aae2494c0303532834a3f2dce36d41ee49 100644 (file)
@@ -93,7 +93,7 @@ static int send_pwd_request(REQUEST *request, pwd_session_t *session, eap_round_
        len = (session->out_len - session->out_pos) + sizeof(pwd_hdr);
        rad_assert(len > 0);
        eap_round->request->code = FR_EAP_CODE_REQUEST;
-       eap_round->request->type.num = FR_EAP_PWD;
+       eap_round->request->type.num = FR_EAP_METHOD_PWD;
        eap_round->request->type.length = (len > session->mtu) ? session->mtu : len;
        eap_round->request->type.data = talloc_zero_array(eap_round->request, uint8_t, eap_round->request->type.length);
        hdr = (pwd_hdr *)eap_round->request->type.data;
@@ -249,7 +249,7 @@ static rlm_rcode_t mod_process(void *instance, UNUSED void *thread, REQUEST *req
                 */
                exch = EAP_PWD_GET_EXCHANGE(hdr);
                eap_round->request->code = FR_EAP_CODE_REQUEST;
-               eap_round->request->type.num = FR_EAP_PWD;
+               eap_round->request->type.num = FR_EAP_METHOD_PWD;
                eap_round->request->type.length = sizeof(pwd_hdr);
 
                MEM(eap_round->request->type.data = talloc_array(eap_round->request, uint8_t, sizeof(pwd_hdr)));
@@ -583,7 +583,7 @@ rlm_eap_submodule_t rlm_eap_pwd = {
        .name           = "eap_pwd",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_PWD },
+       .provides       = { FR_EAP_METHOD_PWD },
        .inst_size      = sizeof(rlm_eap_pwd_t),
        .config         = submodule_config,
        .instantiate    = mod_instantiate,      /* Create new submodule instance */
index 37f7271372f38ab5eaaa4985b2dd435021294c40..e78a391117d93b2a89582b2289913fa89d8982b4 100644 (file)
@@ -176,7 +176,7 @@ static int eap_sim_compose(eap_session_t *eap_session, uint8_t const *hmac_extra
        RDEBUG2("Encoding EAP-SIM attributes");
        log_request_pair_list(L_DBG_LVL_2, request, head, NULL);
 
-       eap_session->this_round->request->type.num = FR_EAP_SIM;
+       eap_session->this_round->request->type.num = FR_EAP_METHOD_SIM;
        eap_session->this_round->request->id = eap_sim_session->sim_id++ & 0xff;
        eap_session->this_round->set_request_id = true;
 
@@ -1172,7 +1172,7 @@ rlm_eap_submodule_t rlm_eap_sim = {
        .name           = "eap_sim",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_SIM },
+       .provides       = { FR_EAP_METHOD_SIM },
        .inst_size      = sizeof(rlm_eap_sim_t),
        .config         = submodule_config,
 
index a45bb10966b4d7aac15e331d67acbc8f9ab8696a..0dcf5719d9ce7748ed163d9c5d688942b21f93ea 100644 (file)
@@ -375,7 +375,7 @@ rlm_eap_submodule_t rlm_eap_tls = {
        .name           = "eap_tls",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_TLS },
+       .provides       = { FR_EAP_METHOD_TLS },
        .inst_size      = sizeof(rlm_eap_tls_t),
        .config         = submodule_config,
        .instantiate    = mod_instantiate,      /* Create new submodule instance */
index 57d4e5c5e0be2cf3fa59bd95d78c8d7751193f2c..2a859c5bf1820cfa6cd8ec6b1d79e8d17a2387c1 100644 (file)
@@ -338,7 +338,7 @@ rlm_eap_submodule_t rlm_eap_ttls = {
        .name           = "eap_ttls",
        .magic          = RLM_MODULE_INIT,
 
-       .provides       = { FR_EAP_TTLS },
+       .provides       = { FR_EAP_METHOD_TTLS },
        .inst_size      = sizeof(rlm_eap_ttls_t),
        .config         = submodule_config,
        .instantiate    = mod_instantiate,      /* Create new submodule instance */
index 69363c7ca3d9f020b943e65ff6d04a19ab1698a8..9fdbe3f6d9edea030f60644c22de724f1c6ca7ee 100644 (file)
@@ -660,7 +660,7 @@ FR_CODE eap_ttls_process(eap_session_t *eap_session, tls_session_t *tls_session)
                        if (vp &&
                            (vp->vp_length >= EAP_HEADER_LEN + 2) &&
                            (vp->vp_strvalue[0] == FR_EAP_CODE_RESPONSE) &&
-                           (vp->vp_strvalue[EAP_HEADER_LEN] == FR_EAP_IDENTITY) &&
+                           (vp->vp_strvalue[EAP_HEADER_LEN] == FR_EAP_METHOD_IDENTITY) &&
                            (vp->vp_strvalue[EAP_HEADER_LEN + 1] != 0)) {
                                /*
                                 *      Create & remember a User-Name