aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2005-06-26 18:55:03 (GMT)
committerJouni Malinen <j@w1.fi>2005-06-26 18:55:03 (GMT)
commit2e92c172a7a8f8cf11be23ae1643a30406c0cd56 (patch)
tree21417337b35db3175e6df1ee008428d88a7df349
parent894e73f513d3f718965a830affd19c627a0cdaf0 (diff)
downloadhostap-history-2e92c172a7a8f8cf11be23ae1643a30406c0cd56.zip
hostap-history-2e92c172a7a8f8cf11be23ae1643a30406c0cd56.tar.gz
hostap-history-2e92c172a7a8f8cf11be23ae1643a30406c0cd56.tar.bz2
Start RADIUS accounting only after successful completion of WPA
4-Way Handshake if WPA-PSK is used.
-rw-r--r--hostapd/ChangeLog2
-rw-r--r--hostapd/hostapd.c7
-rw-r--r--hostapd/wpa.c3
3 files changed, 9 insertions, 3 deletions
diff --git a/hostapd/ChangeLog b/hostapd/ChangeLog
index 6defa3d..6a941a4 100644
--- a/hostapd/ChangeLog
+++ b/hostapd/ChangeLog
@@ -3,6 +3,8 @@ ChangeLog for hostapd
????-??-?? - v0.4.3
* fixed PMKSA caching to copy User-Name and Class attributes so that
RADIUS accounting gets correct information
+ * start RADIUS accounting only after successful completion of WPA
+ 4-Way Handshake if WPA-PSK is used
2005-06-12 - v0.4.2
* EAP-PAX is now registered as EAP type 46
diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c
index a2a790e..98808d3 100644
--- a/hostapd/hostapd.c
+++ b/hostapd/hostapd.c
@@ -205,9 +205,10 @@ void hostapd_new_assoc_sta(hostapd *hapd, struct sta_info *sta)
if (hapd->conf->ieee802_11f)
iapp_new_station(hapd->iapp, sta);
- /* Start accounting here, if IEEE 802.1X is not used. IEEE 802.1X code
- * will start accounting after the station has been authorized. */
- if (!hapd->conf->ieee802_1x)
+ /* Start accounting here, if IEEE 802.1X and WPA are not used.
+ * IEEE 802.1X/WPA code will start accounting after the station has
+ * been authorized. */
+ if (!hapd->conf->ieee802_1x && !hapd->conf->wpa)
accounting_sta_start(hapd, sta);
/* Start IEEE 802.1X authentication process for new stations */
diff --git a/hostapd/wpa.c b/hostapd/wpa.c
index 15558eb..0ad6684 100644
--- a/hostapd/wpa.c
+++ b/hostapd/wpa.c
@@ -34,6 +34,7 @@
#include "eloop.h"
#include "sta_info.h"
#include "l2_packet.h"
+#include "accounting.h"
static void wpa_send_eapol_timeout(void *eloop_ctx, void *timeout_ctx);
@@ -2354,6 +2355,8 @@ SM_STATE(WPA_PTK, PTKINITDONE)
HOSTAPD_LEVEL_INFO, "pairwise key handshake completed "
"(%s)",
sm->sta->wpa == WPA_VERSION_WPA ? "WPA" : "RSN");
+ if (sm->sta->wpa_key_mgmt == WPA_KEY_MGMT_PSK)
+ accounting_sta_start(sm->hapd, sm->sta);
}