Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 116714 - wpa_supplicant 0.5.0 apparently fails to set wep key ?
Summary: wpa_supplicant 0.5.0 apparently fails to set wep key ?
Status: VERIFIED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-25 10:36 UTC by Stefano
Modified: 2006-04-14 20:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefano 2005-12-25 10:36:58 UTC
Hi, I'm using gentoo-sources-2.6.14-r5, ipw2100-1.1.3 (because the ipw driver in gentoo-sources has a lot of troubles), and wpa_supplicant 0.5.0 (updated to the ~x86 version in order to make it work, since the x86 version doesn't).

When associating to a WEP AP, wpa_supplicant apparently fails to set the encryption mode.

The relevant config block is:
network={
        ssid="RaistWLAN"
        key_mgmt=NONE
        auth_alg=OPEN
        group=WEP104
        wep_key0=<key in hex format, omitted ;-)>
        wep_tx_keyidx=0
        priority=5
}

emerge info:
raistmobile ~ # emerge info
Portage 2.0.53 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r2, 2.6.14-gentoo-r5 i686)
=================================================================
System uname: 2.6.14-gentoo-r5 i686 Intel(R) Pentium(R) M processor 1500MHz
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium3 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium3 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ http://pandemonium.tiscali.de/pub/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 X acl acpi alsa amuled aqua_theme arts async atlas audiofile avantgo avi bash-completion berkdb bindist bitmap-fonts bluetooth bzip2 cardbus cdparanoia cdr cpudetection crypt css cups curl curlwrappers devfs26 devmap dga dhcp dio directfb divx4linux djbfft dlloader dpms dri dvb dvd encode ethereal exif expat fat fbcon fbsplash ffmpeg fftw flac foomaticdb fortran fpx ftp gd gdbm gif glut glx gnutls gphoto2 gpm gs gssapi gtk gtk2 gzip hpn icq idea idn imagemagick imap imlib ipv6 irda jabber java javascript jikes john jp2 jpeg jpeg2k kde kdepim kerberos krb4 lapack lcms ldap lesstif libg++ libwww mad mbox messages mikmod mime mmap mmx mmxext mng motif mozilla mozsvg mp3 mpeg mppe-mppc msn mysql mysqli ncurses nls nocd nomalloccheck nptl nptlonly ntfs ntlm octave odbc offensive ogg oggvorbis opengl oscar oss pam pcapnav pcmcia pcntl pcre pda pdflib perl plotutils png pnp posix ppds python qt quicktime radius rdesktop readline real samba sasl sdl sharedmem silc slp sms snmp sockets sox spell sse ssl svga sysfs sysvipc tcltk tcpd tetex threads tiff truetype truetype-fonts type1 type1-fonts udev unicode usb v4l v4l2 vcd vorbis wifi win32codecs winbind wmf xchattext xml xml2 xmlrpc xmms xv xvid yahoo zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 1 Henrik Brix Andersen 2005-12-26 16:15:41 UTC
(In reply to comment #0)
> When associating to a WEP AP, wpa_supplicant apparently fails to set the
> encryption mode.

There is nothing in this bug report which indicates that wpa_supplicant fails to set the WEP key. Please reopen once you've provided more information.
Comment 2 Stefano 2005-12-27 03:02:14 UTC
cough. I don't know how to show you that this happens, however:

Starting up wpa_supplicant:
# /etc/init.d/net.eth1 start
 * Starting eth1
 *   Running preup function
 *   Starting wpa_supplicant on eth1 ...
Initializing interface 'eth1' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group=0
eapol_version=1
ap_scan=1
Line: 9 - start of a new network block
ssid - hexdump_ascii(len=9):
     52 61 69 73 74 57 4c 41 4e                        RaistWLAN
key_mgmt: 0x4
auth_alg: 0x1
group: 0x4
wep_key0 - hexdump(len=13): [REMOVED]
wep_tx_keyidx=0 (0x0)
priority=5 (0x5)
Line: 19 - start of a new network block
ssid - hexdump_ascii(len=10):
     73 6e 5f 77 6c 61 6e 5f 61 70                     sn_wlan_ap
proto: 0x1
key_mgmt: 0x2
pairwise: 0x8
group: 0x8
PSK (ASCII passphrase) - hexdump_ascii(len=33): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 5
   id=0 ssid='RaistWLAN'
Priority group 0
   id=1 ssid='sn_wlan_ap'
Initializing interface (2) 'eth1'
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
SIOCGIWRANGE: WE(compiled)=19 WE(source)=16 enc_capa=0x0
 capabilities: key_mgmt 0x0 enc 0x3
Own MAC address: 00:04:23:83:1f:97
wpa_driver_wext_set_wpa
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_countermeasures
wpa_driver_wext_set_drop_unencrypted
Setting scan request: 0 sec 100000 usec
Using existing control interface directory.
Added interface eth1
Daemonize..                                                               [ ok ]
 *     eth1 connected to "RaistWLAN" at CE:NS:OR:ED:00
 *   Bringing up eth1
 *     192.168.XXX.Y/24                                                   [ ok ]
 *   Adding routes
 *     default gw 192.168.XXX.ZZZ ...                                     [ ok ]
raistmobile ~ # iwconfig

eth1      IEEE 802.11b  ESSID:"RaistWLAN"  Nickname:"ipw2100"
          Mode:Managed  Frequency:2.437 GHz  Access Point: CE:NS:OR:ED:00
          Bit Rate=11 Mb/s   Tx-Power:off
          Retry min limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=100/100  Signal level=-46 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

While as you may see in the config above, the key is set.

If I manually set the key AFTER starting wpa_supplicant everything works.

Is this a proof enough ? ;-) Sorry for having been hermetic.
Comment 3 Henrik Brix Andersen 2006-01-02 06:54:28 UTC
I can not debug any of this if you continue to provide this little information.

