reconnect problem

Jouni Malinen jkmaline
Tue Mar 16 18:18:37 PST 2004

On Tue, Mar 16, 2004 at 06:19:49PM +0100, Peter wrote:

> i'm running the current-cvs of hostap(d) with wpa-psk enabled
> when i eject the stations card (pcmcia) and reinsert it before the
> inactivity timeout (5 min?) i get the following error message from
> hostapd:
> ...received EAPOL-Key with invalid MIC
> (the new authentication doesn't reset the wpa-stuff)

> when i kick the station after this error (see diff below), it reconnects
> and everything works again. even the windows connection is stable.

The issue is real, but this fix is not correct. PTK is supposed to be
cleared on new IEEE 802.11 authentication and (re)association frames.
There is a related FIX comment in hostapd/wpa.c wpa_event_reauth()
function. However, PTK needs to be cleared both from the driver and from
hostapd. I have not verified, whether this is the only place that
requires such a change. The following (untested) patch is one part of
the fix, but it might not be enough. I need to take a closer look at
this once I get back home, but this is something that could be tested

Index: wpa.c
RCS file: /home/jm/cvsroot/hostap/hostapd/wpa.c,v
retrieving revision 1.11
diff -u -p -r1.11 wpa.c
--- wpa.c	4 Mar 2004 03:08:50 -0000	1.11
+++ wpa.c	17 Mar 2004 02:14:25 -0000
@@ -950,6 +950,8 @@ void wpa_event_reauth(struct hostapd_dat
 	sm->pairwise_set = FALSE;
 	/* FIX: remove PTK from kernel driver */
+	sm->PTK_valid = FALSE;
+	memset(&sm->PTK, 0, sizeof(sm->PTK));
 	sm->ReAuthenticationRequest = TRUE;

Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list