Skip to content
Permalink
Browse files

Hacks to allow more EAP methods to function

  • Loading branch information
arr2036 committed Sep 3, 2019
1 parent bc34075 commit 43fe14890b352d9d5c0e51f8a30a2789a567a459
@@ -43,6 +43,8 @@ typedef struct {
//!< #eap_session_t.

fr_dict_t **namespace; //!< Namespace children should be allocated in.

bool clone_parent_lists; //!< HACK until all eap methods run their own sections.
} rlm_eap_submodule_t;

/** Private structure to hold handles and interfaces for an EAP method
@@ -621,6 +621,13 @@ static rlm_rcode_t eap_method_select(rlm_eap_t *inst, UNUSED void *thread, eap_s
*/
fr_state_restore_to_child(eap_session->subrequest, inst, 0);

if (method->submodule->clone_parent_lists) {
fr_pair_list_copy(eap_session->subrequest, &eap_session->subrequest->control, request->control);
fr_pair_list_copy(eap_session->subrequest->packet,
&eap_session->subrequest->packet->vps,
request->packet->vps);
}

/*
* Push the submodule into the child's stack
*/
@@ -243,5 +243,7 @@ rlm_eap_submodule_t rlm_eap_gtc = {
.config = submodule_config,

.session_init = mod_session_init, /* Initialise a new EAP session */
.entry_point = mod_process /* Process next round of EAP method */
.entry_point = mod_process, /* Process next round of EAP method */

.clone_parent_lists = true /* HACK */
};
@@ -877,5 +877,7 @@ rlm_eap_submodule_t rlm_eap_mschapv2 = {
.instantiate = mod_instantiate, /* Create new submodule instance */

.session_init = mod_session_init, /* Initialise a new EAP session */
.entry_point = mod_process /* Process next round of EAP method */
.entry_point = mod_process, /* Process next round of EAP method */

.clone_parent_lists = true /* HACK */
};
@@ -322,7 +322,7 @@ static rlm_rcode_t mod_process(void *instance, UNUSED void *thread, REQUEST *req
memcpy(session->peer_id, packet->identity, session->peer_id_len);
session->peer_id[session->peer_id_len] = '\0';

known_good = password_find(&ephemeral, request, request,
known_good = password_find(&ephemeral, request, request->parent,
allowed_passwords, NUM_ELEMENTS(allowed_passwords), false);
if (!known_good) {
REDEBUG("No \"known good\" password found for user");
@@ -448,8 +448,8 @@ static rlm_rcode_t mod_process(void *instance, UNUSED void *thread, REQUEST *req
/*
* Return the MSK (in halves).
*/
eap_add_reply(request, attr_ms_mppe_recv_key, msk, MPPE_KEY_LEN);
eap_add_reply(request, attr_ms_mppe_send_key, msk + MPPE_KEY_LEN, MPPE_KEY_LEN);
eap_add_reply(request->parent, attr_ms_mppe_recv_key, msk, MPPE_KEY_LEN);
eap_add_reply(request->parent, attr_ms_mppe_send_key, msk + MPPE_KEY_LEN, MPPE_KEY_LEN);

rcode = RLM_MODULE_OK;
break;

0 comments on commit 43fe148

Please sign in to comment.
You can’t perform that action at this time.