Bug 21245

Summary: [PATCH] wicontrol(8)'s WEP key support is buggy/non-standard
Product: Base System Reporter: brooks <brooks>
Component: binAssignee: Bill Paul <wpaul>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description brooks 2000-09-13 05:40:02 UTC
wicontrol's WEP support has a number of minor bugs in it due to coding
errors and apparent misunderstandings of WEP.  They include:

a) So called, 128-bit crypto uses 13 byte (104-bit) keys.  Saying cards
support 40 and 128-bit crypto is a misnomer perpetuated by marketing
people.  40-bit crypto actually encrypts with 64-bit RC4 on each packet,
but the key is 40-bits long.  128-bit crypto encrypts packets with
128-bit RC4, but uses a 104-bit key so to compare apples to apples cards
really support 64/128 or 40/104.  The manpage and the code have been
cleaned up to reflect that fact that keys come in 0, 5, and 13 byte
lengths and the code now enforces this just like the Windows interface
does for this an the Cisco Aironet cards.

b) You couldn't enter 13 byte keys via the hex format because they were
longer then 14 bytes in string format.

c) The output of the keys was unreable if they were non-printable.
Printable keys (as defined by isprint) are now printed in like
before, but non-printable keys are printed in hex.

Fix: Apply this patch.  It has been tested in infrastucture mode with a Cisco
Aironet 340 series Access Point and a Lucent Gold card.
How-To-Repeat: 
b) Try to set a key like 0x12345678901234567890123456.
	wicontrol -i wi0 -k 0x12345678901234567890123456

c) Try to set and read back a hex key like 0x0123456789.
	wicontrol -i wi0 -k 0x0123456789
	wicontrol -i wi0
Comment 1 Johan Karlsson freebsd_committer freebsd_triage 2000-09-16 12:24:04 UTC
Responsible Changed
From-To: freebsd-bugs->wpaul

Over to wi(4) / wicontrol(8) maintainer.
Comment 2 Bill Paul freebsd_committer freebsd_triage 2000-09-21 01:27:16 UTC
State Changed
From-To: open->closed

Patch applied to -current and -stable (with one minor tweak, errx() instead 
of err()).