aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/ap_drv_ops.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-03-25 09:41:26 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-10 10:49:59 (GMT)
commite19c1d2cc7080fd7b25ca0b5c9109bd091d51e23 (patch)
treed53f0691a6a96473197ba1c87c883fc0c3418065 /src/ap/ap_drv_ops.c
parentee120ff3819123d26e05cd9d3dc6647b7354e63d (diff)
downloadhostap-e19c1d2cc7080fd7b25ca0b5c9109bd091d51e23.zip
hostap-e19c1d2cc7080fd7b25ca0b5c9109bd091d51e23.tar.gz
hostap-e19c1d2cc7080fd7b25ca0b5c9109bd091d51e23.tar.bz2
Fix pairwise cipher suite bitfields to the driver in mixed mode
Commit 95b6bca66de9dc0a2ddd9164ec052a7d5f58804b ('Add rsn_pairwise bits to set_ieee8021x() driver_ops') modified cipher configuration to use unconditionally wpa_pairwise | rsn_pairwise. While that works for many cases, it does not handle the case of dynamic configuration changes over the control interface where wpa_pairwise or rsn_pairwise values may not get cleared when the wpa parameter is modified. Fix this inconsistency by configuring the driver with only the bits that are valid for the currently enabled WPA/WPA2 version(s). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/ap/ap_drv_ops.c')
-rw-r--r--src/ap/ap_drv_ops.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 9ee88b4..60c8f8c 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -290,8 +290,14 @@ int hostapd_set_drv_ieee8021x(struct hostapd_data *hapd, const char *ifname,
params.wpa = hapd->conf->wpa;
params.ieee802_1x = hapd->conf->ieee802_1x;
params.wpa_group = hapd->conf->wpa_group;
- params.wpa_pairwise = hapd->conf->wpa_pairwise |
- hapd->conf->rsn_pairwise;
+ if ((hapd->conf->wpa & (WPA_PROTO_WPA | WPA_PROTO_RSN)) ==
+ (WPA_PROTO_WPA | WPA_PROTO_RSN))
+ params.wpa_pairwise = hapd->conf->wpa_pairwise |
+ hapd->conf->rsn_pairwise;
+ else if (hapd->conf->wpa & WPA_PROTO_RSN)
+ params.wpa_pairwise = hapd->conf->rsn_pairwise;
+ else if (hapd->conf->wpa & WPA_PROTO_WPA)
+ params.wpa_pairwise = hapd->conf->wpa_pairwise;
params.wpa_key_mgmt = hapd->conf->wpa_key_mgmt;
params.rsn_preauth = hapd->conf->rsn_preauth;
#ifdef CONFIG_IEEE80211W