mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
netdev: work around APs that send igtk in big endian
It seems some APs send the IGTK key in big endian format (it is a uin16). The kernel rightly reports an -EINVAL error when iwd issues a NEW_KEY with such a value, resulting in the connection being aborted. Work around this by trying to detect big-endian key indexes and 'fixing' them up.
This commit is contained in:
parent
5576722d29
commit
aba3da32ac
@ -1297,6 +1297,14 @@ static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index,
|
||||
return;
|
||||
}
|
||||
|
||||
if (key_index == 0x0400 || key_index == 0x0500) {
|
||||
l_warn("Received an invalid IGTK key index (%04hx)"
|
||||
" that is likely in"
|
||||
" big endian format. Trying to fix and"
|
||||
" proceed anyway", key_index);
|
||||
key_index = bswap_16(key_index);
|
||||
}
|
||||
|
||||
msg = nl80211_build_new_key_group(netdev->index, cipher, key_index,
|
||||
igtk_buf, igtk_len, ipn, ipn_len, NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user