OpenWrt Forum Archive

Topic: Problems with WPA2 connection to DIR-825 from Android

The content of this topic has been archived on 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

I've been using openwrt for several years now, running WhiteRussian on a WRT54GS. For various reasons, I decided to upgrade both the hardware and the software (to trunk as of yesterday), and picked out the D-Link DIR-825. Configuration has gone fine (some ipsec problems, but they're dealt with now), but I'm still having issues with establishing a WPA2 connection from my Motorola Droid. The phone worked fine with the WRT54GS/WhiteRussian set up, and it's able to connect to the new D-Link if the network is open. It is not able to connect if WPA is active.

I have been able to connect with both a Macbook and my linux laptop on both 2.4 and 5 GHz bands with no issues. I've tried changing the encryption settings between psk2+tkip+aes and psk2 (the latter is what I'd prefer to leave it at) with no change in my ability to connect with the Droid. I've tried switching the 2.4Ghz radio to 11g instead of 11ng, with no effect. I've also tried changing channels, and changing the htmode on the 2.4 radio, again, with no effect. This appears to be purely between wpa_supplicant on the android and hostapd on the router.

I'm hoping someone here can make better sense out of this than I can. This is probably a bug with Android, but getting it to work is essential to me, and I'm hoping there's some way to fix this on the openwrt side. I've tried downgrading wpad-mini to backfire and backfire betas, with no change in the results. I am running shorewall-lite, but all wireless access is open, and I don't think it should interfere.

My /etc/config/wireless and hostapd output are below. If anyone has any advice or can provide any help, I would most appreciate it. In my research, I've run across some references that this may be a problem with the eapol version (2 vs. 1), but I haven't been able to downgrade hostapd to use eapol version 1, so don't know if this is on the right track or not.

Thanks,
David

First, my /etc/config/wireless:
config wifi-device  radio0
        option type     mac80211
        option channel  11
        option macaddr  00:18:e7:e6:b5:21
        option hwmode   11ng
        option htmode   HT20
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40

config wifi-iface
        option device   radio0
        option network  wifi
        option mode     ap
        option ssid     dlevitan
        option encryption psk2
        option key      <psk>

config wifi-device  radio1
        option type     mac80211
        option channel  36
        option macaddr  00:18:e7:e6:b5:22
        option hwmode   11na
        option htmode   HT40+
        list ht_capab   SHORT-GI-40
        list ht_capab   TX-STBC
        list ht_capab   RX-STBC1
        list ht_capab   DSSS_CCK-40

config wifi-iface
        option device   radio1
        option network  wifi
        option mode     ap
        option ssid     dlevitann
        option encryption psk2
        option key      <psk>

And running hostapd in debug mode:

root@anduin:/tmp# hostapd -P /var/run/wifi-phy0.pid -d /var/run/hostapd-phy0.conf
Configuration file: /var/run/hostapd-phy0.conf
netlink: Operstate: linkmode=1, operstate=5
nl80211: Add own interface ifindex 10
nl80211: Add own interface ifindex 21
nl80211: New interface mon.wlan0 created: ifindex=25
nl80211: Add own interface ifindex 25
nl80211: Adding interface wlan0 into bridge br-wifi
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Added 802.11b mode based on 802.11g information
Completing interface initialization
Mode: IEEE 802.11g  Channel: 11  Frequency: 2462 MHz
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Flushing old station entries
Deauthenticate all stations
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=(nil) key_idx=0 set_tx=1 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr 00:18:e7:e6:b5:21 and ssid 'dlevitan'
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=8):
     64 6c 65 76 69 74 61 6e                           dlevitan       
