aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2015-03-17 11:00:54 -0700
committerDmitry Shmidt <dimitrysh@google.com>2015-03-17 11:03:19 -0700
commitf73259cc00af557e36add405799b7f2326587c13 (patch)
tree3d2217c2850c5b07e542509f00426e8b69e44b88 /src/common
parent4dd28dc25895165566a1c8a9cac7bcd755ff8fe3 (diff)
downloadandroid_external_wpa_supplicant_8-f73259cc00af557e36add405799b7f2326587c13.tar.gz
android_external_wpa_supplicant_8-f73259cc00af557e36add405799b7f2326587c13.tar.bz2
android_external_wpa_supplicant_8-f73259cc00af557e36add405799b7f2326587c13.zip
Cumulative patch from commit 0b08f25445caacb502c394e917a292d7fa595447
0b08f25 wpa_gui: Documentation update 6128a90 hostapd: Add channel 140 to allowed HT40 channel pairs 8ffaafa wpa_cli: Add missing parameters for "set" command completion routine 0fd9d95 wpa_cli: Add completion routine for "get" command 5c6c315 Add IPv4 support function for "get" control interface command 74fa78b Add AVG_BEACON_RSSI to SIGNAL_POLL output 4acdc48 nl80211: Handle NL80211_ATTR_EXT_FEATURES attribute a0563ac Sync with mac80211-next.git include/uapi/linux/nl80211.h 0f89328 P2P: Move upper layer SD interaction into a separate file 8b94980 FT: Avoid unnecessary allocation for MIC calculation 18da814 The master branch is now used for v2.5 development bc04db9 Change version information for the 2.4 release bc1d23a Add ChangeLog entries for v2.4 319d9da Fix bitfield_get_first_zero() to not read beyond buffer 39c3bfc Indicate AP-DISABLED on main AP mode deinit path f10487e Send CTRL-EVENT-DISCONNECTED on wpa_supplicant AP deinit Change-Id: I0b8459261265a25fe0edd7b435ede32be3cc6616 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'src/common')
-rw-r--r--src/common/hw_features_common.c4
-rw-r--r--src/common/version.h2
-rw-r--r--src/common/wpa_common.c76
3 files changed, 47 insertions, 35 deletions
diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c
index e8babb52..309215e5 100644
--- a/src/common/hw_features_common.c
+++ b/src/common/hw_features_common.c
@@ -88,8 +88,8 @@ int allowed_ht40_channel_pair(struct hostapd_hw_modes *mode, int pri_chan,
int sec_chan)
{
int ok, j, first;
- int allowed[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
- 184, 192 };
+ int allowed[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 140,
+ 149, 157, 184, 192 };
size_t k;
if (pri_chan == sec_chan || !sec_chan)
diff --git a/src/common/version.h b/src/common/version.h
index c662270e..5ddf6175 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -5,6 +5,6 @@
#define VERSION_STR_POSTFIX ""
#endif /* VERSION_STR_POSTFIX */
-#define VERSION_STR "2.4-devel" VERSION_STR_POSTFIX
+#define VERSION_STR "2.5-devel" VERSION_STR_POSTFIX
#endif /* VERSION_H */
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index de81d536..5534eab4 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -207,8 +207,10 @@ int wpa_ft_mic(const u8 *kck, size_t kck_len, const u8 *sta_addr,
const u8 *rsnie, size_t rsnie_len,
const u8 *ric, size_t ric_len, u8 *mic)
{
- u8 *buf, *pos;
- size_t buf_len;
+ const u8 *addr[9];
+ size_t len[9];
+ size_t i, num_elem = 0;
+ u8 zero_mic[16];
if (kck_len != 16) {
wpa_printf(MSG_WARNING, "FT: Unsupported KCK length %u",
@@ -216,48 +218,58 @@ int wpa_ft_mic(const u8 *kck, size_t kck_len, const u8 *sta_addr,
return -1;
}
- buf_len = 2 * ETH_ALEN + 1 + mdie_len + ftie_len + rsnie_len + ric_len;
- buf = os_malloc(buf_len);
- if (buf == NULL)
- return -1;
+ addr[num_elem] = sta_addr;
+ len[num_elem] = ETH_ALEN;
+ num_elem++;
+
+ addr[num_elem] = ap_addr;
+ len[num_elem] = ETH_ALEN;
+ num_elem++;
+
+ addr[num_elem] = &transaction_seqnum;
+ len[num_elem] = 1;
+ num_elem++;
- pos = buf;
- os_memcpy(pos, sta_addr, ETH_ALEN);
- pos += ETH_ALEN;
- os_memcpy(pos, ap_addr, ETH_ALEN);
- pos += ETH_ALEN;
- *pos++ = transaction_seqnum;
if (rsnie) {
- os_memcpy(pos, rsnie, rsnie_len);
- pos += rsnie_len;
+ addr[num_elem] = rsnie;
+ len[num_elem] = rsnie_len;
+ num_elem++;
}
if (mdie) {
- os_memcpy(pos, mdie, mdie_len);
- pos += mdie_len;
+ addr[num_elem] = mdie;
+ len[num_elem] = mdie_len;
+ num_elem++;
}
if (ftie) {
- struct rsn_ftie *_ftie;
- os_memcpy(pos, ftie, ftie_len);
- if (ftie_len < 2 + sizeof(*_ftie)) {
- os_free(buf);
+ if (ftie_len < 2 + sizeof(struct rsn_ftie))
return -1;
- }
- _ftie = (struct rsn_ftie *) (pos + 2);
- os_memset(_ftie->mic, 0, sizeof(_ftie->mic));
- pos += ftie_len;
+
+ /* IE hdr and mic_control */
+ addr[num_elem] = ftie;
+ len[num_elem] = 2 + 2;
+ num_elem++;
+
+ /* MIC field with all zeros */
+ os_memset(zero_mic, 0, sizeof(zero_mic));
+ addr[num_elem] = zero_mic;
+ len[num_elem] = sizeof(zero_mic);
+ num_elem++;
+
+ /* Rest of FTIE */
+ addr[num_elem] = ftie + 2 + 2 + 16;
+ len[num_elem] = ftie_len - (2 + 2 + 16);
+ num_elem++;
}
if (ric) {
- os_memcpy(pos, ric, ric_len);
- pos += ric_len;
+ addr[num_elem] = ric;
+ len[num_elem] = ric_len;
+ num_elem++;
}
- wpa_hexdump(MSG_MSGDUMP, "FT: MIC data", buf, pos - buf);
- if (omac1_aes_128(kck, buf, pos - buf, mic)) {
- os_free(buf);
+ for (i = 0; i < num_elem; i++)
+ wpa_hexdump(MSG_MSGDUMP, "FT: MIC data", addr[i], len[i]);
+ if (omac1_aes_128_vector(kck, num_elem, addr, len, mic))
return -1;
- }
-
- os_free(buf);
return 0;
}