diff options
author | Jouni Malinen <j@w1.fi> | 2015-04-19 13:38:11 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2015-04-22 19:05:11 (GMT) |
commit | b39a05913a0cdec54cbe854385fb6e8a63d05be6 (patch) | |
tree | 0ecc7abc09d7e3dfc517f60df3e06ddcd0c703b8 /wlantest | |
parent | e8997b94075f1faa1fda1d4d7bb23b7cd300de11 (diff) | |
download | hostap-b39a05913a0cdec54cbe854385fb6e8a63d05be6.zip hostap-b39a05913a0cdec54cbe854385fb6e8a63d05be6.tar.gz hostap-b39a05913a0cdec54cbe854385fb6e8a63d05be6.tar.bz2 |
Simplify Timeout Interval element parsing
Remove the length field from struct ieee802_11_elems since the only
allowed element length is five and that is checked by the parser.
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest')
-rw-r--r-- | wlantest/rx_mgmt.c | 2 | ||||
-rw-r--r-- | wlantest/rx_tdls.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index 459b9a6..45433dd 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -348,7 +348,6 @@ static void rx_mgmt_assoc_resp(struct wlantest *wt, const u8 *data, size_t len) "AssocResp from " MACSTR, MAC2STR(mgmt->sa)); } else if (elems.timeout_int == NULL || - elems.timeout_int_len != 5 || elems.timeout_int[0] != WLAN_TIMEOUT_ASSOC_COMEBACK) { add_note(wt, MSG_INFO, "No valid Timeout Interval IE " @@ -481,7 +480,6 @@ static void rx_mgmt_reassoc_resp(struct wlantest *wt, const u8 *data, "ReassocResp from " MACSTR, MAC2STR(mgmt->sa)); } else if (elems.timeout_int == NULL || - elems.timeout_int_len != 5 || elems.timeout_int[0] != WLAN_TIMEOUT_ASSOC_COMEBACK) { add_note(wt, MSG_INFO, "No valid Timeout Interval IE " diff --git a/wlantest/rx_tdls.c b/wlantest/rx_tdls.c index f059e8d..0c012a9 100644 --- a/wlantest/rx_tdls.c +++ b/wlantest/rx_tdls.c @@ -147,7 +147,7 @@ static int tdls_verify_mic(struct wlantest *wt, struct wlantest_tdls *tdls, return -1; len = 2 * ETH_ALEN + 1 + 2 + 18 + 2 + elems->rsn_ie_len + - 2 + elems->timeout_int_len + 2 + elems->ftie_len; + 2 + 5 + 2 + elems->ftie_len; buf = os_zalloc(len); if (buf == NULL) @@ -169,8 +169,8 @@ static int tdls_verify_mic(struct wlantest *wt, struct wlantest_tdls *tdls, os_memcpy(pos, elems->rsn_ie - 2, 2 + elems->rsn_ie_len); pos += 2 + elems->rsn_ie_len; /* 6) Timeout Interval IE */ - os_memcpy(pos, elems->timeout_int - 2, 2 + elems->timeout_int_len); - pos += 2 + elems->timeout_int_len; + os_memcpy(pos, elems->timeout_int - 2, 2 + 5); + pos += 2 + 5; /* 7) FTIE, with the MIC field of the FTIE set to 0 */ os_memcpy(pos, elems->ftie - 2, 2 + elems->ftie_len); pos += 2; |