Is wep_key0 supposed to work as a string?

Dan Williams dcbw
Mon Jan 10 18:43:10 PST 2011


On Mon, 2011-01-10 at 16:18 -0800, Ben Greear wrote:
> I was trying to run hostapd on an ath5k system with
> WEP enabled.
> 
> wep_default_key=0
> wep_key0="ddd123"
> 
> Fails to set the key it seems, and I don't see anywhere
> that converts the string to hex in the code:

Right, because your WEP key is not a WEP key.  It's 6 characters long,
which is invalid.  If it's an ASCII WEP key, it needs to be either 5 or
13 ASCII characters long, and quoted.  If it's a hex WEP key, it needs
to be either 10 or 26 hex characters and unquoted.

Since there is no standard WEP passphrase hashing algorithm (the
MD5-based one that most APs use is not standard, and older Apple Airport
APs use a different hashing mechanism) the supplicant does not implement
WEP passphrase hashing at all.  Just ASCII (quoted, 5 or 13) or hex
(unquoted, 10 or 26).

Dan

> wpa_driver_nl80211_set_key: ifindex=19 alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
> wpa_driver_nl80211_set_key: ifindex=19 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
> wpa_driver_nl80211_set_key: ifindex=19 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
> wpa_driver_nl80211_set_key: ifindex=19 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
> wpa_driver_nl80211_set_key: ifindex=19 alg=1 addr=(nil) key_idx=0 set_tx=1 seq_len=0 key_len=6
> nl80211: set_key failed; err=-22 Invalid argument)
> Could not set WEP encryption.
> vap0: Unable to setup interface.
> Flushing old station entries
> Deauthenticate all stations
> rmdir[ctrl_interface]: No such file or directory
> nl80211: Remove interface ifindex=36
> 
> 
> If I use hex instead:
> 
> wep_key0=123456789a
> 
> it seems to work fine.
> 
> 
> Thanks,
> Ben
> 





More information about the Hostap mailing list