PSK (ASCII passphrase) - hexdump_ascii(len=36): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
WPA: group state machine entering state GTK_INIT (VLAN-ID 0)
GMK - hexdump(len=32): [REMOVED]
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=21 alg=3 addr=(nil) key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: Set beacon (beacon_set=0)
wlan0: Setup of interface done.
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
nl80211: Interface down
Unknown event 29
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1043 ([UP][RUNNING])
nl80211: Interface up
Unknown event 28
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
nl80211: Interface down
Unknown event 29
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
nl80211: Interface up
Unknown event 28
RTM_NEWLINK, IFLA_IFNAME: Interface 'mon.wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
nl80211: Interface down
Unknown event 29
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
nl80211: Add ifindex 10 for bridge br-wifi
nl80211: Add own interface ifindex 10
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
nl80211: Interface up
Unknown event 28
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
nl80211: Add ifindex 10 for bridge br-wifi
nl80211: Add own interface ifindex 10
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
nl80211: Add ifindex 10 for bridge br-wifi
nl80211: Add own interface ifindex 10
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
Unknown event 5
mgmt::auth
authentication: STA=00:26:ba:3b:53:91 auth_alg=0 auth_transaction=1 status_code=0 wep=0
  New STA
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: authentication OK (open system)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-AUTHENTICATE.indication(00:26:ba:3b:53:91, OPEN_SYSTEM)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-DELETEKEYS.request(00:26:ba:3b:53:91)
authentication reply: STA=00:26:ba:3b:53:91 auth_alg=0 auth_transaction=2 resp=0 (IE len=0)
mgmt::auth cb
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: authenticated
mgmt::assoc_req
association request: STA=00:26:ba:3b:53:91 capab_info=0x8431 listen_interval=3
Validating WMM IE: OUI 00:50:f2  OUI type 2  OUI sub-type 0  version 1  QoS info 0x0
  new AID 1
HT: STA 00:26:ba:3b:53:91 HT Capabilities Info: 0x1030
update_sta_ht STA 00:26:ba:3b:53:91 - 20 MHz HT, num of 20MHz HT STAs 1
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x0 changes=0
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: association OK (aid 1)
mgmt::assoc_resp cb
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: associated (aid 1)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-ASSOCIATE.indication(00:26:ba:3b:53:91)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-DELETEKEYS.request(00:26:ba:3b:53:91)
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=0x480ac0 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:26:ba:3b:53:91
wlan0: STA 00:26:ba:3b:53:91 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=0x480ac0 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:26:ba:3b:53:91
wlan0: STA 00:26:ba:3b:53:91 WPA: start authentication
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=0x480ac0 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:26:ba:3b:53:91
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.1X: unauthorizing port
WPA: 00:26:ba:3b:53:91 WPA_PTK_GROUP entering state IDLE
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state AUTHENTICATION
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state AUTHENTICATION2
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state INITPSK
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state PTKSTART
wlan0: STA 00:26:ba:3b:53:91 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: Event message available
nl80211: Ignored unknown event (cmd=19)
IEEE 802.1X: 00:26:ba:3b:53:91 TX status - version=2 type=3 length=95 - ack=1
IEEE 802.1X: 121 bytes from 00:26:ba:3b:53:91
   IEEE 802.1X: version=1 type=3 length=117
wlan0: STA 00:26:ba:3b:53:91 WPA: WPA IE from (Re)AssocReq did not match with msg 2/4
WPA IE in AssocReq - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00
WPA IE in msg 2/4 - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 3c 00
hostapd_wpa_auth_disconnect: WPA authenticator requests disconnect: STA 00:26:ba:3b:53:91 reason 2
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: deauthenticated due to local deauth request
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x0 changes=0
mgmt::deauth
deauthentication: STA=00:26:ba:3b:53:91 reason_code=1
Station 00:26:ba:3b:53:91 trying to deauthenticate, but it is not authenticated.
mgmt::auth
authentication: STA=00:23:6c:7f:1e:fb auth_alg=0 auth_transaction=1 status_code=0 wep=0
  New STA
wlan0: STA 00:23:6c:7f:1e:fb IEEE 802.11: authentication OK (open system)
wlan0: STA 00:23:6c:7f:1e:fb MLME: MLME-AUTHENTICATE.indication(00:23:6c:7f:1e:fb, OPEN_SYSTEM)
wlan0: STA 00:23:6c:7f:1e:fb MLME: MLME-DELETEKEYS.request(00:23:6c:7f:1e:fb)
authentication reply: STA=00:23:6c:7f:1e:fb auth_alg=0 auth_transaction=2 resp=0 (IE len=0)
mgmt::auth cb
wlan0: STA 00:23:6c:7f:1e:fb IEEE 802.11: did not acknowledge authentication response
mgmt::auth
authentication: STA=00:26:ba:3b:53:91 auth_alg=0 auth_transaction=1 status_code=0 wep=0
  New STA
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: authentication OK (open system)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-AUTHENTICATE.indication(00:26:ba:3b:53:91, OPEN_SYSTEM)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-DELETEKEYS.request(00:26:ba:3b:53:91)
authentication reply: STA=00:26:ba:3b:53:91 auth_alg=0 auth_transaction=2 resp=0 (IE len=0)
mgmt::auth cb
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: authenticated
mgmt::assoc_req
association request: STA=00:26:ba:3b:53:91 capab_info=0x8431 listen_interval=3
Validating WMM IE: OUI 00:50:f2  OUI type 2  OUI sub-type 0  version 1  QoS info 0x0
  new AID 1
