]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Add wpa_pasn_reset() to eliminate need for struct wpa_supplicant
authorVinay Gannevaram <quic_vganneva@quicinc.com>
Sat, 17 Sep 2022 09:24:18 +0000 (14:54 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 3 Nov 2022 22:19:14 +0000 (00:19 +0200)
Split wpas_pasn_reset() so that the main reset steps can be used without
an instance of struct wpa_supplicant. This is needed to allow PASN
implementation to be used for additional purposes outside the context of
wpa_supplicant.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
wpa_supplicant/pasn_supplicant.c

index 7bd8443faff62ae5d36d1724bfdde9d29ceafd0c..2c8c086eb24868e035fcdec7e752f47d2bfb7d35 100644 (file)
@@ -1127,19 +1127,13 @@ fail:
 }
 
 
-static void wpas_pasn_reset(struct wpa_supplicant *wpa_s)
+static void wpa_pasn_reset(struct wpas_pasn *pasn)
 {
-       struct wpas_pasn *pasn = &wpa_s->pasn;
-
        wpa_printf(MSG_DEBUG, "PASN: Reset");
 
        crypto_ecdh_deinit(pasn->ecdh);
        pasn->ecdh = NULL;
 
-       wpas_pasn_cancel_auth_work(wpa_s);
-       wpa_s->pasn_auth_work = NULL;
-
-       eloop_cancel_timeout(wpas_pasn_auth_work_timeout, wpa_s, NULL);
 
        pasn->akmp = 0;
        pasn->cipher = 0;
@@ -1176,6 +1170,18 @@ static void wpas_pasn_reset(struct wpa_supplicant *wpa_s)
 }
 
 
+static void wpas_pasn_reset(struct wpa_supplicant *wpa_s)
+{
+       struct wpas_pasn *pasn = &wpa_s->pasn;
+
+       wpas_pasn_cancel_auth_work(wpa_s);
+       wpa_s->pasn_auth_work = NULL;
+       eloop_cancel_timeout(wpas_pasn_auth_work_timeout, wpa_s, NULL);
+
+       wpa_pasn_reset(pasn);
+}
+
+
 static int wpas_pasn_set_pmk(struct wpa_supplicant *wpa_s,
                             struct wpa_ie_data *rsn_data,
                             struct wpa_pasn_params_data *pasn_data,