From: Jouni Malinen Date: Sun, 7 Feb 2021 10:30:03 +0000 (+0200) Subject: wlantest: Recognize the FTM bit in the CCMP Key ID octet X-Git-Tag: hostap_2_10~617 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9fd8191a54218c882e4658f495593be08e56774;p=thirdparty%2Fhostap.git wlantest: Recognize the FTM bit in the CCMP Key ID octet This previously reserved bit is now used in FTM to help select the appropriate replay counter. Silence the warning about use of a reserved bit for this. wlantest does not yet support the actual replay counter processing for FTM. Signed-off-by: Jouni Malinen --- diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c index 92d66b0f8..4c243f97e 100644 --- a/wlantest/rx_mgmt.c +++ b/wlantest/rx_mgmt.c @@ -2201,8 +2201,11 @@ static u8 * mgmt_ccmp_decrypt(struct wlantest *wt, const u8 *data, size_t len, int keyid; u8 *decrypted, *frame = NULL; u8 pn[6], *rsc; + u16 fc; + u8 mask; hdr = (const struct ieee80211_hdr *) data; + fc = le_to_host16(hdr->frame_control); if (len < 24 + 4) return NULL; @@ -2214,7 +2217,11 @@ static u8 * mgmt_ccmp_decrypt(struct wlantest *wt, const u8 *data, size_t len, return NULL; } - if (data[24 + 2] != 0 || (data[24 + 3] & 0x1f) != 0) { + mask = 0x1f; + if (WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION || + WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_ACTION_NO_ACK) + mask &= ~0x10; /* FTM */ + if (data[24 + 2] != 0 || (data[24 + 3] & mask) != 0) { add_note(wt, MSG_INFO, "CCMP mgmt frame from " MACSTR " used " "non-zero reserved bit", MAC2STR(hdr->addr2)); }