netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Dan Williams <dcbw@redhat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	netdev@vger.kernel.org, Jouni Malinen <jkm@devicescape.com>
Subject: Re: Problem authenticating using WPA with bcm43xx-softmac
Date: Wed, 07 Jun 2006 13:12:51 -0500	[thread overview]
Message-ID: <44871723.3040803@lwfinger.net> (raw)
In-Reply-To: <1149701352.2625.20.camel@localhost.localdomain>

Dan Williams wrote:
> On Wed, 2006-06-07 at 17:57 +0200, Johannes Berg wrote:
>> On Wed, 2006-06-07 at 17:51 +0200, Johannes Berg wrote:
>>
>>> Well, it should be shown in the 802.11i spec too.
>> I suppose that it is the association request, and needs to contain the
>> RSN described in 7.3.2.25 as per 7.2.3.4 in 802.11i. This is, afaik, the
>> 'generic IE' that is added with the wext. Now, it looks like the RSN
>> isn't included but the WPA2 info or something? Also, the genIE in your
>> log doesn't look correct to me, starting with ffffff?? Jouni, do you
>> have any idea what might be going on?
> 
> I believe that wpa_supplicant tells the driver what genie to use through
> the SIOCSIWGENIE wext call.  The IEs match between what the driver
> appears to be reporting, and what wpa_supplicant says from the logs.
> wpa_supplicant is almost certainly writing the correct IE to the driver
> through wext, so I think the debug output from softmac must be
> formatting the string incorrectly when printing it out to the logs.
> 
> Looking at it further:
> 
> struct ieee80211softmac_wpa {
>         char *IE;
>         int IElen;
>         int IEbuflen;
> };
> 
> from ieee80211softmac_wx.c: ieee80211softmac_wx_set_genie()
> 
>                 memcpy(mac->wpa.IE, extra, wrqu->data.length);
>                 dprintk(KERN_INFO PFX "generic IE set to ");
>                 for (i=0;i<wrqu->data.length;i++)
>                         dprintk("%.2x", mac->wpa.IE[i]);
>                 dprintk("\n");
> 
> the dprintk code isn't doing the right thing here, given an array of
> bytes.  You probably want:
> 
>                         dprintk("%.2hhx", mac->wpa.IE[i]);
> 
> (ie, add the "hh" before the x to tell the print that it's a char)
> 
That doesn't work - the result is

%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx%hx

I changed the line to cast the output byte as a u8 as follows:

                         dprintk("%.2x", (u8)mac->wpa.IE[i]);

This produces the line

generic IE set to dd160050f20101000050f20201000050f20201000050f202

This is the WPA IE supplied by wpa_supplicant and it matches the one used in the ndiswrapper case. 
One mystery solved, but why doesn't it work?

Johannes - should I submit the patch to fix this printout, or would you like to do it?

Larry

  reply	other threads:[~2006-06-07 18:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06 19:24 Problem authenticating using WPA with bcm43xx-softmac Larry Finger
2006-06-07 12:10 ` Johannes Berg
2006-06-07 15:47   ` Larry Finger
2006-06-07 15:51     ` Johannes Berg
2006-06-07 15:57       ` Johannes Berg
2006-06-07 17:29         ` Dan Williams
2006-06-07 18:12           ` Larry Finger [this message]
2006-06-07 19:36             ` Dan Williams
2006-06-07 19:46               ` Larry Finger
2006-06-09 11:44             ` Johannes Berg
2006-06-09 15:31               ` Larry Finger
2006-06-09 15:34                 ` Johannes Berg
2006-06-09 16:24                   ` Larry Finger
2006-06-12  1:11                   ` Larry Finger
2006-06-13  8:40                     ` Johannes Berg
2006-06-07 16:01       ` Sam Leffler
2006-06-07 16:06         ` Johannes Berg
2006-06-07 16:30           ` Larry Finger
2006-06-07 17:07           ` Larry Finger
2006-06-07 16:09         ` Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44871723.3040803@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=dcbw@redhat.com \
    --cc=jkm@devicescape.com \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).