Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64d1519e authored by Johannes Berg's avatar Johannes Berg Committed by Kalle Valo
Browse files

brcmfmac: reject too long PSK



nl80211 already allows specifying 48 bytes, but brcmfmac
only supports 32. Reject keys that are too long.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Acked-by: default avatarArend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 2d6edad4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
}