mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-29 08:14:02 -05:00
Use a shared function for freeing PSK list
There is no need to duplicate this code in multiple locations. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
fc5550a1c2
commit
f2a14be798
@ -570,11 +570,7 @@ static void handle_auth(struct hostapd_data *hapd,
|
|||||||
HOSTAPD_LEVEL_INFO, "VLAN ID %d", sta->vlan_id);
|
HOSTAPD_LEVEL_INFO, "VLAN ID %d", sta->vlan_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (sta->psk) {
|
hostapd_free_psk_list(sta->psk);
|
||||||
struct hostapd_sta_wpa_psk_short *prev = sta->psk;
|
|
||||||
sta->psk = sta->psk->next;
|
|
||||||
os_free(prev);
|
|
||||||
}
|
|
||||||
if (hapd->conf->wpa_psk_radius != PSK_RADIUS_IGNORED) {
|
if (hapd->conf->wpa_psk_radius != PSK_RADIUS_IGNORED) {
|
||||||
sta->psk = psk;
|
sta->psk = psk;
|
||||||
psk = NULL;
|
psk = NULL;
|
||||||
@ -655,11 +651,7 @@ static void handle_auth(struct hostapd_data *hapd,
|
|||||||
fail:
|
fail:
|
||||||
os_free(identity);
|
os_free(identity);
|
||||||
os_free(radius_cui);
|
os_free(radius_cui);
|
||||||
while (psk) {
|
hostapd_free_psk_list(psk);
|
||||||
struct hostapd_sta_wpa_psk_short *prev = psk;
|
|
||||||
psk = psk->next;
|
|
||||||
os_free(prev);
|
|
||||||
}
|
|
||||||
|
|
||||||
send_auth_reply(hapd, mgmt->sa, mgmt->bssid, auth_alg,
|
send_auth_reply(hapd, mgmt->sa, mgmt->bssid, auth_alg,
|
||||||
auth_transaction + 1, resp, resp_ies, resp_ies_len);
|
auth_transaction + 1, resp, resp_ies, resp_ies_len);
|
||||||
|
@ -55,14 +55,9 @@ struct hostapd_acl_query_data {
|
|||||||
#ifndef CONFIG_NO_RADIUS
|
#ifndef CONFIG_NO_RADIUS
|
||||||
static void hostapd_acl_cache_free_entry(struct hostapd_cached_radius_acl *e)
|
static void hostapd_acl_cache_free_entry(struct hostapd_cached_radius_acl *e)
|
||||||
{
|
{
|
||||||
struct hostapd_sta_wpa_psk_short *psk = e->psk;
|
|
||||||
os_free(e->identity);
|
os_free(e->identity);
|
||||||
os_free(e->radius_cui);
|
os_free(e->radius_cui);
|
||||||
while (psk) {
|
hostapd_free_psk_list(e->psk);
|
||||||
struct hostapd_sta_wpa_psk_short *prev = psk;
|
|
||||||
psk = psk->next;
|
|
||||||
os_free(prev);
|
|
||||||
}
|
|
||||||
os_free(e);
|
os_free(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -636,3 +631,13 @@ void hostapd_acl_deinit(struct hostapd_data *hapd)
|
|||||||
hostapd_acl_query_free(prev);
|
hostapd_acl_query_free(prev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void hostapd_free_psk_list(struct hostapd_sta_wpa_psk_short *psk)
|
||||||
|
{
|
||||||
|
while (psk) {
|
||||||
|
struct hostapd_sta_wpa_psk_short *prev = psk;
|
||||||
|
psk = psk->next;
|
||||||
|
os_free(prev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -23,5 +23,6 @@ int hostapd_allowed_address(struct hostapd_data *hapd, const u8 *addr,
|
|||||||
char **identity, char **radius_cui);
|
char **identity, char **radius_cui);
|
||||||
int hostapd_acl_init(struct hostapd_data *hapd);
|
int hostapd_acl_init(struct hostapd_data *hapd);
|
||||||
void hostapd_acl_deinit(struct hostapd_data *hapd);
|
void hostapd_acl_deinit(struct hostapd_data *hapd);
|
||||||
|
void hostapd_free_psk_list(struct hostapd_sta_wpa_psk_short *psk);
|
||||||
|
|
||||||
#endif /* IEEE802_11_AUTH_H */
|
#endif /* IEEE802_11_AUTH_H */
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "accounting.h"
|
#include "accounting.h"
|
||||||
#include "ieee802_1x.h"
|
#include "ieee802_1x.h"
|
||||||
#include "ieee802_11.h"
|
#include "ieee802_11.h"
|
||||||
|
#include "ieee802_11_auth.h"
|
||||||
#include "wpa_auth.h"
|
#include "wpa_auth.h"
|
||||||
#include "preauth_auth.h"
|
#include "preauth_auth.h"
|
||||||
#include "ap_config.h"
|
#include "ap_config.h"
|
||||||
@ -235,11 +236,7 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta)
|
|||||||
wpabuf_free(sta->hs20_ie);
|
wpabuf_free(sta->hs20_ie);
|
||||||
|
|
||||||
os_free(sta->ht_capabilities);
|
os_free(sta->ht_capabilities);
|
||||||
while (sta->psk) {
|
hostapd_free_psk_list(sta->psk);
|
||||||
struct hostapd_sta_wpa_psk_short *prev = sta->psk;
|
|
||||||
sta->psk = sta->psk->next;
|
|
||||||
os_free(prev);
|
|
||||||
}
|
|
||||||
os_free(sta->identity);
|
os_free(sta->identity);
|
||||||
os_free(sta->radius_cui);
|
os_free(sta->radius_cui);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user