Skip to content

Commit

Permalink
brcmfmac: reject too long PSK
Browse files Browse the repository at this point in the history
nl80211 already allows specifying 48 bytes, but brcmfmac
only supports 32. Reject keys that are too long.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Johannes Berg authored and Kalle Valo committed Feb 27, 2018
1 parent 2d6edad commit 64d1519
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
Original file line number Diff line number Diff line change
@@ -5124,6 +5124,9 @@ static int brcmf_cfg80211_set_pmk(struct wiphy *wiphy, struct net_device *dev,
if (WARN_ON(ifp->vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_1X))
return -EINVAL;

if (conf->pmk_len > BRCMF_WSEC_MAX_PSK_LEN)
return -ERANGE;

return brcmf_set_pmk(ifp, conf->pmk, conf->pmk_len);
}

0 comments on commit 64d1519

Please sign in to comment.