From 95b6bca66de9dc0a2ddd9164ec052a7d5f58804b Mon Sep 17 00:00:00 2001 From: Darshan Paranji Sri Date: Tue, 3 Jun 2014 12:48:05 +0300 Subject: [PATCH] Add rsn_pairwise bits to set_ieee8021x() driver_ops This fixes an issue where a driver using the deprecated set_ieee8021x() callback did not include rsn_pairwise bits in the driver configuration even if mixed WPA+WPA2 configuration was used. This could result, e.g., in CCMP not being enabled properly when wpa_pairwise=TKIP and rsn_pairwise=CCMP was used in the configuration. Fix this by using bitwise OR of the wpa_pairwise and rsn_pairwise values to allow the driver to enable all pairwise ciphers. In addition, make the newer set_ap() driver_ops use the same bitwise OR design instead of picking between rsn_pairwise and wpa_pairwise. This makes the code paths consistent and can also fix issues with mixed mode configuration with set_ap(). Signed-off-by: Jouni Malinen --- src/ap/ap_drv_ops.c | 3 ++- src/ap/beacon.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 6d3ae5a79..cc4ac102a 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -280,7 +280,8 @@ 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; + params.wpa_pairwise = hapd->conf->wpa_pairwise | + hapd->conf->rsn_pairwise; params.wpa_key_mgmt = hapd->conf->wpa_key_mgmt; params.rsn_preauth = hapd->conf->rsn_preauth; #ifdef CONFIG_IEEE80211W diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 27525dc62..2a4acf241 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -882,8 +882,8 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd, params->basic_rates = hapd->iface->basic_rates; params->ssid = hapd->conf->ssid.ssid; params->ssid_len = hapd->conf->ssid.ssid_len; - params->pairwise_ciphers = hapd->conf->rsn_pairwise ? - hapd->conf->rsn_pairwise : hapd->conf->wpa_pairwise; + params->pairwise_ciphers = hapd->conf->wpa_pairwise | + hapd->conf->rsn_pairwise; params->group_cipher = hapd->conf->wpa_group; params->key_mgmt_suites = hapd->conf->wpa_key_mgmt; params->auth_algs = hapd->conf->auth_algs;