* [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
@ 2008-06-21 11:51 Luis R. Rodriguez
2008-06-21 12:00 ` Johannes Berg
0 siblings, 1 reply; 6+ messages in thread
From: Luis R. Rodriguez @ 2008-06-21 11:51 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
Some drivers may want to to use the TKIP key offsets for TX and RX
MIC so lets move this out.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
include/net/cfg80211.h | 5 +++++
net/mac80211/key.h | 37 ++++++++++++-------------------------
2 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e007508..6cb8b02 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -12,6 +12,11 @@
* Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
*/
+/* Starting offsets for each key for TKIP */
+#define ALG_TKIP_TEMP_ENCR_KEY 0
+#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
+#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
+
/**
* struct vif_params - describes virtual interface parameters
* @mesh_id: mesh ID to use
diff --git a/net/mac80211/key.h b/net/mac80211/key.h
index a0f774a..425816e 100644
--- a/net/mac80211/key.h
+++ b/net/mac80211/key.h
@@ -16,31 +16,18 @@
#include <linux/rcupdate.h>
#include <net/mac80211.h>
-/* ALG_TKIP
- * struct ieee80211_key::key is encoded as a 256-bit (32 byte) data block:
- * Temporal Encryption Key (128 bits)
- * Temporal Authenticator Tx MIC Key (64 bits)
- * Temporal Authenticator Rx MIC Key (64 bits)
- */
-
-#define WEP_IV_LEN 4
-#define WEP_ICV_LEN 4
-
-#define ALG_TKIP_KEY_LEN 32
-/* Starting offsets for each key */
-#define ALG_TKIP_TEMP_ENCR_KEY 0
-#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
-#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
-#define TKIP_IV_LEN 8
-#define TKIP_ICV_LEN 4
-
-#define ALG_CCMP_KEY_LEN 16
-#define CCMP_HDR_LEN 8
-#define CCMP_MIC_LEN 8
-#define CCMP_TK_LEN 16
-#define CCMP_PN_LEN 6
-
-#define NUM_RX_DATA_QUEUES 17
+#define WEP_IV_LEN 4
+#define WEP_ICV_LEN 4
+#define ALG_TKIP_KEY_LEN 32
+#define ALG_CCMP_KEY_LEN 16
+#define CCMP_HDR_LEN 8
+#define CCMP_MIC_LEN 8
+#define CCMP_TK_LEN 16
+#define CCMP_PN_LEN 6
+#define TKIP_IV_LEN 8
+#define TKIP_ICV_LEN 4
+
+#define NUM_RX_DATA_QUEUES 17
struct ieee80211_local;
struct ieee80211_sub_if_data;
--
1.5.5.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
2008-06-21 11:51 [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC Luis R. Rodriguez
@ 2008-06-21 12:00 ` Johannes Berg
2008-06-21 12:23 ` Ivo van Doorn
2008-06-21 12:24 ` Luis R. Rodriguez
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Berg @ 2008-06-21 12:00 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: John Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]
On Sat, 2008-06-21 at 07:51 -0400, Luis R. Rodriguez wrote:
> Some drivers may want to to use the TKIP key offsets for TX and RX
> MIC so lets move this out.
>
> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> ---
> include/net/cfg80211.h | 5 +++++
> net/mac80211/key.h | 37 ++++++++++++-------------------------
> 2 files changed, 17 insertions(+), 25 deletions(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index e007508..6cb8b02 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -12,6 +12,11 @@
> * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
> */
>
> +/* Starting offsets for each key for TKIP */
> +#define ALG_TKIP_TEMP_ENCR_KEY 0
> +#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
> +#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
put it into nl80211 and give it proper namespace prefixes, please.
> -/* ALG_TKIP
> - * struct ieee80211_key::key is encoded as a 256-bit (32 byte) data block:
> - * Temporal Encryption Key (128 bits)
> - * Temporal Authenticator Tx MIC Key (64 bits)
> - * Temporal Authenticator Rx MIC Key (64 bits)
> - */
and why remove the comment? There's a small comment in nl80211.h but it
could be described in more detail.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
2008-06-21 12:23 ` Ivo van Doorn
@ 2008-06-21 12:07 ` Johannes Berg
2008-06-21 12:38 ` Ivo van Doorn
0 siblings, 1 reply; 6+ messages in thread
From: Johannes Berg @ 2008-06-21 12:07 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: Luis R. Rodriguez, John Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]
On Sat, 2008-06-21 at 14:23 +0200, Ivo van Doorn wrote:
> On Saturday 21 June 2008, Johannes Berg wrote:
> > On Sat, 2008-06-21 at 07:51 -0400, Luis R. Rodriguez wrote:
> > > Some drivers may want to to use the TKIP key offsets for TX and RX
> > > MIC so lets move this out.
> > >
> > > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> > > ---
> > > include/net/cfg80211.h | 5 +++++
> > > net/mac80211/key.h | 37 ++++++++++++-------------------------
> > > 2 files changed, 17 insertions(+), 25 deletions(-)
> > >
> > > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> > > index e007508..6cb8b02 100644
> > > --- a/include/net/cfg80211.h
> > > +++ b/include/net/cfg80211.h
> > > @@ -12,6 +12,11 @@
> > > * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
> > > */
> > >
> > > +/* Starting offsets for each key for TKIP */
> > > +#define ALG_TKIP_TEMP_ENCR_KEY 0
> > > +#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
> > > +#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
> >
> > put it into nl80211 and give it proper namespace prefixes, please.
>
> Don't we need something similar for AES keys as well?
I don't think there is a separate MIC key for AES, is there?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
2008-06-21 12:00 ` Johannes Berg
@ 2008-06-21 12:23 ` Ivo van Doorn
2008-06-21 12:07 ` Johannes Berg
2008-06-21 12:24 ` Luis R. Rodriguez
1 sibling, 1 reply; 6+ messages in thread
From: Ivo van Doorn @ 2008-06-21 12:23 UTC (permalink / raw)
To: Johannes Berg; +Cc: Luis R. Rodriguez, John Linville, linux-wireless
On Saturday 21 June 2008, Johannes Berg wrote:
> On Sat, 2008-06-21 at 07:51 -0400, Luis R. Rodriguez wrote:
> > Some drivers may want to to use the TKIP key offsets for TX and RX
> > MIC so lets move this out.
> >
> > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> > ---
> > include/net/cfg80211.h | 5 +++++
> > net/mac80211/key.h | 37 ++++++++++++-------------------------
> > 2 files changed, 17 insertions(+), 25 deletions(-)
> >
> > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> > index e007508..6cb8b02 100644
> > --- a/include/net/cfg80211.h
> > +++ b/include/net/cfg80211.h
> > @@ -12,6 +12,11 @@
> > * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
> > */
> >
> > +/* Starting offsets for each key for TKIP */
> > +#define ALG_TKIP_TEMP_ENCR_KEY 0
> > +#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
> > +#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
>
> put it into nl80211 and give it proper namespace prefixes, please.
Don't we need something similar for AES keys as well?
> > -/* ALG_TKIP
> > - * struct ieee80211_key::key is encoded as a 256-bit (32 byte) data block:
> > - * Temporal Encryption Key (128 bits)
> > - * Temporal Authenticator Tx MIC Key (64 bits)
> > - * Temporal Authenticator Rx MIC Key (64 bits)
> > - */
>
> and why remove the comment? There's a small comment in nl80211.h but it
> could be described in more detail.
>
> johannes
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
2008-06-21 12:00 ` Johannes Berg
2008-06-21 12:23 ` Ivo van Doorn
@ 2008-06-21 12:24 ` Luis R. Rodriguez
1 sibling, 0 replies; 6+ messages in thread
From: Luis R. Rodriguez @ 2008-06-21 12:24 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
On Sat, Jun 21, 2008 at 5:30 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Sat, 2008-06-21 at 07:51 -0400, Luis R. Rodriguez wrote:
>> Some drivers may want to to use the TKIP key offsets for TX and RX
>> MIC so lets move this out.
>>
>> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
>> ---
>> include/net/cfg80211.h | 5 +++++
>> net/mac80211/key.h | 37 ++++++++++++-------------------------
>> 2 files changed, 17 insertions(+), 25 deletions(-)
>>
>> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
>> index e007508..6cb8b02 100644
>> --- a/include/net/cfg80211.h
>> +++ b/include/net/cfg80211.h
>> @@ -12,6 +12,11 @@
>> * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
>> */
>>
>> +/* Starting offsets for each key for TKIP */
>> +#define ALG_TKIP_TEMP_ENCR_KEY 0
>> +#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
>> +#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
>
> put it into nl80211 and give it proper namespace prefixes, please.
OK
>> -/* ALG_TKIP
>> - * struct ieee80211_key::key is encoded as a 256-bit (32 byte) data block:
>> - * Temporal Encryption Key (128 bits)
>> - * Temporal Authenticator Tx MIC Key (64 bits)
>> - * Temporal Authenticator Rx MIC Key (64 bits)
>> - */
>
> and why remove the comment? There's a small comment in nl80211.h but it
> could be described in more detail.
ieee80211_key::key is wrong, it should be ieee80211_key_conf::key,
I'll try to clear this up in a few places and how we follow this to
keep the same format as that received by nl80211.
Luis
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC
2008-06-21 12:07 ` Johannes Berg
@ 2008-06-21 12:38 ` Ivo van Doorn
0 siblings, 0 replies; 6+ messages in thread
From: Ivo van Doorn @ 2008-06-21 12:38 UTC (permalink / raw)
To: Johannes Berg; +Cc: Luis R. Rodriguez, John Linville, linux-wireless
On Saturday 21 June 2008, Johannes Berg wrote:
> On Sat, 2008-06-21 at 14:23 +0200, Ivo van Doorn wrote:
> > On Saturday 21 June 2008, Johannes Berg wrote:
> > > On Sat, 2008-06-21 at 07:51 -0400, Luis R. Rodriguez wrote:
> > > > Some drivers may want to to use the TKIP key offsets for TX and RX
> > > > MIC so lets move this out.
> > > >
> > > > Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
> > > > ---
> > > > include/net/cfg80211.h | 5 +++++
> > > > net/mac80211/key.h | 37 ++++++++++++-------------------------
> > > > 2 files changed, 17 insertions(+), 25 deletions(-)
> > > >
> > > > diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> > > > index e007508..6cb8b02 100644
> > > > --- a/include/net/cfg80211.h
> > > > +++ b/include/net/cfg80211.h
> > > > @@ -12,6 +12,11 @@
> > > > * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
> > > > */
> > > >
> > > > +/* Starting offsets for each key for TKIP */
> > > > +#define ALG_TKIP_TEMP_ENCR_KEY 0
> > > > +#define ALG_TKIP_TEMP_AUTH_TX_MIC_KEY 16
> > > > +#define ALG_TKIP_TEMP_AUTH_RX_MIC_KEY 24
> > >
> > > put it into nl80211 and give it proper namespace prefixes, please.
> >
> > Don't we need something similar for AES keys as well?
>
> I don't think there is a separate MIC key for AES, is there?
Hmm, I'm off reading some specs about TKIP and AES encryption. ;)
PS, above defines are very useful for rt2x00 since apparently I swapped the
2 fields in the rt2x00crypto implementation.
This was caused the legacy driver code which did:
WPANONE:
txmic = 16
rxmic = 16
authenticator:
txmic = 16
rxmic = 24
normal:
txmic = 24
rxmic = 16
Ivo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-06-21 12:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-21 11:51 [PATCH] mac80211: Let drivers have access to TKIP key offets for TX and RX MIC Luis R. Rodriguez
2008-06-21 12:00 ` Johannes Berg
2008-06-21 12:23 ` Ivo van Doorn
2008-06-21 12:07 ` Johannes Berg
2008-06-21 12:38 ` Ivo van Doorn
2008-06-21 12:24 ` Luis R. Rodriguez
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).