linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] add support for parsing WPA and RSN/WPA2 information elements
Date: Mon, 04 May 2009 09:47:21 +0200	[thread overview]
Message-ID: <1241423241.8683.5.camel@johannes.local> (raw)
In-Reply-To: <1241422800.2899.5.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2580 bytes --]

Hi,

> > > +static unsigned char vendor_oui[3] = { 0x00, 0x50, 0xf2 };
> > > +static unsigned char cipher_oui[3] = { 0x00, 0x0f, 0xac };
> > 
> > ??
> > 00-50-f2 is "WiFi OUI" (registered to Microsoft), 00-0f-ac is "802.11
> > OUI", registered to 802.11.
> 
> I can rename them if that helps.

Yes, please do, but also synchronise the things you print out. _All_
cipher specs are effectively vendor-specified, but some use vendor
"WiFi" and some use vendor "802.11" so are standardised in some form. I
don't think printing "Vendor specified: ..." for the WiFi OUI or "Other"
for "real" vendor-specified ones helps.

> > Why are you passing in the OUI?
> 
> The WPA1 and WPA2 IE are uses a different OUI for basically exactly the
> same thing.

Yeah, I noticed later.

> > > +	if (len < 4) {
> > > +		tab_on_first(&first);
> > > +		printf("\t * Group cipher: TKIP\n");
> > > +		printf("\t * Pairwise ciphers: TKIP\n");
> > > +		return;
> > > +	}
> > 
> > Huh? I don't quite understand this? Is that some backward compat code?
> > Or is this some WPA1 thing I don't know about?
> 
> The specification says that the only mandatory field is the version and
> after that everything else is optional and falls back to default
> TKIP/TKIP. At least that is what I read of it.

Ok, makes sense I guess.

> > > +static void print_rsn(unsigned char type, unsigned char len, unsigned char *data)
> > > +{
> > > +	print_wpa("WPA2", cipher_oui, len, data);
> > > +}
> > 
> > That's "oui_80211" I guess, not "cipher_oui". Ok I see now why you want
> > to pass in the OUI... However, it would be better to just duplicate the
> > code, I think for example 11w won't be announced in WPA1 IEs so we
> > shouldn't parse it there when we add support for parsing it to RSN IEs.
> 
> Since iw is just printing the actual IE, I don't think we should be
> bothering here with code duplication. We can just print what the element
> actually contains. If for some weird fucked up AP, has 11w inside WPA1,
> then I actually wanna have iw print that :)

No, this is the wrong approach. See, there are two defined cipher suites
for, say, CCMP:
00:50:f2-4 and 00:0f:ac-4

However, it is not necessarily true that 00:50:f2-N is _always_ the same
as 00:0f:ac-N. 11w adds 00:0f:ac-6 (AES-128-CMAC, you could add that to
your patch), but 00:50:f2-6 stays undefined since the WiFi spec defines
that one, not the 802.11 spec. The WiFi spec could very well define
00:50:f2-6 as "quantum cryptography mode reserved for future" if it
wishes.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2009-05-04  7:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04  4:46 [PATCH] add support for parsing WPA and RSN/WPA2 information elements Marcel Holtmann
2009-05-04  7:34 ` Johannes Berg
2009-05-04  7:40   ` Marcel Holtmann
2009-05-04  7:47     ` Johannes Berg [this message]
2009-05-04  7:51       ` Marcel Holtmann
2009-05-04  7:55         ` Johannes Berg
2009-05-04  8:06 ` Jouni Malinen
2009-05-04  8:53   ` Marcel Holtmann
2009-05-05  8:35     ` Jouni Malinen
2009-05-05 15:56       ` Marcel Holtmann
2009-05-05 16:03         ` Johannes Berg

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=1241423241.8683.5.camel@johannes.local \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=marcel@holtmann.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).