}
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.
}
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;
}
}
/* 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;
}
#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)
/*
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;
}
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;
* 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;
* 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;
}
*
* ...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;
}
* @copyright 2019 The FreeRADIUS server project
*/
+#include <stdbool.h>
+
#include "types.h"
/** Structure to hold EAP data
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);
* 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");
* 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;
* 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",
*
* @copyright 2019 The FreeRADIUS server project
*/
+#include <freeradius-devel/server/request.h>
+#include <freeradius-devel/server/module.h>
+
#include "compose.h"
#include "types.h"
* @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;
}
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
} 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)
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;
}
* 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;
* 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;
}
{
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
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;
}
/*
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]),
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;
}
* 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,
* 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);
/*
* 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;
* Figure out what to do.
*/
switch (type->num) {
- case FR_EAP_IDENTITY:
+ case FR_EAP_METHOD_IDENTITY:
/*
* Allow per-user configuration of EAP types.
*/
/*
* 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;
/*
* 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
* 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;
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.
/*
* 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);
/*
* 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!
/*
* 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:
* 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,
}
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;
.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,
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);
}
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
.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 */
.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,
*/
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");
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);
.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 */
};
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)) {
* 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);
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 */
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
.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 */
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);
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;
}
/*
* 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),
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;
* 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;
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;
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);
* 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;
.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,
* 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);
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;
*/
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)));
.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 */
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;
.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,
.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 */
.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 */
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