HT: STA 00:26:ba:3b:53:91 HT Capabilities Info: 0x1030
update_sta_ht STA 00:26:ba:3b:53:91 - 20 MHz HT, num of 20MHz HT STAs 1
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x0 changes=0
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: association OK (aid 1)
mgmt::assoc_resp cb
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: associated (aid 1)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-ASSOCIATE.indication(00:26:ba:3b:53:91)
wlan0: STA 00:26:ba:3b:53:91 MLME: MLME-DELETEKEYS.request(00:26:ba:3b:53:91)
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=0x480b78 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:26:ba:3b:53:91
wlan0: STA 00:26:ba:3b:53:91 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=0x480b78 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:26:ba:3b:53:91
wlan0: STA 00:26:ba:3b:53:91 WPA: start authentication
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=21 alg=0 addr=0x480b78 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:26:ba:3b:53:91
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.1X: unauthorizing port
WPA: 00:26:ba:3b:53:91 WPA_PTK_GROUP entering state IDLE
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state AUTHENTICATION
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state AUTHENTICATION2
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state INITPSK
WPA: 00:26:ba:3b:53:91 WPA_PTK entering state PTKSTART
wlan0: STA 00:26:ba:3b:53:91 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: Event message available
nl80211: Ignored unknown event (cmd=19)
IEEE 802.1X: 00:26:ba:3b:53:91 TX status - version=2 type=3 length=95 - ack=1
IEEE 802.1X: 121 bytes from 00:26:ba:3b:53:91
   IEEE 802.1X: version=1 type=3 length=117
wlan0: STA 00:26:ba:3b:53:91 WPA: WPA IE from (Re)AssocReq did not match with msg 2/4
WPA IE in AssocReq - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00
WPA IE in msg 2/4 - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 3c 00
hostapd_wpa_auth_disconnect: WPA authenticator requests disconnect: STA 00:26:ba:3b:53:91 reason 2
wlan0: STA 00:26:ba:3b:53:91 IEEE 802.11: deauthenticated due to local deauth request
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x0 changes=0
mgmt::deauth
deauthentication: STA=00:26:ba:3b:53:91 reason_code=1
Station 00:26:ba:3b:53:91 trying to deauthenticate, but it is not authenticated.
^CSignal 2 received - terminating
wlan0: STA 00:23:6c:7f:1e:fb MLME: MLME-DEAUTHENTICATE.indication(00:23:6c:7f:1e:fb, 1)
wlan0: STA 00:23:6c:7f:1e:fb MLME: MLME-DELETEKEYS.request(00:23:6c:7f:1e:fb)
Removing station 00:23:6c:7f:1e:fb
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x0 changes=0
Flushing old station entries
Deauthenticate all stations
nl80211: Remove interface ifindex=25
netlink: Operstate: linkmode=0, operstate=6

I have the same issue with ath9k on my WNDR3700. Dot foldered.

Given that this appears to be very much a hostapd/wpa_supplicant issue (and I can see the one octet difference in the handshake, which appears to be the problem), I've posted a message to the hostapd list. I'll update if any solution gets posted.

aport, are you running stock Android or one of the custom ROMs?

I am running a custom ROM. Bugless Beast 2.2 Froyo v0.4 for the Moto Droid. I don't have any connectivity issues with a WNDR3700 with Netgear firmware.

(Last edited by aport on 30 Jul 2010, 19:46)

