Commit c5bf53a8 authored by Hante Meuleman's avatar Hante Meuleman Committed by John W. Linville

brcmfmac: fix returning cipher_suite for get_key operation.

When multiple cipher suites have been programmed then the lowest
suite is to be retured. This fixes issue when AP mode is using
CCMP and TKIP WPA combination where rekeying will fail.
Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarPiotr Haber <phaber@broadcom.com>
Signed-off-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5c33a942
...@@ -2121,8 +2121,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2121,8 +2121,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
err = -EAGAIN; err = -EAGAIN;
goto done; goto done;
} }
switch (wsec & ~SES_OW_ENABLED) { if (wsec & WEP_ENABLED) {
case WEP_ENABLED:
sec = &profile->sec; sec = &profile->sec;
if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) { if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) {
params.cipher = WLAN_CIPHER_SUITE_WEP40; params.cipher = WLAN_CIPHER_SUITE_WEP40;
...@@ -2131,16 +2130,13 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2131,16 +2130,13 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev,
params.cipher = WLAN_CIPHER_SUITE_WEP104; params.cipher = WLAN_CIPHER_SUITE_WEP104;
brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n"); brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n");
} }
break; } else if (wsec & TKIP_ENABLED) {
case TKIP_ENABLED:
params.cipher = WLAN_CIPHER_SUITE_TKIP; params.cipher = WLAN_CIPHER_SUITE_TKIP;
brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n"); brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n");
break; } else if (wsec & AES_ENABLED) {
case AES_ENABLED:
params.cipher = WLAN_CIPHER_SUITE_AES_CMAC; params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n"); brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n");
break; } else {
default:
brcmf_err("Invalid algo (0x%x)\n", wsec); brcmf_err("Invalid algo (0x%x)\n", wsec);
err = -EINVAL; err = -EINVAL;
goto done; goto done;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment