[tools] mm-macros: update to 0.9.5
[openwrt.git] / package / hostapd / patches / 320-madwifi_key_fixes.patch
1 --- a/src/drivers/driver_madwifi.c
2 +++ b/src/drivers/driver_madwifi.c
3 @@ -459,7 +459,9 @@ wpa_driver_madwifi_set_key(const char *i
4
5 memset(&wk, 0, sizeof(wk));
6 wk.ik_type = cipher;
7 - wk.ik_flags = IEEE80211_KEY_RECV | IEEE80211_KEY_XMIT;
8 + wk.ik_flags = IEEE80211_KEY_RECV;
9 + if (set_tx)
10 + wk.ik_flags |= IEEE80211_KEY_XMIT;
11 if (addr == NULL || is_broadcast_ether_addr(addr)) {
12 memset(wk.ik_macaddr, 0xff, IEEE80211_ADDR_LEN);
13 wk.ik_keyix = key_idx;
14 @@ -471,6 +473,20 @@ wpa_driver_madwifi_set_key(const char *i
15 wk.ik_keylen = key_len;
16 memcpy(wk.ik_keydata, key, key_len);
17
18 +#ifdef WORDS_BIGENDIAN
19 +#define WPA_KEY_RSC_LEN 8
20 + {
21 + size_t i;
22 + u8 tmp[WPA_KEY_RSC_LEN];
23 + os_memset(tmp, 0, sizeof(tmp));
24 + for (i = 0; i < seq_len; i++)
25 + tmp[WPA_KEY_RSC_LEN - i - 1] = seq[i];
26 + os_memcpy(&wk.ik_keyrsc, tmp, WPA_KEY_RSC_LEN);
27 + }
28 +#else /* WORDS_BIGENDIAN */
29 + os_memcpy(&wk.ik_keyrsc, seq, seq_len);
30 +#endif /* WORDS_BIGENDIAN */
31 +
32 ret = set80211priv(drv, IEEE80211_IOCTL_SETKEY, &wk, sizeof(wk));
33 if (ret < 0) {
34 wpa_printf(MSG_DEBUG, "%s: Failed to set key (addr %s"
This page took 0.036585 seconds and 5 git commands to generate.