I think the 2.2 wifi drivers distributed in the current kernels are simply broken (I tested both with P3Droid's kernel and the stock CM6 kernel). Actually, I know they're broken, and badly - they violate the WPA2 specs, and I can easily see it from the capture logs I've taken. But I can't figure out the problem because the currently distributed Android source doesn't have the latest wifi drivers. I'm assuming that P3Droid has them, and I'm trying to get a hold of them to see what's going on.

hostapd combined with ath9k is very strict when it comes to the specs, and isn't lenient at all. Thus, it's causing the connection problems. Disabling WMM on the hostapd side gets rid of the first problem, but causes another one that I haven't had time to investigate yet. I'm working on it, but it'll probably take a while to get everything working, and will definitely require custom kernel builds on the Droid.

After much debugging and frustration, I've come up with a cause, one confirmed solution one likely solution, and one possible solution. The  cause is that the wireless driver in many of the custom ROMs is WiLink_Driver_6.1.0.0.131, which incorrectly sends two WPA2 RSN IEs that are different. It uses the value of the PTKSA from the AP to generate the PTKSA and GTKSA settings in the RSN capabilities section for the first RSN IE, but just uses 0 for the second. If WMM/WME is enabled on the AP, the AP sets its PTKSA to > 0, causing the Droid to respond with one RSN IE with non-zero values. But, hostapd uses the second RSN IE, notices the mismatch, and drops the connection. I don't know if the second RSN IE is selected by the ath9k driver (I think that's the case), and this is why only the particular combination of ath9k+131 driver causes problems.

The confirmed solution is to install the kernel from the Sapphire ROM. I'm using it with CM-0.6RC2 without problems thus far. That ROM includes WiLink_Driver_6.1.0.0.95_M3, which properly sends the RSN IE (only once) and is able to successfully connect. This is working on my Droid, and follows from my looking at the 95_M3 source (this is the version currently in the Android repository).

The likely solution is to disable WMM/WME on the AP. That will then cause the two RSN IE's sent by the 131 driver to both have capabilities = 0, which should work.

When I tried the second method, it failed with an invalid MIC. This appears to be a caching problem on the Droid - forgetting and enabling the network seems to work. You'll need to do it for both methods.

The possible solution is switching from WPA2 to WPA (and thus TKIP encryption). I don't believe WPA uses the RSN IEs at all, and thus this should probably work.

Hopefully this should solve your problem, and for anyone else.

(Last edited by dblevitan on 5 Aug 2010, 09:19)

I'm also running CyanongemMod on HTC Magic 32A, rom dated 10/07/2010 (DD/MM/YYYY) and the problem is still present with WNDR3700, trunk r23163. for me this problem is present since backfire (when i start to use openwrt)

In my opinion this is a phenomenon that OpenWRT should be able to deal with. If all other stock firmwares can and if even this is a Android bug, OpenWRT should be smart enough to make this work. I mean, if other firmwares can why can't OpenWrt?

Also, It may also cover other devices.

hostapd log, connect to wndr3700, using the net without problems:

mgmt::auth
authentication: STA=00:23:76:22:96:94 auth_alg=0 auth_transaction=1 status_code=0 wep=0
  New STA
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: authentication OK (open system)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-AUTHENTICATE.indication(00:23:76:22:96:94, OPEN_SYSTEM)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DELETEKEYS.request(00:23:76:22:96:94)
authentication reply: STA=00:23:76:22:96:94 auth_alg=0 auth_transaction=2 resp=0 (IE len=0)
mgmt::auth cb
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: authenticated
mgmt::assoc_req
association request: STA=00:23:76:22:96:94 capab_info=0x431 listen_interval=3
IEEE 802.11 element parse ignored unknown element (id=46 elen=1)
WMM IE - hexdump(len=7): 00 50 f2 02 00 01 00
Validating WMM IE: OUI 00:50:f2  OUI type 2  OUI sub-type 0  version 1  QoS info 0x0
  new AID 1
update_sta_no_ht STA 00:23:76:22:96:94 - no HT, num of non-HT stations 1
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x13 changes=2
nl80211: Set beacon (beacon_set=1)
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: association OK (aid 1)
mgmt::assoc_resp cb
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: associated (aid 1)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-ASSOCIATE.indication(00:23:76:22:96:94)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DELETEKEYS.request(00:23:76:22:96:94)
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 WPA: start authentication
WPA: 00:23:76:22:96:94 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 IEEE 802.1X: unauthorizing port
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state IDLE
WPA: 00:23:76:22:96:94 WPA_PTK entering state AUTHENTICATION
WPA: 00:23:76:22:96:94 WPA_PTK entering state AUTHENTICATION2
WPA: 00:23:76:22:96:94 WPA_PTK entering state INITPSK
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKSTART
wlan0: STA 00:23:76:22:96:94 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: Event message available
nl80211: Ignored unknown event (cmd=19)
IEEE 802.1X: 00:23:76:22:96:94 TX status - version=2 type=3 length=95 - ack=1
IEEE 802.1X: 121 bytes from 00:23:76:22:96:94
   IEEE 802.1X: version=1 type=3 length=117
wlan0: STA 00:23:76:22:96:94 WPA: received EAPOL-Key frame (2/4 Pairwise)
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKCALCNEGOTIATING
WPA: PTK derivation - A1=00:24:b2:d8:28:b7 A2=00:23:76:22:96:94
WPA: PMK - hexdump(len=32): [REMOVED]
WPA: PTK - hexdump(len=48): [REMOVED]
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKCALCNEGOTIATING2
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKINITNEGOTIATING
wlan0: STA 00:23:76:22:96:94 WPA: sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=1 mic=1 ack=1 install=1 pairwise=8 kde_len=46 keyidx=1 encr=1)
Plaintext EAPOL-Key Key Data - hexdump(len=56): [REMOVED]
IEEE 802.1X: 00:23:76:22:96:94 TX status - version=2 type=3 length=151 - ack=1
IEEE 802.1X: 99 bytes from 00:23:76:22:96:94
   IEEE 802.1X: version=1 type=3 length=95
wlan0: STA 00:23:76:22:96:94 WPA: received EAPOL-Key frame (4/4 Pairwise)
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKINITDONE
wpa_driver_nl80211_set_key: ifindex=7 alg=3 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=16
   addr=00:23:76:22:96:94
AP-STA-CONNECTED 00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 IEEE 802.1X: authorizing port
wlan0: STA 00:23:76:22:96:94 WPA: pairwise key handshake completed (RSN)

log till the problem occurs:

mgmt::deauth
deauthentication: STA=00:23:76:22:96:94 reason_code=1
AP-STA-DISCONNECTED 00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 WPA: event 3 notification
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
WPA: 00:23:76:22:96:94 WPA_PTK entering state DISCONNECTED
WPA: 00:23:76:22:96:94 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 IEEE 802.1X: unauthorizing port
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: deauthenticated
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DEAUTHENTICATE.indication(00:23:76:22:96:94, 1)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DELETEKEYS.request(00:23:76:22:96:94)
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
hostapd_ht_operation_update current operation mode=0x13
hostapd_ht_operation_update new operation mode=0x0 changes=2
nl80211: Set beacon (beacon_set=1)
mgmt::auth
authentication: STA=00:23:76:22:96:94 auth_alg=0 auth_transaction=1 status_code=0 wep=0
  New STA
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: authentication OK (open system)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-AUTHENTICATE.indication(00:23:76:22:96:94, OPEN_SYSTEM)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DELETEKEYS.request(00:23:76:22:96:94)
authentication reply: STA=00:23:76:22:96:94 auth_alg=0 auth_transaction=2 resp=0 (IE len=0)
mgmt::auth cb
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: authenticated
mgmt::assoc_req
association request: STA=00:23:76:22:96:94 capab_info=0x431 listen_interval=3
IEEE 802.11 element parse ignored unknown element (id=46 elen=1)
WMM IE - hexdump(len=7): 00 50 f2 02 00 01 00
Validating WMM IE: OUI 00:50:f2  OUI type 2  OUI sub-type 0  version 1  QoS info 0x0
  new AID 1
update_sta_no_ht STA 00:23:76:22:96:94 - no HT, num of non-HT stations 1
hostapd_ht_operation_update current operation mode=0x0
hostapd_ht_operation_update new operation mode=0x13 changes=2
nl80211: Set beacon (beacon_set=1)
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: association OK (aid 1)
mgmt::assoc_resp cb
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: associated (aid 1)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-ASSOCIATE.indication(00:23:76:22:96:94)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DELETEKEYS.request(00:23:76:22:96:94)
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 WPA: event 1 notification
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 WPA: start authentication
WPA: 00:23:76:22:96:94 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 IEEE 802.1X: unauthorizing port
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state IDLE
WPA: 00:23:76:22:96:94 WPA_PTK entering state AUTHENTICATION
WPA: 00:23:76:22:96:94 WPA_PTK entering state AUTHENTICATION2
WPA: 00:23:76:22:96:94 WPA_PTK entering state INITPSK
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKSTART
wlan0: STA 00:23:76:22:96:94 WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8 kde_len=0 keyidx=0 encr=0)
nl80211: Event message available
nl80211: Ignored unknown event (cmd=19)
IEEE 802.1X: 00:23:76:22:96:94 TX status - version=2 type=3 length=95 - ack=1
IEEE 802.1X: 121 bytes from 00:23:76:22:96:94
   IEEE 802.1X: version=1 type=3 length=117
