* [PATCH] mac80211: Add IEEE80211_KEY_FLAG_PAIRWISE
@ 2008-04-17 19:11 Ivo van Doorn
2008-04-18 12:09 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Ivo van Doorn @ 2008-04-17 19:11 UTC (permalink / raw)
To: John W. Linville; +Cc: Johannes Berg, linux-wireless
This adds a new flag to the ieee80211_key_conf structure.
This flag will inform the driver the key is pairwise rather then
a shared key.
This is important for drivers who support both types of keys,
and need to be informed which type of key this is. Alternative
would be drivers checking the address argument of set_key(),
but it will be safer when mac80211 is more explicit.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 27ef9f7..740c11c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -621,11 +621,14 @@ enum ieee80211_key_alg {
* @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
* the driver for a TKIP key if it requires Michael MIC
* generation in software.
+ * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
+ * that the key is pairwise rather then a shared key.
*/
enum ieee80211_key_flags {
IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
+ IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
};
/**
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 150d66d..88b211a 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -323,6 +323,13 @@ void ieee80211_key_link(struct ieee80211_key *key,
*/
if (sta->flags & WLAN_STA_WME)
key->conf.flags |= IEEE80211_KEY_FLAG_WMM_STA;
+
+ /*
+ * This key is for a specific sta interface,
+ * inform the driver that it should try to store
+ * this key as pairwise key.
+ */
+ key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE;
} else {
if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
struct sta_info *ap;
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] mac80211: Add IEEE80211_KEY_FLAG_PAIRWISE
2008-04-17 19:11 [PATCH] mac80211: Add IEEE80211_KEY_FLAG_PAIRWISE Ivo van Doorn
@ 2008-04-18 12:09 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-04-18 12:09 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1912 bytes --]
On Thu, 2008-04-17 at 21:11 +0200, Ivo van Doorn wrote:
> This adds a new flag to the ieee80211_key_conf structure.
> This flag will inform the driver the key is pairwise rather then
> a shared key.
>
> This is important for drivers who support both types of keys,
> and need to be informed which type of key this is. Alternative
> would be drivers checking the address argument of set_key(),
> but it will be safer when mac80211 is more explicit.
Looks fine to me.
> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 27ef9f7..740c11c 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -621,11 +621,14 @@ enum ieee80211_key_alg {
> * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
> * the driver for a TKIP key if it requires Michael MIC
> * generation in software.
> + * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
> + * that the key is pairwise rather then a shared key.
> */
> enum ieee80211_key_flags {
> IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
> IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
> IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
> + IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
> };
>
> /**
> diff --git a/net/mac80211/key.c b/net/mac80211/key.c
> index 150d66d..88b211a 100644
> --- a/net/mac80211/key.c
> +++ b/net/mac80211/key.c
> @@ -323,6 +323,13 @@ void ieee80211_key_link(struct ieee80211_key *key,
> */
> if (sta->flags & WLAN_STA_WME)
> key->conf.flags |= IEEE80211_KEY_FLAG_WMM_STA;
> +
> + /*
> + * This key is for a specific sta interface,
> + * inform the driver that it should try to store
> + * this key as pairwise key.
> + */
> + key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE;
> } else {
> if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
> struct sta_info *ap;
>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-18 12:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-17 19:11 [PATCH] mac80211: Add IEEE80211_KEY_FLAG_PAIRWISE Ivo van Doorn
2008-04-18 12:09 ` Johannes Berg
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).