]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mka: Fix the order of operations in secure channel deletion
authorBadrish Adiga H R <badrish.adigahr@gmail.com>
Sat, 18 Feb 2017 13:14:15 +0000 (05:14 -0800)
committerJouni Malinen <j@w1.fi>
Mon, 20 Feb 2017 20:15:04 +0000 (22:15 +0200)
The correct order of deleting a secure channel is to purge all the
secure associations in the channel before actually deleting the secure
channel.

Signed-off-by: Badrish Adiga H R <badrish.adigahr@gmail.com>
src/pae/ieee802_1x_kay.c

index e420fc13eaf93b0d0a0caf657b03e24981e7ea0c..3f9e53da978743fa325be14870d19d27b0c5f33e 100644 (file)
@@ -2361,9 +2361,9 @@ static void ieee802_1x_participant_timer(void *eloop_ctx, void *timeout_ctx)
                                              &participant->rxsc_list,
                                              struct receive_sc, list) {
                                if (sci_equal(&rxsc->sci, &peer->sci)) {
-                                       secy_delete_receive_sc(kay, rxsc);
                                        ieee802_1x_kay_deinit_receive_sc(
                                                participant, rxsc);
+                                       secy_delete_receive_sc(kay, rxsc);
                                }
                        }
                        dl_list_del(&peer->list);
@@ -3432,11 +3432,11 @@ ieee802_1x_kay_delete_mka(struct ieee802_1x_kay *kay, struct mka_key_name *ckn)
        while (!dl_list_empty(&participant->rxsc_list)) {
                rxsc = dl_list_entry(participant->rxsc_list.next,
                                     struct receive_sc, list);
-               secy_delete_receive_sc(kay, rxsc);
                ieee802_1x_kay_deinit_receive_sc(participant, rxsc);
+               secy_delete_receive_sc(kay, rxsc);
        }
-       secy_delete_transmit_sc(kay, participant->txsc);
        ieee802_1x_kay_deinit_transmit_sc(participant, participant->txsc);
+       secy_delete_transmit_sc(kay, participant->txsc);
 
        os_memset(&participant->cak, 0, sizeof(participant->cak));
        os_memset(&participant->kek, 0, sizeof(participant->kek));