Modify

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#6491 closed defect (fixed)

mac80211-based drivers cannot connect to WEP encrypted AP

Reported by: Stijn Tintel <stijn@…> Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

It's not possible to connect to WEP encrypted APs with mac80211-based drivers.

I configured a test AP with WEP:
key1: 1111111111
key2: 2222222222
key3: 3333333333
key4: 4444444444

With the madwifi driver, I was able to connect with:

option key 1111111111

and

option key 1
option key1 1111111111
option key2 2222222222
option key3 3333333333
option key4 4444444444

So both ways, as documented at http://wiki.openwrt.org/oldwiki/openwrtdocs/kamikazeconfiguration, seem to work for the madwifi driver.

Unfortunately neither ways work with mac80211 based drivers. This is because of a logical error in mac80211.sh.

On https://dev.openwrt.org/browser/trunk/package/mac80211/files/lib/wifi/mac80211.sh#L172, the comment says iw will be used when keymgmt = ''. On L245 however, iw will only be used if the length of keymgmt is non-zero - exactly the opposite.

In addition, on L181, the keystring variable will only be set if the length of keymgmt is non-zero, but as this variable is used by iw, it should again be the opposite.

Also, with iw, we need to prefix the default TX key with "d:". Afaik, this is also needed when using a single key.

Attachments (3)

mac80211-fix-iw-wep-in-station-mode.diff (1.8 KB) - added by Stijn Tintel <stijn@…> 8 years ago.
This patch fixes connecting to WEP encrypted AP's with mac80211 based drivers and iw.
mac80211-fix-iw-wep-in-station-mode.2.diff (1.7 KB) - added by Stijn Tintel <stijn@…> 8 years ago.
Updated version of previous patch: forgot to remove irrelevant line.
mac80211-fix-iw-wep-in-station-mode2.diff (2.5 KB) - added by Stijn Tintel <stijn@…> 8 years ago.
This patch fixes connecting to WEP encrypted AP's with mac80211 based drivers and iw. It adds a new procedure prepare_key_wifi to convert ASCII keys to HEX key where necessary, as suggested by xMff.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Stijn Tintel <stijn@…>

This patch fixes connecting to WEP encrypted AP's with mac80211 based drivers and iw.

comment:1 Changed 8 years ago by Stijn Tintel <stijn@…>

The changes I made are mostly based on the way things are handled in madwifi.sh, including a few minor changes to make both files a little more consistent.

Changed 8 years ago by Stijn Tintel <stijn@…>

Updated version of previous patch: forgot to remove irrelevant line.

Changed 8 years ago by Stijn Tintel <stijn@…>

This patch fixes connecting to WEP encrypted AP's with mac80211 based drivers and iw. It adds a new procedure prepare_key_wifi to convert ASCII keys to HEX key where necessary, as suggested by xMff.

comment:2 Changed 8 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Committed in r19118 - thanks!

comment:3 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.