wlan0: STA 00:23:76:22:96:94 WPA: received EAPOL-Key frame (2/4 Pairwise)
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKCALCNEGOTIATING
WPA: PTK derivation - A1=00:24:b2:d8:28:b7 A2=00:23:76:22:96:94
WPA: PMK - hexdump(len=32): [REMOVED]
WPA: PTK - hexdump(len=48): [REMOVED]
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKCALCNEGOTIATING2
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKINITNEGOTIATING
wlan0: STA 00:23:76:22:96:94 WPA: sending 3/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=1 mic=1 ack=1 install=1 pairwise=8 kde_len=46 keyidx=1 encr=1)
Plaintext EAPOL-Key Key Data - hexdump(len=56): [REMOVED]
IEEE 802.1X: 00:23:76:22:96:94 TX status - version=2 type=3 length=151 - ack=1
IEEE 802.1X: 99 bytes from 00:23:76:22:96:94
   IEEE 802.1X: version=1 type=3 length=95
wlan0: STA 00:23:76:22:96:94 WPA: received EAPOL-Key frame (4/4 Pairwise)
WPA: 00:23:76:22:96:94 WPA_PTK entering state PTKINITDONE
wpa_driver_nl80211_set_key: ifindex=7 alg=3 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=16
   addr=00:23:76:22:96:94
