From 5a67fb6846f49c809c80fb49cfa5fe03b6f9a8ce Mon Sep 17 00:00:00 2001 From: Damien Bergamini Date: Mon, 2 Jul 2007 20:42:31 +0000 Subject: add new ieee80211_eapol_key structure (used by the various 802.11i key handshakes). --- sys/net80211/ieee80211.h | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index 137485d4ffc..5c2876fbbe2 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211.h,v 1.23 2007/07/02 19:36:47 damien Exp $ */ +/* $OpenBSD: ieee80211.h,v 1.24 2007/07/02 20:42:30 damien Exp $ */ /* $NetBSD: ieee80211.h,v 1.6 2004/04/30 23:51:53 dyoung Exp $ */ /*- @@ -610,4 +610,44 @@ enum { IEEE80211_AUTH_WPA2_PSK = 8 /* WPA2 w/ preshared key */ }; +/* + * The RSNA key descriptor used by IEEE 802.11 does not use the IEEE 802.1X + * key descriptor. Instead, it uses the key descriptor described below. + */ +#define EAPOL_KEY_NONCE_LEN 32 +#define EAPOL_KEY_IV_LEN 16 +#define EAPOL_KEY_MIC_LEN 16 + +/* from Std 802.11i-2004 section 8.5.2 */ +struct ieee80211_eapol_key { + u_int8_t type; +/* IEEE Std 802.1X-2004, section 7.6.1 */ +#define EAPOL_KEY_TYPE_RC4 1 /* deprecated */ +#define EAPOL_KEY_TYPE_IEEE80211 2 + + u_int16_t info; +#define EAPOL_KEY_VERSION_MASK 0x7 +#define EAPOL_KEY_VERSION_SHIFT 0 +#define EAPOL_KEY_VERSION_MD5_RC4 1 +#define EAPOL_KEY_VERSION_SHA1_AES 2 +#define EAPOL_KEY_PAIRWISE (1 << 3) +#define EAPOL_KEY_INSTALL (1 << 6) /* I */ +#define EAPOL_KEY_KEYACK (1 << 7) /* A */ +#define EAPOL_KEY_KEYMIC (1 << 8) /* M */ +#define EAPOL_KEY_SECURE (1 << 9) /* S */ +#define EAPOL_KEY_ERROR (1 << 10) +#define EAPOL_KEY_REQUEST (1 << 11) +#define EAPOL_KEY_ENCRYPTED (1 << 12) + + u_int16_t keylen; + u_int64_t replay_cnt; + u_int8_t nonce[EAPOL_KEY_NONCE_LEN]; + u_int8_t iv[EAPOL_KEY_IV_LEN]; + u_int64_t rsc; + u_int8_t reserved[8]; + u_int8_t mic[EAPOL_KEY_MIC_LEN]; + u_int16_t len; + u_int8_t data[0]; +} __packed; + #endif /* _NET80211_IEEE80211_H_ */ -- cgit v1.2.3