<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=big5">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>good'day,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I've been trying&nbsp;to get WPA-PSK working on 
madwifi for 4 days, but failed.&nbsp;I keep getting this error message from 
hostapd:</FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG>"WPA: EAPOL-Key 
timeout"</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Please point out if i make silly mistakes along the 
way. Thanks.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>For </FONT><FONT face=Arial 
size=2>hostapd-0.4.1,&nbsp;i</FONT><FONT face=Arial size=2> modified Makefile 
and .config</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In Makefile:</FONT></DIV>
<DIV>
<DIV><FONT face=Courier size=2>CC=mipsel-linux-gcc</FONT></DIV></DIV>
<DIV><FONT face=Courier 
size=2>DIR_WPA_SUPPLICANT=../wpa_supplicant-0.4.1</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In .config:</FONT><FONT face=Arial size=2><BR><FONT 
face=Courier>CONFIG_DRIVER_MADWIFI=y<BR>CFLAGS += 
-I/home/samples/madwifi-bsd</FONT></FONT></DIV>
<DIV><FONT face=Courier size=2>CFLAGS += -I/home/ssl/include<BR>LIBS += 
-L/home/ssl/lib</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In hostapd.conf, i set the following:</FONT></DIV>
<DIV><FONT face=Courier size=2>interface=ath0</FONT></DIV>
<DIV><FONT face=Courier size=2>bridge=br0<BR>driver=madwifi</FONT></DIV>
<DIV><FONT face=Courier 
size=2>logger_syslog=-1<BR>logger_syslog_level=2<BR>logger_stdout=-1<BR>logger_stdout_level=2</FONT></DIV>
<DIV><FONT face=Courier size=2>debug=0</FONT></DIV>
<DIV><FONT face=Courier size=2>dump_file=/tmp/hostapd.dump</FONT></DIV>
<DIV><FONT face=Courier size=2>ctrl_interface=/var/run/hostapd</FONT></DIV>
<DIV><FONT face=Courier size=2>ctrl_interface_group=0</FONT></DIV>
<DIV><FONT face=Courier size=2>ssid=MyWireless</FONT></DIV>
<DIV><FONT face=Courier size=2>macaddr_acl=0</FONT></DIV>
<DIV><FONT face=Courier size=2>auth_algs=3</FONT></DIV>
<DIV><FONT face=Courier size=2>eapol_key_index_workaround=0</FONT></DIV>
<DIV><FONT face=Courier size=2>eap_authenticator=0</FONT></DIV>
<DIV><FONT face=Courier size=2>own_ip_addr=127.0.0.1</FONT></DIV>
<DIV><FONT face=Courier size=2>wpa=1</FONT></DIV>
<DIV><FONT face=Courier 
size=2>wpa_psk=f6ac76d5715d53a12af3f2b040b3f8ac7072a5c35d8fffe2589471796ddd3e5b</FONT></DIV>
<DIV><FONT face=Courier size=2>wpa_key_mgmt=WPA-PSK</FONT></DIV>
<DIV><FONT face=Courier size=2>wpa_pairwise=TKIP </FONT></DIV>
<DIV><FONT face=Courier size=2>wpa_group_rekey=600</FONT></DIV>
<DIV><FONT face=Courier size=2>wpa_gmk_rekey=86400</FONT></DIV>
<DIV><FONT face=Courier size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Now comes to&nbsp;wpa_supplicant-0.4.1, i modified 
.config and Makefile,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In .config</FONT></DIV>
<DIV><FONT face=Courier size=2>CFLAGS += -I/home/ssl/include</FONT></DIV>
<DIV><FONT face=Courier size=2>LIBS += -L/home/ssl/lib</FONT></DIV>
<DIV><FONT face=Courier size=2>CONFIG_DRIVER_MADWIFI=y<BR>CFLAGS += 
-I/home/samples/madwifi-bsd</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In Makefile</FONT></DIV>
<DIV><FONT face=Courier size=2>CC=mipsel-linux-gcc</FONT></DIV>
<DIV><FONT face=Courier size=2>CFLAGS += -I../driver/modules -I../utils 
-I../hostapd-0.4.1 <BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In wpa_supplicant.conf:</FONT></DIV>
<DIV><FONT face=Courier 
size=2>ctrl_interface=/var/run/wpa_supplicant</FONT></DIV>
<DIV><FONT face=Courier size=2>ctrl_interface_group=0</FONT></DIV>
<DIV><FONT face=Courier 
size=2>network={<BR>&nbsp;ssid="MyWireless"<BR>&nbsp;key_mgmt=WPA-PSK<BR>&nbsp;#psk="secretpass"<BR>&nbsp;psk=f6ac76d5715d53a12af3f2b040b3f8ac7072a5c35d8fffe2589471796ddd3e5b<BR>&nbsp;priority=5<BR>&nbsp;pairwise=TKIP<BR>&nbsp;group=TKIP<BR>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Debug message from hostapd:</FONT></DIV>
<DIV><FONT face=Arial size=2>======================</FONT></DIV>
<DIV><FONT face=Courier size=2>Configuration file: hostapd.conf<BR>Configure 
bridge br0 for EAPOL traffic.<BR>madwifi_set_iface_flags: dev_up=0<BR>Using 
interface ath0 with hwaddr 00:0b:6b:34:88:d0 and ssid 
'MyWireless'<BR>madwifi_set_ieee8021x: enabled=1<BR>madwifi_configure_wpa: group 
key cipher=1<BR>madwifi_configure_wpa: pairwise key 
ciphers=0x2<BR>madwifi_configure_wpa: key management 
algorithms=0x2<BR>madwifi_configure_wpa: rsn 
capabilities=0x0<BR>madwifi_configure_wpa: enable WPA= 
0x1<BR>madwifi_set_iface_flags: dev_up=1<BR>ath0: creating bss 
00:0b:6b:34:88:d0<BR>br0: port 1(ath0) entering listening 
state<BR>madwifi_set_privacy: enabled=1<BR>WPA: group state machine entering 
state GTK_INIT<BR>GMK - hexdump(len=32): b3 28 78 33 46 4a bc 51 84 a9 a0 d4 ab 
27 37 78 32 b3 20<BR>35 f8 be 0a 97 29 5d dc 1d 2f ed 7f 63<BR>GTK - 
hexdump(len=32): 12 b8 93 d2 e2 33 2c 4b 0d 06 be e8 da 58 00 7c 9a 8c 09<BR>cc 
ae 8e e9 f5 91 71 7b 7b 41 ec 36 e8<BR>WPA: group state machine entering state 
SETKEYSDONE<BR>madwifi_set_key: alg=TKIP addr=00:00:00:00:00:00 
key_idx=1<BR>Flushing old station entries<BR>madwifi_sta_deauth: 
addr=ff:ff:ff:ff:ff:ff reason_code=3<BR>Deauthenticate all 
stations<BR>l2_packet_receive - recv: Network is down<BR>Wireless event: 
cmd=0x8c03 len=20<BR>ath0: STA 00:0b:6b:35:66:d1 IEEE 802.11: 
associated<BR>&nbsp; New STA<BR>ath0: STA 00:0b:6b:35:66:d1 WPA: event 1 
notification<BR>madwifi_sta_clear_stats: addr=00:0b:6b:35:66:d1<BR>ath0: STA 
00:0b:6b:35:66:d1 WPA: start authentication<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK 
entering state INITIALIZE<BR>madwifi_del_key: addr=00:0b:6b:35:66:d1 
key_idx=0<BR>ath0: STA 00:0b:6b:35:66:d1 IEEE 802.1X: unauthorizing 
port<BR>madwifi_set_sta_authorized: addr=00:0b:6b:35:66:d1 authorized=0<BR>WPA: 
00:0b:6b:35:66:d1 WPA_PTK_GROUP entering state IDLE<BR>WPA: 00:0b:6b:35:66:d1 
WPA_PTK entering state AUTHENTICATION<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK entering 
state AUTHENTICATION2<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK entering state 
INITPSK<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK entering state PTKSTART<BR>ath0: STA 
00:0b:6b:35:66:d1 WPA: sending 1/4 msg of 4-Way Handshake<BR>TX EAPOL - 
hexdump(len=113): 00 0b 6b 35 66 d1 00 0b 6b 34 88 d0 88 8e 02 03 00<BR>5f fe 00 
89 00 20 00 00 00 00 00 00 00 01 03 76 08 af c9 2d 79 c4 9e 3f 88 04 
48<BR>&nbsp;ad c4 66 4d 8b 7a c7 14 90 14 15 80 cb ed e0 5f 96 d0 66 00 00 00 00 
00 00 00 0<BR>0 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<BR>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<BR>ath0: STA 
00:0b:6b:35:66:d1 WPA: EAPOL-Key timeout<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK 
entering state PTKSTART<BR>ath0: STA 00:0b:6b:35:66:d1 WPA: sending 1/4 msg of 
4-Way Handshake<BR>TX EAPOL - hexdump(len=113): 00 0b 6b 35 66 d1 00 0b 6b 34 88 
d0 88 8e 02 03 00<BR>5f fe 00 89 00 20 00 00 00 00 00 00 00 02 03 76 08 af c9 2d 
79 c4 9e 3f 88 04 48<BR>&nbsp;ad c4 66 4d 8b 7a c7 14 90 14 15 80 cb ed e0 5f 96 
d0 66 00 00 00 00 00 00 00 0<BR>0 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<BR>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00<BR>ath0: STA 00:0b:6b:35:66:d1 WPA: EAPOL-Key timeout<BR>WPA: 
00:0b:6b:35:66:d1 WPA_PTK entering state PTKSTART<BR>ath0: STA 00:0b:6b:35:66:d1 
WPA: sending 1/4 msg of 4-Way Handshake<BR>TX EAPOL - hexdump(len=113): 00 0b 6b 
35 66 d1 00 0b 6b 34 88 d0 88 8e 02 03 00<BR>5f fe 00 89 00 20 00 00 00 00 00 00 
00 03 03 76 08 af c9 2d 79 c4 9e 3f 88 04 48<BR>&nbsp;ad c4 66 4d 8b 7a c7 14 90 
14 15 80 cb ed e0 5f 96 d0 66 00 00 00 00 00 00 00 0<BR>0 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<BR>00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00<BR>ath0: STA 00:0b:6b:35:66:d1 WPA: EAPOL-Key 
timeout<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK entering state PTKSTART<BR>ath0: STA 
00:0b:6b:35:66:d1 WPA: sending 1/4 msg of 4-Way Handshake<BR>TX EAPOL - 
hexdump(len=113): 00 0b 6b 35 66 d1 00 0b 6b 34 88 d0 88 8e 02 03 00<BR>5f fe 00 
89 00 20 00 00 00 00 00 00 00 04 03 76 08 af c9 2d 79 c4 9e 3f 88 04 
48<BR>&nbsp;ad c4 66 4d 8b 7a c7 14 90 14 15 80 cb ed e0 5f 96 d0 66 00 00 00 00 
00 00 00 0<BR>0 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<BR>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<BR>WPA: 
00:0b:6b:35:66:d1 WPA_PTK entering state DISCONNECT<BR>madwifi_sta_deauth: 
addr=00:0b:6b:35:66:d1 reason_code=2<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK entering 
state DISCONNECTED<BR>WPA: 00:0b:6b:35:66:d1 WPA_PTK entering state 
INITIALIZE<BR>madwifi_del_key: addr=00:0b:6b:35:66:d1 
key_idx=0<BR>ioctl[IEEE80211_IOCTL_DELKEY]: Invalid argument<BR>ath0: STA 
00:0b:6b:35:66:d1 IEEE 802.1X: unauthorizing port<BR>madwifi_set_sta_authorized: 
addr=00:0b:6b:35:66:d1 authorized=0<BR>ioctl[IEEE80211_IOCTL_SETMLME]: Invalid 
argument<BR>ath0: STA 00:0b:6b:35:66:d1 IEEE 802.11: deauthenticated due to 
local deauth req<BR>uest<BR>...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Debug message from wpa_supplicant:</FONT></DIV>
<DIV><FONT face=Arial size=2>============================</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face=Courier>Initializing interface 'ath0' 
conf 'wpa_supplicant.conf' driver 'madwifi'<BR>Configuration file 
'wpa_supplicant.conf' -&gt; '/home/wpa_supplicant.conf'<BR>Reading configuration 
file 
'/home/wpa_supplicant.conf'<BR>ctrl_interface='/var/run/wpa_supplicant'<BR>ctrl_interface_group=0<BR>Priority 
group 5<BR>&nbsp;&nbsp; id=0 ssid='MyWireless'<BR>Initializing interface (2) 
'ath0'<BR>EAPOL: SUPP_PAE entering state DISCONNECTED<BR>EAPOL: KEY_RX entering 
state NO_KEY_RECEIVE<BR>EAPOL: SUPP_BE entering state INITIALIZE<BR>EAP: EAP 
entering state DISABLED<BR>EAPOL: External notification - 
portEnabled=0<BR>EAPOL: External notification - 
portValid=0<BR>ioctl[SIOCSIWPMKSA]: Operation not supported<BR>br0: port 1(ath0) 
entering listening state<BR>br0: port 1(ath0) entering listening state<BR>Own 
MAC address: 00:0b:6b:35:66:d1<BR>wpa_driver_madwifi_del_key: 
keyidx=0<BR>wpa_driver_madwifi_del_key: keyidx=1<BR>wpa_driver_madwifi_del_key: 
keyidx=2<BR>wpa_driver_madwifi_del_key: 
keyidx=3<BR>wpa_driver_madwifi_set_countermeasures: 
enabled=0<BR>wpa_driver_madwifi_set_drop_unencrypted: enabled=1<BR>Setting scan 
request: 0 sec 100000 usec<BR>Wireless event: cmd=0x8b06 len=8<BR>RTM_NEWLINK, 
IFLA_IFNAME: Interface 'ath0' added<BR>RTM_NEWLINK, IFLA_IFNAME: Interface 
'ath0' added<BR>State: DISCONNECTED -&gt; SCANNING<BR>Starting AP scan 
(broadcast SSID)<BR>Wireless event: cmd=0x8b1a len=12<BR>Wireless event: 
cmd=0x8b19 len=12<BR>Received 763 bytes of scan results (5 BSSes)<BR>Scan 
results: 5<BR>Selecting BSS from priority group 5<BR>0: 00:0b:6b:34:88:d0 
ssid='MyWireless' wpa_ie_len=24 rsn_ie_len=0 caps=0x11<BR>&nbsp;&nbsp; 
selected<BR>Trying to associate with 00:0b:6b:34:88:d0 (SSID='MyWireless' 
freq=2457 MHz)<BR>Cancelling scan request<BR>Automatic auth_alg selection: 
0x1<BR>WPA: using IEEE 802.11i/D3.0<BR>WPA: Selected cipher suites: group 8 
pairwise 8 key_mgmt 2<BR>WPA: using GTK TKIP<BR>WPA: using PTK TKIP<BR>WPA: 
using KEY_MGMT WPA-PSK<BR>WPA: Own WPA IE - hexdump(len=24): dd 16 00 50 f2 01 
01 00 00 50 f2 02 01 00 00<BR>50 f2 02 01 00 00 50 f2 02<BR>No keys have been 
configured - skip key clearing<BR>wpa_driver_madwifi_set_drop_unencrypted: 
enabled=1<BR>State: SCANNING -&gt; 
ASSOCIATING<BR>wpa_driver_madwifi_associate<BR>Setting authentication timeout: 5 
sec 0 usec<BR>EAPOL: External notification - EAP success=0<BR>EAPOL: External 
notification - EAP fail=0<BR>EAPOL: External notification - 
portControl=Auto<BR>Wireless event: cmd=0x8b1a len=23<BR>Wireless event: 
cmd=0x8b15 len=20<BR>Wireless event: new AP: 00:0b:6b:34:88:d0<BR>State: 
ASSOCIATING -&gt; ASSOCIATED<BR>Association event - clear replay 
counter<BR>Associated to a new BSS: BSSID=00:0b:6b:34:88:d0<BR>No keys have been 
configured - skip key clearing<BR>Associated with 00:0b:6b:34:88:d0<BR>EAPOL: 
External notification - portEnabled=0<BR>EAPOL: External notification - 
portValid=0<BR>EAPOL: External notification - EAP success=0<BR>EAPOL: External 
notification - portEnabled=1<BR>EAPOL: SUPP_PAE entering state 
CONNECTING<BR>EAPOL: txStart<BR>WPA: drop TX EAPOL in non-IEEE 802.1X mode 
(type=1 len=0)<BR>EAPOL: SUPP_BE entering state IDLE<BR>EAP: EAP entering state 
INITIALIZE<BR>EAP: EAP entering state IDLE<BR>Setting authentication timeout: 10 
sec 0 usec<BR>Wireless event: cmd=0x8b15 len=20<BR>Wireless event: new AP: 
00:00:00:00:00:00<BR>Setting scan request: 0 sec 100000 usec<BR>Added BSSID 
00:0b:6b:34:88:d0 into blacklist<BR>State: ASSOCIATED -&gt; 
DISCONNECTED<BR>EAPOL: External notification - portEnabled=0<BR>EAPOL: SUPP_PAE 
entering state DISCONNECTED<BR>EAPOL: SUPP_BE entering state INITIALIZE<BR>EAP: 
EAP entering state DISABLED<BR>EAPOL: External notification - 
portValid=0<BR>EAPOL: External notification - EAP 
success=0<BR>CTRL-EVENT-DISCONNECTED - Disconnect event - remove 
keys<BR>...</FONT></DIV></FONT></BODY></HTML>