From: Jorge Pereira Date: Fri, 26 May 2023 01:54:24 +0000 (-0300) Subject: make EAP use flat or nested attributes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8cf6273db4e2d4a8ff1b64d480e24ec859ba6a9;p=thirdparty%2Ffreeradius-server.git make EAP use flat or nested attributes --- diff --git a/src/lib/eap_aka_sim/state_machine.c b/src/lib/eap_aka_sim/state_machine.c index ceee377cd55..b3c99f98cdf 100644 --- a/src/lib/eap_aka_sim/state_machine.c +++ b/src/lib/eap_aka_sim/state_machine.c @@ -684,7 +684,7 @@ RESUME(store_pseudonym) * find a next_reauth_id pair in the * reply list. */ - vp = fr_pair_find_by_da(&request->reply_pairs, NULL, attr_eap_aka_sim_next_reauth_id); + vp = fr_pair_find_by_da_nested(&request->reply_pairs, NULL, attr_eap_aka_sim_next_reauth_id); if (vp) { /* * Generate a random fastauth string @@ -764,7 +764,7 @@ RESUME(store_pseudonym) * state increment by 1, otherwise, add the * attribute and set to zero. */ - vp = fr_pair_find_by_da(&request->session_state_pairs, NULL, attr_eap_aka_sim_counter); + vp = fr_pair_find_by_da_nested(&request->session_state_pairs, NULL, attr_eap_aka_sim_counter); if (vp) { vp->vp_uint16++; /* @@ -815,7 +815,7 @@ static unlang_action_t session_and_pseudonym_store(rlm_rcode_t *p_result, module unlang_interpret_stack_result_set(request, RLM_MODULE_NOOP); /* Needed because we may call resume functions directly */ - vp = fr_pair_find_by_da(&request->reply_pairs, NULL, attr_eap_aka_sim_next_pseudonym); + vp = fr_pair_find_by_da_nested(&request->reply_pairs, NULL, attr_eap_aka_sim_next_pseudonym); if (vp) { /* * Generate a random pseudonym string @@ -1683,7 +1683,7 @@ RESUME(recv_common_reauthentication_response) * clear out reauth information and enter the * challenge state. */ - if (fr_pair_find_by_da(&request->request_pairs, NULL, attr_eap_aka_sim_counter_too_small)) { + if (fr_pair_find_by_da_nested(&request->request_pairs, NULL, attr_eap_aka_sim_counter_too_small)) { RWDEBUG("Peer sent AT_COUNTER_TOO_SMALL (indicating our AT_COUNTER value (%u) wasn't fresh)", eap_aka_sim_session->keys.reauth.counter); diff --git a/src/lib/eap_aka_sim/vector.c b/src/lib/eap_aka_sim/vector.c index 9f32330a4f5..82b6ad2e04a 100644 --- a/src/lib/eap_aka_sim/vector.c +++ b/src/lib/eap_aka_sim/vector.c @@ -830,7 +830,7 @@ int fr_aka_sim_vector_gsm_umts_kdf_0_reauth_from_attrs(request_t *request, fr_pa * This is the *old* counter value increment * by 1 to get the *new* counter value */ - counter_vp = fr_pair_find_by_da(vps, NULL, attr_eap_aka_sim_counter); + counter_vp = fr_pair_find_by_da_nested(vps, NULL, attr_eap_aka_sim_counter); if (!counter_vp) { RDEBUG2("No &session-state.%s attribute found, can't calculate re-auth keys", attr_eap_aka_sim_counter->name); @@ -879,7 +879,7 @@ int fr_aka_sim_vector_umts_kdf_1_reauth_from_attrs(request_t *request, fr_pair_l * This is the *old* counter value increment * by 1 to get the *new* counter value */ - counter_vp = fr_pair_find_by_da(vps, NULL, attr_eap_aka_sim_counter); + counter_vp = fr_pair_find_by_da_nested(vps, NULL, attr_eap_aka_sim_counter); if (!counter_vp) { RDEBUG2("No &session-state.%s attribute found, can't calculate re-auth keys", attr_eap_aka_sim_counter->name);