]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
make EAP use flat or nested attributes
authorJorge Pereira <jpereira@freeradius.org>
Fri, 26 May 2023 01:54:24 +0000 (22:54 -0300)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 29 May 2023 21:02:48 +0000 (16:02 -0500)
src/lib/eap_aka_sim/state_machine.c
src/lib/eap_aka_sim/vector.c

index ceee377cd55b76b00701f416dc711b0ea678f30b..b3c99f98cdf0ecfe1f2489f83cfb967d9822ef43 100644 (file)
@@ -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);
 
index 9f32330a4f5337761de9985e7dae7a676d4a472f..82b6ad2e04adc92bf594689b7125b574b07121ec 100644 (file)
@@ -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);