summaryrefslogtreecommitdiff
path: root/sys/net80211/ieee80211_crypto.h
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2007-08-22 20:40:35 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2007-08-22 20:40:35 +0000
commit4f19245ee53a151b1ae297678ba39835912a1efe (patch)
treeffc09b7a85fca0e699375187b82c2732970611ec /sys/net80211/ieee80211_crypto.h
parentdd654a77e55db513af679bbba472472b1a70b096 (diff)
- add k_rxmic and k_txmic fields to struct ieee80211_key to store the
Tx/Rx MIC for TKIP. - add two functions to map a PTK and a GTK to an IEEE 802.11 key and use them in ieee80211_input.c instead of duplicating the same code. properly set Tx/Rx MIC in the IEEE 802.11 key in the case of TKIP. - add ic_psk to struct ieee80211com to store the pre-shared key. - fix setting of the SECURE bit in outgoing EAPOL-Key frames. - when receiving msg 2 of the 4-way handshake, deauthenticate the station if the RSN IE does not match that of the (Re)Association request. - before parsing an RSN or WPA IE, check that there's enough room for the version field (2 bytes) which is mandatory. - various tweaks while i'm here.
Diffstat (limited to 'sys/net80211/ieee80211_crypto.h')
-rw-r--r--sys/net80211/ieee80211_crypto.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/net80211/ieee80211_crypto.h b/sys/net80211/ieee80211_crypto.h
index 0ac915fbd35..8d8d4cf58d6 100644
--- a/sys/net80211/ieee80211_crypto.h
+++ b/sys/net80211/ieee80211_crypto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_crypto.h,v 1.6 2007/08/01 15:40:40 damien Exp $ */
+/* $OpenBSD: ieee80211_crypto.h,v 1.7 2007/08/22 20:40:34 damien Exp $ */
/* $NetBSD: ieee80211_crypto.h,v 1.2 2003/09/14 01:14:55 dyoung Exp $ */
/*-
@@ -60,6 +60,14 @@ enum ieee80211_akm {
#define IEEE80211_KEYBUF_SIZE 16
+#define IEEE80211_TKIP_HDRLEN 8
+#define IEEE80211_TKIP_MICLEN 8
+#define IEEE80211_TKIP_ICVLEN 4
+#define IEEE80211_CCMP_HDRLEN 8
+#define IEEE80211_CCMP_MICLEN 8
+
+#define IEEE80211_PMK_LEN 32
+
struct ieee80211_key {
u_int8_t k_id; /* identifier (0-3) */
enum ieee80211_cipher k_cipher;
@@ -71,6 +79,8 @@ struct ieee80211_key {
u_int64_t k_tsc;
int k_len;
u_int8_t k_key[IEEE80211_KEYBUF_SIZE];
+ u_int8_t k_rxmic[IEEE80211_TKIP_MICLEN];
+ u_int8_t k_txmic[IEEE80211_TKIP_MICLEN];
};
/* forward references */
@@ -88,5 +98,9 @@ extern void ieee80211_derive_ptk(const u_int8_t *, size_t, const u_int8_t *,
const u_int8_t *, const u_int8_t *, const u_int8_t *, u_int8_t *,
size_t);
extern int ieee80211_cipher_keylen(enum ieee80211_cipher);
+extern void ieee80211_map_ptk(const struct ieee80211_ptk *,
+ enum ieee80211_cipher, struct ieee80211_key *);
+extern void ieee80211_map_gtk(const u_int8_t *, enum ieee80211_cipher, int,
+ int, u_int64_t, struct ieee80211_key *);
#endif /* _NET80211_IEEE80211_CRYPTO_H_ */