AP-STA-CONNECTED 00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 IEEE 802.1X: authorizing port
wlan0: STA 00:23:76:22:96:94 WPA: pairwise key handshake completed (RSN)
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
GMK - hexdump(len=32): [REMOVED]
GTK - hexdump(len=16): [REMOVED]
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state REKEYNEGOTIATING
wlan0: STA 00:23:76:22:96:94 WPA: sending 1/2 msg of Group Key Handshake
WPA: Send EAPOL(version=2 secure=1 mic=1 ack=1 install=0 pairwise=0 kde_len=24 keyidx=2 encr=1)
Plaintext EAPOL-Key Key Data - hexdump(len=32): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=1
IEEE 802.1X: 99 bytes from 00:23:76:22:96:94
   IEEE 802.1X: version=1 type=3 length=95
wlan0: STA 00:23:76:22:96:94 WPA: received EAPOL-Key frame (2/2 Group)
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state REKEYESTABLISHED
wlan0: STA 00:23:76:22:96:94 WPA: group key handshake completed (RSN)
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=7 alg=3 addr=(nil) key_idx=2 set_tx=1 seq_len=0 key_len=16
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state IDLE
Checking STA 00:23:76:22:96:94 inactivity:
  Station has been active
Checking STA 00:23:76:22:96:94 inactivity:
  Station has been active
wlan0: WPA rekeying GTK
WPA: group state machine entering state SETKEYS (VLAN-ID 0)
GMK - hexdump(len=32): [REMOVED]
GTK - hexdump(len=16): [REMOVED]
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state REKEYNEGOTIATING
wlan0: STA 00:23:76:22:96:94 WPA: sending 1/2 msg of Group Key Handshake
WPA: Send EAPOL(version=2 secure=1 mic=1 ack=1 install=0 pairwise=0 kde_len=24 keyidx=1 encr=1)
Plaintext EAPOL-Key Key Data - hexdump(len=32): [REMOVED]
wpa_group_setkeys: GKeyDoneStations=1
IEEE 802.1X: 99 bytes from 00:23:76:22:96:94
   IEEE 802.1X: version=1 type=3 length=95
