Add rsn_pairwise bits to set_ieee8021x() driver_ops
authorDarshan Paranji Sri <dparanji@qti.qualcomm.com>
Tue, 3 Jun 2014 09:48:05 +0000 (12:48 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 3 Jun 2014 10:59:22 +0000 (13:59 +0300)
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 <jouni@qca.qualcomm.com>
src/ap/ap_drv_ops.c
src/ap/beacon.c

index 6d3ae5a..cc4ac10 100644 (file)
@@ -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
index 27525dc..2a4acf2 100644 (file)
@@ -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;