aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-03-29 17:48:01 (GMT)
committerJouni Malinen <j@w1.fi>2010-03-29 17:48:01 (GMT)
commite820cf952f29baabbfd3dba8e65fb54029f5a2ae (patch)
treecfef03f3af901c89992a6b17555a91d1edd9ffa5
parenta042f8447dc7d89f2aa7db0d95d3987ebfbf3d3a (diff)
downloadhostap-e820cf952f29baabbfd3dba8e65fb54029f5a2ae.zip
hostap-e820cf952f29baabbfd3dba8e65fb54029f5a2ae.tar.gz
hostap-e820cf952f29baabbfd3dba8e65fb54029f5a2ae.tar.bz2
MFP: Add MFPR flag into station RSN IE if 802.11w is mandatory
-rw-r--r--src/rsn_supp/wpa.c3
-rw-r--r--src/rsn_supp/wpa.h3
-rw-r--r--src/rsn_supp/wpa_i.h1
-rw-r--r--src/rsn_supp/wpa_ie.c4
-rw-r--r--wpa_supplicant/wpa_supplicant.c1
5 files changed, 10 insertions, 2 deletions
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index df0688c..495e54c 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -2124,6 +2124,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
case WPA_PARAM_RSN_ENABLED:
sm->rsn_enabled = value;
break;
+ case WPA_PARAM_MFP:
+ sm->mfp = value;
+ break;
default:
break;
}
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index 727e591..8db5fda 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -67,7 +67,8 @@ enum wpa_sm_conf_params {
WPA_PARAM_GROUP,
WPA_PARAM_KEY_MGMT,
WPA_PARAM_MGMT_GROUP,
- WPA_PARAM_RSN_ENABLED
+ WPA_PARAM_RSN_ENABLED,
+ WPA_PARAM_MFP
};
struct rsn_supp_config {
diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
index fb80afd..929b06b 100644
--- a/src/rsn_supp/wpa_i.h
+++ b/src/rsn_supp/wpa_i.h
@@ -82,6 +82,7 @@ struct wpa_sm {
unsigned int mgmt_group_cipher;
int rsn_enabled; /* Whether RSN is enabled in configuration */
+ int mfp; /* 0 = disabled, 1 = optional, 2 = mandatory */
u8 *assoc_wpa_ie; /* Own WPA/RSN IE from (Re)AssocReq */
size_t assoc_wpa_ie_len;
diff --git a/src/rsn_supp/wpa_ie.c b/src/rsn_supp/wpa_ie.c
index 0feb1f6..c495208 100644
--- a/src/rsn_supp/wpa_ie.c
+++ b/src/rsn_supp/wpa_ie.c
@@ -332,8 +332,10 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
/* RSN Capabilities */
capab = 0;
#ifdef CONFIG_IEEE80211W
- if (mgmt_group_cipher == WPA_CIPHER_AES_128_CMAC)
+ if (sm->mfp)
capab |= WPA_CAPABILITY_MFPC;
+ if (sm->mfp == 2)
+ capab |= WPA_CAPABILITY_MFPR;
#endif /* CONFIG_IEEE80211W */
WPA_PUT_LE16(pos, capab);
pos += 2;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index d62937b..6748735 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -958,6 +958,7 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
}
wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_MGMT_GROUP,
wpa_s->mgmt_group_cipher);
+ wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_MFP, ssid->ieee80211w);
#endif /* CONFIG_IEEE80211W */
if (wpa_sm_set_assoc_wpa_ie_default(wpa_s->wpa, wpa_ie, wpa_ie_len)) {