aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-01-03 19:02:51 (GMT)
committerJouni Malinen <j@w1.fi>2010-01-03 19:02:51 (GMT)
commit70f8cc8ec81e46f753ea3b659613d10ff10145a7 (patch)
treeb3a30d9381949f25f2e842cb36f9caa177bbb5cc /src/ap
parente049867788103d96e9c6d093507c0ec68b1f9d88 (diff)
downloadhostap-70f8cc8ec81e46f753ea3b659613d10ff10145a7.zip
hostap-70f8cc8ec81e46f753ea3b659613d10ff10145a7.tar.gz
hostap-70f8cc8ec81e46f753ea3b659613d10ff10145a7.tar.bz2
Share the same enum for MFP configuration
The three existing enums were already depending on using the same values in couple of places and it is just simpler to standardize on one of these to avoid need for mapping between different enums for the exact same thing.
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/wpa_auth.c4
-rw-r--r--src/ap/wpa_auth.h6
-rw-r--r--src/ap/wpa_auth_ie.c10
3 files changed, 8 insertions, 12 deletions
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index b2b4c42..39ad881 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -1926,7 +1926,7 @@ static int wpa_gtk_update(struct wpa_authenticator *wpa_auth,
group->GTK[group->GN - 1], group->GTK_len);
#ifdef CONFIG_IEEE80211W
- if (wpa_auth->conf.ieee80211w != WPA_NO_IEEE80211W) {
+ if (wpa_auth->conf.ieee80211w != NO_MGMT_FRAME_PROTECTION) {
if (os_get_random(group->IGTK[group->GN_igtk - 4],
WPA_IGTK_LEN) < 0) {
wpa_printf(MSG_INFO, "RSN: Failed to get new random "
@@ -2029,7 +2029,7 @@ static void wpa_group_setkeysdone(struct wpa_authenticator *wpa_auth,
group->GTK_len);
#ifdef CONFIG_IEEE80211W
- if (wpa_auth->conf.ieee80211w != WPA_NO_IEEE80211W) {
+ if (wpa_auth->conf.ieee80211w != NO_MGMT_FRAME_PROTECTION) {
wpa_auth_set_key(wpa_auth, group->vlan_id, WPA_ALG_IGTK,
NULL, group->GN_igtk,
group->IGTK[group->GN_igtk - 4],
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index 4bd9cd7..3a88d58 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -141,11 +141,7 @@ struct wpa_auth_config {
int wmm_enabled;
int okc;
#ifdef CONFIG_IEEE80211W
- enum {
- WPA_NO_IEEE80211W = 0,
- WPA_IEEE80211W_OPTIONAL = 1,
- WPA_IEEE80211W_REQUIRED = 2
- } ieee80211w;
+ enum mfp_options ieee80211w;
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_IEEE80211R
#define SSID_LEN 32
diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c
index 29c9603..f6eb5c4 100644
--- a/src/ap/wpa_auth_ie.c
+++ b/src/ap/wpa_auth_ie.c
@@ -221,9 +221,9 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
capab |= (RSN_NUM_REPLAY_COUNTERS_16 << 2);
}
#ifdef CONFIG_IEEE80211W
- if (conf->ieee80211w != WPA_NO_IEEE80211W) {
+ if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
capab |= WPA_CAPABILITY_MFPC;
- if (conf->ieee80211w == IEEE80211W_REQUIRED)
+ if (conf->ieee80211w == MGMT_FRAME_PROTECTION_REQUIRED)
capab |= WPA_CAPABILITY_MFPR;
}
#endif /* CONFIG_IEEE80211W */
@@ -241,7 +241,7 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
}
#ifdef CONFIG_IEEE80211W
- if (conf->ieee80211w != WPA_NO_IEEE80211W) {
+ if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
if (pos + 2 + 4 > buf + len)
return -1;
if (pmkid == NULL) {
@@ -613,7 +613,7 @@ int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
}
#ifdef CONFIG_IEEE80211W
- if (wpa_auth->conf.ieee80211w == WPA_IEEE80211W_REQUIRED) {
+ if (wpa_auth->conf.ieee80211w == MGMT_FRAME_PROTECTION_REQUIRED) {
if (!(data.capabilities & WPA_CAPABILITY_MFPC)) {
wpa_printf(MSG_DEBUG, "Management frame protection "
"required, but client did not enable it");
@@ -633,7 +633,7 @@ int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
}
}
- if (wpa_auth->conf.ieee80211w == WPA_NO_IEEE80211W ||
+ if (wpa_auth->conf.ieee80211w == NO_MGMT_FRAME_PROTECTION ||
!(data.capabilities & WPA_CAPABILITY_MFPC))
sm->mgmt_frame_prot = 0;
else