nl80211: Fix control port protocol no-encrypt setting
authorJohannes Berg <johannes.berg@intel.com>
Wed, 17 Aug 2016 09:40:25 +0000 (11:40 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 17 Aug 2016 10:40:40 +0000 (13:40 +0300)
commite3429c0b15d37a5a0aca877469306f5de123c947
tree97a699f85dafb9892ae3b2b46cdc5b9b83828f90
parente5d3e13a5c2f3e053c48c1e2b0a310a50219e907
nl80211: Fix control port protocol no-encrypt setting

Previously, driver_nl80211 sets NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT in
AP mode, to get EAPOL frames out unencrypted when using IEEE 802.1X/WEP.
However, due to the way nl80211/cfg80211 is implemented, this attribute
is ignored by the kernel if NL80211_ATTR_CONTROL_PORT_ETHERTYPE isn't
specified as well. Fix this by including
NL80211_ATTR_CONTROL_PORT_ETHERTYPE set to ETH_P_PAE. This can be done
unconditionally, since the kernel will allow ETH_P_PAE to be set even
when the driver didn't advertise support for arbitrary ethertypes.

Additionally, the params->pairwise_ciphers appear to not be set at
this point, so relax the check and allow them to be zero.

In client mode, this whole thing was missing, so add it. Again, the
pairwise suite can be WPA_CIPHER_NONE, so allow that case as well.

This fixed IEEE 802.1X/WEP EAP reauthentication and rekeying to use
unencrypted EAPOL frames which is the de facto way of implementing this
in wireless networks.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
src/drivers/driver_nl80211.c