summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_crypto.h
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-04-12 17:55:13 +0000
committersam <sam@FreeBSD.org>2005-04-12 17:55:13 +0000
commit8ace9dabcaf3bace0eec9d861bc2adbd683f0d11 (patch)
tree39cd14254ed93f788559668e1f87072c08f25985 /sys/net80211/ieee80211_crypto.h
parent28f1c84813b1e373262d5f0158bbd37c6462e03f (diff)
downloadFreeBSD-src-8ace9dabcaf3bace0eec9d861bc2adbd683f0d11.zip
FreeBSD-src-8ace9dabcaf3bace0eec9d861bc2adbd683f0d11.tar.gz
Revise crypto api lightly to improve group key handling:
o don't pre-assign key index to the global key table entries so device has a chance to decide what to use o make ieee80211_crypto_newkey take the desired flags as an argument instead of wacking the key structure directly; this eliminates a bunch of code warts o add a new flag IEEE80211_KEY_GROUP to indicate a key is a WPA Group key so devices don't need to guess (temporarily add this flag in the ioctl code until we can get wpa_supplicant+hostapd updated) o shuffle IEEE80211_KEY_* bits to move flags used internally to the high nibble of the flags word Reviewed by: Tai-hwa Liang
Diffstat (limited to 'sys/net80211/ieee80211_crypto.h')
-rw-r--r--sys/net80211/ieee80211_crypto.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h
index 7f18c2d..ffb8525 100644
--- a/sys/net80211/ieee80211_crypto.h
+++ b/sys/net80211/ieee80211_crypto.h
@@ -74,8 +74,9 @@ struct ieee80211_key {
u_int8_t wk_flags;
#define IEEE80211_KEY_XMIT 0x01 /* key used for xmit */
#define IEEE80211_KEY_RECV 0x02 /* key used for recv */
-#define IEEE80211_KEY_SWCRYPT 0x04 /* host-based encrypt/decrypt */
-#define IEEE80211_KEY_SWMIC 0x08 /* host-based enmic/demic */
+#define IEEE80211_KEY_GROUP 0x04 /* key used for WPA group operation */
+#define IEEE80211_KEY_SWCRYPT 0x10 /* host-based encrypt/decrypt */
+#define IEEE80211_KEY_SWMIC 0x20 /* host-based enmic/demic */
u_int16_t wk_keyix; /* key index */
u_int8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */
@@ -85,6 +86,8 @@ struct ieee80211_key {
const struct ieee80211_cipher *wk_cipher;
void *wk_private; /* private cipher state */
};
+#define IEEE80211_KEY_COMMON /* common flags passed in by apps */\
+ (IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV | IEEE80211_KEY_GROUP)
/*
* NB: these values are ordered carefully; there are lots of
@@ -133,7 +136,7 @@ struct ieee80211_crypto_state {
void ieee80211_crypto_attach(struct ieee80211com *);
void ieee80211_crypto_detach(struct ieee80211com *);
int ieee80211_crypto_newkey(struct ieee80211com *,
- int cipher, struct ieee80211_key *);
+ int cipher, int flags, struct ieee80211_key *);
int ieee80211_crypto_delkey(struct ieee80211com *,
struct ieee80211_key *);
int ieee80211_crypto_setkey(struct ieee80211com *,
OpenPOWER on IntegriCloud