# troubles with wpa_supplicant and 128bit WEP keys [SOLVED]

## mspiegle

I have my wireless access point configured to use 128bit WEP keys (26 hex digits).

I have wpa_supplicant running pretty smoothly for unprotected access points and a WPA-enabled airport at my girlfriend's place.  The only problem is when connecting to the access point at work... If I use the full hex wep key (26 digits) in the /etc/wpa_supplicant.conf config file, it errors and says that the wep key is too long (via debugging info).  That didn't make any sense to me, so I went sorting through the source code and the MAX_WEP_KEY length is specified to be 16 (anything longer will spit out the error).

So... am I missing something here?  Is 128bit not supported?

/etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wireless

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="Jonathan"

        scan_ssid=1

        key_mgmt=NONE

}

network={

        ssid="waves"

        key_mgmt=NONE

}

network={

        ssid="jimfig"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        group=CCMP TKIP WEP104 WEP40

        pairwise=TKIP CCMP

        psk="********"

}

#network={

#       ssid="affwire"

#       key_mgmt=NONE

#       wep_key0="622b42542455542cc4c62d0ba6"

#}

EDIT: I'd also like to add that i'm using the ipw2200 driver for a 2915ABG card.Last edited by mspiegle on Tue Jul 12, 2005 4:38 pm; edited 1 time in total

----------

## mspiegle

Here is the exact error message.  I don't get errors if I comment out the wep_key0 line and set it manually via iwconfig.  The WEP key is correct - i've checked it many times.  It is exactly 26 characters which is proper for a 128bit WEP key.

asus ~ # /etc/init.d/net.eth1 start

 * Starting eth1

 *   Loading networking modules for eth1

 *     modules: wpa_supplicant essidnet iptunnel ifconfig dhcpcd apipa

 *       wpa_supplicant provides wireless

 *       ifconfig provides interface

 *       dhcpcd provides dhcp

 *   Starting wpa_supplicant on eth1 ...

Line 31: Too long WEP key 0 '"622B42542455542CC4C62D0BA6'.

Line 31: failed to parse wep_key0 '"622B42542455542CC4C62D0BA6'.

Line 35: failed to parse network block.

Failed to read configuration file '/etc/wpa_supplicant.conf'.             [ !! ]

asus ~ #

----------

## UberLord

Try removing the quotes surrounding it. IIRC the quotes tell wpa_supplicant that it's a string to be converted to a hex key, whereas no quotes means it's a straight hex key

----------

## mspiegle

 *UberLord wrote:*   

> Try removing the quotes surrounding it. IIRC the quotes tell wpa_supplicant that it's a string to be converted to a hex key, whereas no quotes means it's a straight hex key

 

WOW, I can't believe it was that simple.  I don't seem to have wireless anymore, but I think its because I messed up the driver/firmware which I should be able to figure out on my own.

THANK YOU UberLord... Your name definately serves you well.

----------

## mspiegle

OK, I now have everything working with WEP104 / 128bit WEP.  As soon as my laptop is booted, it associated with the AP, set the key, and got a dhcp lease.  I'm going to assume this works with WPA too since it did before - but i'll make mention here if it doesn't.  Also, the last thing is to ensure that my laptop will auto-associate with hidden-ssid APs.  I'll also make mention if it doesn't work.  Here are my configs:

asus ~ # cat /etc/conf.d/net

# /etc/conf.d/net:

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

config_eth0=( "dhcp" )

dhcpcd_eth0=( "-R -t 10" )

config_eth1=( "dhcp" )

dhcpcd_eth1=( "-R -t 10" )

modules_eth1=( "wpa_supplicant" )

wpa_supplicant_eth1="-Dipw"

wpa_timeout_eth1=15

asus ~ # cat /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wireless

eapol_version=1

ap_scan=1

fast_reauth=1

network={

        ssid="Jonathan"

        scan_ssid=1

        key_mgmt=NONE

}

network={

        ssid="waves"

        key_mgmt=NONE

}

network={

        ssid="jimfig"

        scan_ssid=1

        proto=WPA

        key_mgmt=WPA-PSK

        group=CCMP TKIP WEP104 WEP40

        pairwise=TKIP CCMP

        psk="[removed]"

}

network={

        ssid="affwire"

        key_mgmt=NONE

        wep_key0=[removed] #DO NOT USE QUOTES AROUND THE HEX KEY

}

versions:

wpa_supplicant: 0.3.8

ipw2200: 1.0.3

ipw2200-firmware: 2.2

----------