wlan0: STA 00:23:76:22:96:94 WPA: received EAPOL-Key frame (2/2 Group)
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state REKEYESTABLISHED
wlan0: STA 00:23:76:22:96:94 WPA: group key handshake completed (RSN)
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=7 alg=3 addr=(nil) key_idx=1 set_tx=1 seq_len=0 key_len=16
WPA: 00:23:76:22:96:94 WPA_PTK_GROUP entering state IDLE
mgmt::deauth
deauthentication: STA=00:23:76:22:96:94 reason_code=1
AP-STA-DISCONNECTED 00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 WPA: event 3 notification
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
WPA: 00:23:76:22:96:94 WPA_PTK entering state DISCONNECTED
WPA: 00:23:76:22:96:94 WPA_PTK entering state INITIALIZE
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
wlan0: STA 00:23:76:22:96:94 IEEE 802.1X: unauthorizing port
wlan0: STA 00:23:76:22:96:94 IEEE 802.11: deauthenticated
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DEAUTHENTICATE.indication(00:23:76:22:96:94, 1)
wlan0: STA 00:23:76:22:96:94 MLME: MLME-DELETEKEYS.request(00:23:76:22:96:94)
wpa_driver_nl80211_set_key: ifindex=7 alg=0 addr=0x47a078 key_idx=0 set_tx=1 seq_len=0 key_len=0
   addr=00:23:76:22:96:94
hostapd_ht_operation_update current operation mode=0x13
hostapd_ht_operation_update new operation mode=0x0 changes=2
nl80211: Set beacon (beacon_set=1)

(Last edited by luminoso on 7 Oct 2010, 13:18)

Beating a dead cow, but i have just hit the same problem on a current (trunk) setup on my WNDR3700.

I have tried to raise awareness at xda-developers, but it seems its not androids fault, but something with wpa_supplicant.

Anyone willing to contact the xda people ? Maybe this can be fixed in android, if not in wpa_supplicant or even in openwrt as it seems to work with other router-firmwares ?

Here is the link to the discussion on xda:

http://forum.xda-developers.com/showthread.php?t=973413

karl_k wrote:

Beating a dead cow, but i have just hit the same problem on a current (trunk) setup on my WNDR3700.

I have tried to raise awareness at xda-developers, but it seems its not androids fault, but something with wpa_supplicant.

Anyone willing to contact the xda people ? Maybe this can be fixed in android, if not in wpa_supplicant or even in openwrt as it seems to work with other router-firmwares ?

Here is the link to the discussion on xda:

http://forum.xda-developers.com/showthread.php?t=973413

Saw your post at xda and i had the same issue with OpenWrt and CM7. Solved by adding wmm_enabled=0 in /lib/wifi/mac80211.sh so that hostapd gets this option.

This is not a problem with OpenWRT, hostapd, or wpa_supplicant (the latter two are the same project, and mostly written by one person). This is a bug with Android wifi drivers that do not properly follow spec.

The TI Wilink driver I referred to is particularly at fault, and disabling WMM on the router is a band-aid to the problem - not a fix or a real solution. wpa_supplicant is not even involved in this process since the Wilink driver generates the RSN on its own.

The people who need to address this are TI, not openwrt or CM or someone else (or CM can put in a patch to fix the TI Wilink driver, which is probably a good idea anyway).

I have been in touch with CM devs, they say they can not fix this as the wifi driver is binary.

So, any chance we get a fix into openwrt ?

I ran in to this problem with the stock Droid (original) ROM, but did some more searching and found a workaround elsewhere in the forums, so thought I would post back here.

(Last edited by edgewood on 7 May 2011, 12:51)

The workaround linked above (disabling WMM) does solve the Droid wifi issue (for me) and I will post some more detail in the other thread.

This solution posted on another forum works great!


Ok

This solution works on Moto Droid with Android 2.2 and 2.2.1. Hope it will work on other android devices too

So:

1) Download wpa files from Eclair (attached)
2) Unzip and copy them to your phone, turn off WiFi, open Root Explorer or smth like this and place files in /system/bin/ . Don't forget to backup your original files!
3) Set proper permissions for newly copied files. They are needed to be set to rwxr -xr -x
4) Turn on WiFi. Now you'd be able to connect to your WPA2-Enterprise network!

Enjoy smile


Once you do that everything works as it should again on a Motorola Original Droid 1.

The discussion might have continued from here.