Re: Shared key authentication in iwconfig?

Elder Costa <evcosta.atmelan-y7mWNqJcIDpfJ/[email protected]> Wed, 10 Sep 2003 18:18:50 -0300
Newsgroups gmane.linux.drivers.atmel-wlan
Message-ID <[email protected]>
Jim Snyder wrote:
> I changed the initialization in vnet.c.
> 
> //jhs: static UCHAR AuthenticationType = C80211_MGMT_AAN_OPENSYSTEM;
> static UCHAR AuthenticationType = C80211_MGMT_AAN_SHAREDKEY;
> 
> I changed a couple other lines, but they probably aren't the key
> to the problem. (I suppose that qualifies as a pun.)
> 
> It'll be interesting to hear whether anyone has a better solution.
> I wonder why iwconfig doesn't support shared key authentication.
> I also wonder why the atmel pcmcia adaptor works with shared key
> authentication, but the USB adaptor doesn't. Perhaps the pcmcia
> code initializes as shared-key, while the usb code doesn't?
> 
> 
> 

The code in vnetusba.c (and probably in its pcmcia counter part) never
sets shared key as it was supposed to do, at least from my understanding
of the man pages, when ones includes "restricted" keywork on encryption
configuration. The attached patch seems to solve it. I performed some
very quick tests after modifying the code and it worked with both open
and rescricted setups. I will forward it to the driver maintainer with
some other suggestions.

Regards.

Elder.
vnetusba.diff (text/plain, 474 B)
--- vnetusba.c.ORIG	Mon Jun  9 05:45:40 2003
+++ vnetusba.c	Wed Sep 10 17:43:15 2003
@@ -698,7 +698,11 @@
 			Adapter->WepInfo.AuthenticationType =
 			    C80211_MGMT_AAN_OPENSYSTEM;
 		if (wrq->u.data.flags & IW_ENCODE_RESTRICTED)
+		{
 			Adapter->WepInfo.ExcludeUnencrypted = WEP_MODE_MANDATORY;
+			Adapter->WepInfo.AuthenticationType =
+			    C80211_MGMT_AAN_SHAREDKEY;
+		}
 		if ((wrq->u.data.length != 5)
 		    && (wrq->u.data.length != 13))
 			return -EINVAL;