Please provide unmodified output of running wpa_supplicant manually along with your wpa_supplicant.conf file. If you don't feel like providing your real configuration details create a minimal test setup use that for the report.
Comment 4 Stefano 2006-01-02 07:12:13 UTC
(In reply to comment #3)
> I can not debug any of this if you continue to provide this little  information.

Well...

> Please provide unmodified output of running wpa_supplicant 

You have it right above. I just removed my AP hardware address. Is this a bother to you ?

> manually along with
> your wpa_supplicant.conf file. 

You didn't ask for it, and it is included almost line-by-line in debug output, however:

# cat /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

network={
        ssid="RaistWLAN"
        key_mgmt=NONE
        auth_alg=OPEN
        group=WEP104
        wep_key0=<KEY REMOVED BY ME>
        wep_tx_keyidx=0
        priority=5
}

The only editing has been done to remove my key from wpa_supplicant.conf, and my AP hardware address above. Frankly, I don't see a reason for your unfriendly answer. But anybody is granted a right to be nervous at times :)
Comment 5 Stefano 2006-01-02 07:30:05 UTC
Additional note, because perhaps I didn't make myself completely clear: if I manually run wpa_supplicant -ieth1 -Dwext -c/etc/wpa_supplicant.conf the interface is correctly configured.

The issue appears when I run it from within /etc/init.d/net.eth1 start, using:

modules_eth1=( "wpa_supplicant" )
wpa_supplicant_eth1="-Dwext -B -dd"
wpa_timeout_eth1=60

Sorry if the fact I was using the startup scripts to launch it was not really clear.
Comment 6 Henrik Brix Andersen 2006-01-02 08:22:41 UTC
(In reply to comment #5)
> Additional note, because perhaps I didn't make myself completely clear: if I
> manually run wpa_supplicant -ieth1 -Dwext -c/etc/wpa_supplicant.conf the
> interface is correctly configured.

Reassigning to Roy, then.

Comment 7 Roy Marples (RETIRED) gentoo-dev 2006-01-02 08:39:15 UTC
You're using the stable baselayout-1.11 series - does it work using 1.12.0_pre12?
Comment 8 Stefano 2006-01-02 08:56:27 UTC
Just upgraded (duh). Same weird behavior as above.

Comment 9 Roy Marples (RETIRED) gentoo-dev 2006-01-02 09:09:22 UTC
Just use this wpa_supplicant config

wpa_supplicant_eth1="-Dwext"
Comment 10 Stefano 2006-01-02 09:15:34 UTC
(In reply to comment #9)
> Just use this wpa_supplicant config
> 
> wpa_supplicant_eth1="-Dwext"

Same as above. Just FYI:
# ps aux | grep wpa
root     26286  0.0  0.1   3152   844 ?        Ss   18:14   0:00 /sbin/wpa_supplicant -Dwext -c/etc/wpa_supplicant.conf -W -P/var/run/wpa_supplicant-eth1.pid -B -ieth1
root     26295  0.0  0.0   2024   396 ?        Ss   18:14   0:00 /bin/wpa_cli -a/sbin/wpa_cli.action -ieth1 -P/var/run/wpa_cli-eth1.pid -B
root     26773  0.0  0.1   1640   488 pts/2    R+   18:14   0:00 grep wpa
Comment 11 Roy Marples (RETIRED) gentoo-dev 2006-01-02 23:35:14 UTC
Try running it manually with those flags with the flags -W and -B.
If you use the -W flag then you have to launch wpa_cli otherwise wpa_supplicant won't associate as it's waiting for wpa_cli.
Comment 12 Stefano 2006-01-03 02:34:02 UTC
OK, the problem is larger than I thought. In fact, even running manually, the key is not set (contrary to what I said above in comment #5):

----------
# wpa_supplicant -ieth1 -Dwext -c/etc/wpa_supplicant.conf -dd

Initializing interface 'eth1' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A'
Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group=0
eapol_version=1
ap_scan=1
Line: 9 - start of a new network block
ssid - hexdump_ascii(len=9):
     52 61 69 73 74 57 4c 41 4e                        RaistWLAN
key_mgmt: 0x4
auth_alg: 0x1
group: 0x4
wep_key0 - hexdump(len=13): [REMOVED]
wep_tx_keyidx=0 (0x0)
priority=5 (0x5)
Line: 19 - start of a new network block
ssid - hexdump_ascii(len=10):
     73 6e 5f 77 6c 61 6e 5f 61 70                     sn_wlan_ap
proto: 0x1
key_mgmt: 0x2
pairwise: 0x8
group: 0x8
PSK (ASCII passphrase) - hexdump_ascii(len=33): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
Priority group 5
   id=0 ssid='RaistWLAN'
Priority group 0
   id=1 ssid='sn_wlan_ap'
Initializing interface (2) 'eth1'
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
SIOCGIWRANGE: WE(compiled)=19 WE(source)=16 enc_capa=0x0
  capabilities: key_mgmt 0x0 enc 0x3
Own MAC address: 00:04:23:83:1f:97
wpa_driver_wext_set_wpa
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_countermeasures
wpa_driver_wext_set_drop_unencrypted
Setting scan request: 0 sec 100000 usec
Added interface eth1
Wireless event: cmd=0x8b06 len=8
RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added
RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added
State: DISCONNECTED -> SCANNING
Starting AP scan (broadcast SSID)
Wireless event: cmd=0x8b15 len=20
Wireless event: new AP: 00:0f:3d:e0:c9:fb
State: SCANNING -> ASSOCIATED
Associated to a new BSS: BSSID=00:0f:3d:e0:c9:fb
No keys have been configured - skip key clearing
Network configuration found for the current AP
WPA: clearing AP WPA IE
WPA: clearing AP RSN IE
WPA: clearing own WPA/RSN IE
EAPOL: External notification - portControl=ForceAuthorized
Associated with 00:0f:3d:e0:c9:fb
WPA: Association event - clear replay counter
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
EAPOL: External notification - portEnabled=1
EAPOL: SUPP_PAE entering state S_FORCE_AUTH
EAPOL: SUPP_BE entering state IDLE
Cancelling authentication timeout
State: ASSOCIATED -> COMPLETED
CTRL-EVENT-CONNECTED - Connection to 00:0f:3d:e0:c9:fb completed (auth)
RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added
Scan timeout - try to get results
Received 182 bytes of scan results (1 BSSes)
Scan results: 1
Selecting BSS from priority group 5
0: 00:0f:3d:e0:c9:fb ssid='RaistWLAN' wpa_ie_len=0 rsn_ie_len=0 caps=0x11
   skip - no WPA/RSN IE
   selected non-WPA AP 00:0f:3d:e0:c9:fb ssid='RaistWLAN'
Already associated with the selected AP.
----------

Tried with -B and -W, but no change (except for demonizing, and waiting for the cli... but the key still is not set). This time I didn't edit out MAC addresses, so if brix needs to chime in he can do so :-)
Comment 13 Roy Marples (RETIRED) gentoo-dev 2006-01-04 03:05:15 UTC
(In reply to comment #12)
> OK, the problem is larger than I thought. In fact, even running manually, the
> key is not set (contrary to what I said above in comment #5):

Not a baselayout bug then, re-assigning to mobile.
Comment 14 Stefano 2006-01-04 04:42:51 UTC
BTW: just tried a connection to a WPA network, works like a charm (also with the init scripts). So the problem is just on WEP.
Comment 15 Henrik Brix Andersen 2006-01-11 08:25:56 UTC
(In reply to comment #14)
> BTW: just tried a connection to a WPA network, works like a charm (also with
> the init scripts). So the problem is just on WEP.

I have spent this afternoon doing a thorough test of WEP along with wpa_supplicant-0.5.0, and can not reproduce your problem.

As there is not much more I can do, please report this upstream.
Comment 16 Stefano 2006-01-30 05:45:20 UTC
Here is the mail I received back from Jouni Malinen:

"The last debug log in that case seems to be showing the driver reporting
association before the scan results are received. This seems to cause
wpa_supplicnat not to configure static WEP keys. 

The Intel driver is somewhat too eager (IMHO) to associate with random
networks, so I would recommend testing this by first setting the SSID to
something unused with iwconfig (e.g., "iwconfig eth1 essid not-in-use")
and then starting wpa_supplicant. Please also test this with ap_scan=2
mode instead of ap_scan=1 to avoid the issue  with scan results not
being received from the driver early enough."

The first suggestion did not work, while the second one (setting ap_scan=2) fixed my problem flawlessly. So this bug can be closed for me :)
Comment 17 Ricardo 2006-04-13 13:38:33 UTC
I get the same problems, but I'm using the hostap driver instead.  Please check my posting on the forums at: http://forums.gentoo.org/viewtopic-t-451917.html

I've tried the suggestions at the end of this thread, but to no avail: iwconfig wlan0 essid testing does not set or change the essid for wlan0, and setting ap_scan to 2 or 0 causes wpa_supplicant not to associate with any network at all, not even net1 or net4 (see the forum post cited above), which require no authentication.  My version of wpa_supplicant is 0.5.2

I don't suppose anyone has an idea of what I should do?  This issue has been affecting me for weeks now.

-Ricardo-
Comment 18 Ricardo 2006-04-14 20:01:01 UTC
I have solved this matter in my own way, not mentioned here in this bug report.  For more information, see my latest post in the forum thread mentioned in Comment #17.

-Ricardo-