wpa_supplicant compilation with -Os option causes WPA2-PSK-TKIP+CCMP break down

Jouni Malinen j at w1.fi
Mon Jun 29 13:37:46 EDT 2009


On Fri, Jun 19, 2009 at 10:58:58AM +0530, Raghavendra wrote:

>    WPA2-PSK-TKIP+CCMP is working with DLink (DWL-2100AP), Linksys(WAP4400N). But was not working with Cisco (Linksys) - WRT610N.
>    Reason is that I compiled wpa_supplicant with -Os option. Later when I compiled with -O2 or with out optimization flag it is working with Cisco router also. Please see below log.

Which CPU are you using on the device that runs wpa_supplicant? Could
you please also send a debug log from the -O2 case so that it will be
easier to compare the behavior between these cases?

> RX EAPOL - hexdump(len=99): 02 03 00 5f 02 00 8a 00 10 00 00 00 00 00 00 00 01 4b e9 dd 83 9b 8a 81 37 3f b7 0a 1d 8b dc 2f aa 99 83 3f 16 ea c0 d3 e8 43 d9 4e 7f 08 f2 2a 92 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> WPA: EAPOL frame too short to be a WPA EAPOL-Key (len 72, expecting at least 99)

That looks very odd.. that "len 72" should really be "len 99" since it
is the same variable (len in wpa_sm_rx_eapol() call from
wpa_supplicant_rx_eapol() which is dumping the frame contents). I don't
see how the compiler could end up corrupting that variable, though,
regardless of optimization parameters..

It would be useful to check (e.g., by single stepping through
wpa_supplicant_rx_eapol() in gdb) when the len variable actually changes
its value from 99 to 72.

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list