programming question for wpa_supplicant driver

Holger Schurig hs4233
Wed Mar 2 04:37:47 PST 2005


I'm in the process of writing a driver_hermes.c for wpa_supplicant from 
current CVS which does not depend on the (very awkward) sources for the 
hermes wlags49 driver.

By doing this, I'm going from simple to complex. Now, a static wep key 
seems simpley enought. Unfortunately, it doesn't work. Can wpa_supplicant 
also "enter" the WEP keys for me?


My wpa.conf looks like this:

------------------------------------------
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
        ssid="MYWLAN2"
        key_mgmt=NONE
        wep_key0="mykey12345678"
        wep_tx_keyidx=0
}
------------------------------------------

Before starting wpa_supplicant, my interface is up, but no WEP key and no 
association is there:

------------------------------------------
eth1      IEEE 802.11b  ESSID:""  Nickname:"MNCI"
          Frequency:2.457 GHz  Access Point: 44:44:44:44:44:44   Bit 
Rate=11.5343 Mb/s
          Tx-Power=off   Sensitivity:1/3
          RTS thr:off
          Encryption key:off
          Power Management:off
          Link Quality=0/92  Signal level=-102 dBm  Noise level=-102 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
------------------------------------------

Now I start wpa_supplicant:

...
Jan 02 01:54:59.760217: EAPOL: SUPP_PAE entering state DISCONNECTED
Jan 02 01:54:59.760500: EAPOL: KEY_RX entering state NO_KEY_RECEIVE
Jan 02 01:54:59.760576: EAPOL: SUPP_BE entering state INITIALIZE
Jan 02 01:54:59.760697: EAP: EAP entering state DISABLED
Jan 02 01:54:59.761303: EAPOL: External notification - portEnabled=0
Jan 02 01:54:59.761684: EAPOL: External notification - portValid=0
Jan 02 01:54:59.762046: wpa_driver_hermes_init: eth1
Jan 02 01:54:59.819448: found Hermes 2 STA
Jan 02 01:54:59.819969: Own MAC address: 00:10:c6:30:9b:fe
Jan 02 01:54:59.820164: wpa_driver_hermes_set_wpa: enabled=1
Jan 02 01:54:59.820414: wpa_driver_hermes_set_key: alg=none key_idx=0 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:54:59.820704: wpa_driver_hermes_set_key: alg=none key_idx=1 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:54:59.820913: wpa_driver_hermes_set_key: alg=none key_idx=2 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:54:59.821114: wpa_driver_hermes_set_key: alg=none key_idx=3 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:54:59.821307: wpa_driver_hermes_set_countermeasures: enabled=0
Jan 02 01:54:59.824487: wpa_driver_hermes_set_drop_unencrypted: enabled=1
Jan 02 01:54:59.825001: Setting scan request: 0 sec 100000 usec
Jan 02 01:54:59.826228: Wireless event: cmd=0x8b06 len=8
Jan 02 01:54:59.826511: unhandled
Jan 02 01:54:59.930072: State: DISCONNECTED -> SCANNING
Jan 02 01:54:59.930243: Starting AP scan (broadcast SSID)
Jan 02 01:55:01.035435: Wireless event: cmd=0x8b19 len=12
Jan 02 01:55:01.036959: Received 4096 bytes of scan results (2 BSSes)
Jan 02 01:55:01.037212: Scan results: 2
Jan 02 01:55:01.037316: Selecting BSS from priority group 0
Jan 02 01:55:01.037429: 0: 00:12:7f:8b:62:30 ssid='MYWLAN2' wpa_ie_len=0 
rsn_ie_len=0
Jan 02 01:55:01.037529:    skip - no WPA/RSN IE
Jan 02 01:55:01.037613: 1: 00:02:2d:a6:1b:ca ssid='MYWLAN1' wpa_ie_len=0 
rsn_ie_len=0
Jan 02 01:55:01.037701:    skip - no WPA/RSN IE
Jan 02 01:55:01.037880:    selected non-WPA AP 00:12:7f:8b:62:30 
ssid='MYWLAN2'

  Fine. Now it selects on of the access points, MYWLAN2 with a weird
  frequency. Is 0 MHz correct?

Jan 02 01:55:01.038060: Trying to associate with 00:12:7f:8b:62:30 
(SSID='MYWLAN' freq=0 MHz)
Jan 02 01:55:01.038190: Cancelling scan request
Jan 02 01:55:01.038289: Automatic auth_alg selection: 0x1
Jan 02 01:55:01.038402: No keys have been configured - skip key clearing
Jan 02 01:55:01.038514: wpa_driver_hermes_set_key: alg=WEP key_idx=0 
set_tx=1 seq_len=0 key_len=13

   Looks like it enters the static WEP key ?!?

Jan 02 01:55:01.038641: wpa_driver_hermes_set_drop_unencrypted: enabled=1
Jan 02 01:55:01.038915: State: SCANNING -> ASSOCIATING
Jan 02 01:55:01.039077: wpa_driver_hermes_associate

   Here it tries to associate. But note: the my current driver (wlags49
   7.18, 7.22 had compilation problems) doesn't support any *_set_bssid()
   like IOCTL, i.e. not the SIOCGIWAP ioctl that driver_wext uses and
   exports. Not sure if this is a problem.

Jan 02 01:55:01.039161: wpa_driver_hermes_set_wpa_ie
Jan 02 01:55:01.049764: Setting authentication timeout: 5 sec 0 usec
Jan 02 01:55:01.050040: EAPOL: External notification - 
portControl=ForceAuthorized
Jan 02 01:55:01.050668: Wireless event: cmd=0x8b04 len=12
Jan 02 01:55:01.050869: unhandled

   The "unhandled" text is some debug message from me. Apart from this,
   nothing from current CVS head has been changed. 8b04 is the IOCTL for
   SIOCSIWFREQ "set channel/frequency (Hz)".

Jan 02 01:55:01.050983: Wireless event: cmd=0x8b1a len=19
Jan 02 01:55:01.051075: unhandled
   This is SIOCSIWESSID "set ESSID (network name)"

Jan 02 01:55:06.050134: Authentication with 00:00:00:00:00:00 timed out.

  But somehow the association got wrong?  I never asked or wanted
  to associate with 00:00:00:00:00:00. Which event/function should
  have been called in order to mark the association as "working"?

Jan 02 01:55:06.050531: State: ASSOCIATING -> DISCONNECTED
Jan 02 01:55:06.050630: wpa_driver_hermes_set_key: alg=none key_idx=0 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:55:06.050935: wpa_driver_hermes_set_key: alg=none key_idx=1 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:55:06.051188: wpa_driver_hermes_set_key: alg=none key_idx=2 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:55:06.051433: wpa_driver_hermes_set_key: alg=none key_idx=3 
set_tx=0 seq_len=0 key_len=0
Jan 02 01:55:06.051663: EAPOL: External notification - portEnabled=0
Jan 02 01:55:06.052026: EAPOL: External notification - portValid=0

   Now the same log as above will be repeated.



While this happens, I cannot ping the device.

If I do, instead of starting wpa_supplicant, issue the command "iwconfig 
eth1 mykey12345678" by hand, then everything works and I can ping my 
device.




More information about the Hostap mailing list