aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
Commit message (Collapse)AuthorAgeFilesLines
* wlantest: Fix RSNE check in FT 4-way handshake msg 3/4Jouni Malinen2020-05-251-1/+14
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Validate FT elements in Reassociation Response frameJouni Malinen2020-05-231-10/+437
| | | | | | | | Verify that RSNE, MDE, and FTE have valid information in FT Reassociation Response frames. In addition, decrypt GTK, IGTK, and BIGTK from the frame. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Validate FT elements in Reassociation Request frameJouni Malinen2020-05-232-4/+180
| | | | | | | Verify that RSNE, MDE, and FTE have valid information in FT Reassociation Request frames. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Store PMK-R1 in STA entryJouni Malinen2020-05-233-27/+24
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Store PMK-R0 length explicitlyJouni Malinen2020-05-233-10/+17
| | | | | | PMK-R0 is not of fixed length, so store its length explicitly. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Handle FT over-the-DS association state update cleanlyJouni Malinen2020-05-232-3/+5
| | | | | | | | | It is expected for the STA entry on the target AP to move directly from State 1 to State 3 when performing FT over-the-DS (i.e., FT Action Request/Response frame exchange through the old AP followed by Reassociation Request/Response frame exchange with the target AP). Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Do not include rt library for OS X buildsJouni Malinen2020-04-051-0/+4
| | | | | | | That is not needed or available by default, so simply drop it from the build. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Link without libwlantestJouni Malinen2020-04-051-26/+9
| | | | | | | | The ar operations with embedded libraries were not exactly portable or strictly speaking necessary. Drop that library completely to make this more portable. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Comment out Linux packet socket from OS X buildJouni Malinen2020-04-051-0/+24
| | | | | | | For now, allow wlantest to be built on OS X without support for live sniffer capturing. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Comment out ICMP processing from OS X buildsJouni Malinen2020-04-051-0/+6
| | | | | | For now, allow this to be compiled without ICMP support. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Use BSD compatible UDP header structJouni Malinen2020-04-051-3/+3
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Add frame number fo replay detected messagesJouni Malinen2020-04-031-4/+4
| | | | | | This makes it easier to find the relevant frames. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Remove duplicate PN/RSC prints from replay casesJouni Malinen2020-04-031-4/+0
| | | | | | | | The PN and RSC are already printed in the "replay detected" debug message so there is no point in having separate hexdumps of the same values immediately after that. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Add debug print with frame number for decryption failuresJouni Malinen2020-04-031-3/+14
| | | | | | | This makes it more convenient to find the frames that could not be decrypted. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Do not report decryption failures for WEP keys if no keysJouni Malinen2020-04-031-2/+3
| | | | | | | If no WEP keys are available, there is not going to be an attempt to decrypt the frame, so don't claim decryption failed. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Update PTK after rekeying even if EAPOL-Key msg 4/4 is missingJouni Malinen2020-04-011-12/+39
| | | | | | | | | Update TPTK to PTK if a valid EAPOL-Key msg 2/4 and 3/4 are available, but 4/4 is missing. This avoids certain cases where the new TK could be derived, but it was not being used to try to decrypt following encrypted frames. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wlantest: Do not report decryption keys when checking only zero TKJouni Malinen2020-04-011-2/+4
| | | | | | | | | All the "Failed to decrypt frame" debug prints were confusing since those were not supposed to be shown unless there were one or more real TKs available. The recently added check for zero TK added these notes for that case which is not really correct, so get rid of them. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wlantest: Check for zero TK even when the real PTK is not knownJouni Malinen2020-03-231-4/+19
| | | | | | | This makes it easier to analyze certain encryption issues. Also print out an error at the default INFO debug verbosity with the frame number. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wlantest: Basic Extended Key ID supportAlexander Wetzel2020-03-153-5/+14
| | | | Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
* wlantest: Do not report PMF failure without BSS supporting PMFJouni Malinen2020-03-141-1/+2
| | | | | | | | | | Previously, missing CCMP protection on Robust Management frames was reported based on the STA having indicated MFPC=1. That is not accurate since the AP/BSS may have MFPC=0. Report this failure only if both the AP and STA have indicated MFPC=1, i.e., when PMF has been negotiated for the association. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Detect and report plaintext payload in protected framesJouni Malinen2020-03-143-0/+21
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Try to decrypt frame with zero TKJouni Malinen2020-02-281-21/+48
| | | | | | | If none of the known PTKs have a working TK, check whether an encrypted frame is encrypted with all zeros TK. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Add more notes about decryption into pcapngJouni Malinen2020-02-271-16/+57
| | | | | | | Note the used TK/GTK and KeyID in frame notes when writing decrypted frames to a PCAPNG file. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Update BSS IEs based on EAPOL-Key msg 3/4Jouni Malinen2020-02-275-24/+49
| | | | | | | If no Beacon or Probe Response frame has been seen in the capture, use the IEs from EAPOL-Key msg 3/4 to set up BSS information. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Get STA IEs based on EAPOL-Key msg 2/4 before PTK derivationJouni Malinen2020-02-273-31/+31
| | | | | | | | | | | | | The previous implementation tried to update STA IE information based on EAPOL-Key msg 2/4 to be able to handle captures that do not include the (Re)Association Request frame. This was not sufficient (OSEN was not included) and was done too late (the parsed information is needed for PMK-to-PTK derivation). Move the IE update step to happen before trying to derive the PTK if no (Re)Association Request frame has been seen. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: BIGTK fetching and Beacon protection validationJouni Malinen2020-02-213-3/+132
| | | | | | | Fetch the BIGTK from EAPOL-Key msg 3/4 and use it to validate MME in Beacon frames when the AP uses Beacon protection. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wlantest: Add PTK derivation support with SAE, OWE, DPPJouni Malinen2020-02-101-0/+4
| | | | | | | | | wlantest build did not define build options to determine key management values for SAE, OWE, and DPP. Add those and the needed SHA512 functions to be able to decrypt sniffer captures with PMK available from an external source. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* BSD: Use struct ip rather than struct iphdrRoy Marples2020-01-022-34/+35
| | | | | | | As we define __FAVOR_BSD use the BSD IP header. Compile tested on NetBSD, DragonFlyBSD, and Linux. Signed-off-by: Roy Marples <roy@marples.name>
* wlantest: Ethernet interface captureJouni Malinen2019-12-274-9/+20
| | | | | | | | Allow option (command line argument -e) to capture Ethernet headers instead of IEEE 802.11 so that wlantest can be used as a replacement for tcpdump/dumpcap for capturing. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Process VLAN tagged Data framesJouni Malinen2019-09-201-0/+27
| | | | | | | This allows Data frames to be fully processed for the case where VLAN tags are used on the wireless link. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Remove CONFIG_IEEE80211W build parameterJouni Malinen2019-09-081-1/+0
| | | | | | | | | Hardcode this to be defined and remove the separate build options for PMF since this functionality is needed with large number of newer protocol extensions and is also something that should be enabled in all WPA2/WPA3 networks. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Derive PMK-R1 and PTK for FT protocol casesJouni Malinen2019-08-223-10/+234
| | | | | | | | Track PMK-R0/PMK-R0-Name from the initial mobility domain association and derive PMK-R1/PTK when the station uses FT protocol. This allows frames from additional roaming cases to be decrypted. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wlantest: Allow duplicate frame processing after decryption failureJouni Malinen2019-06-124-3/+20
| | | | | | | | | | | | | | If a sniffer capture does not include FCS for each frame, but may included frames with invalid FCS, it would be possible for wlantest to try to decrypt the first received frame and fail (e.g., due to CCMP MIC mismatch) because that particular frame was corrupted and then ignore the following retry of that frame as a duplicate even if that retry has different payload (e.g., if its reception did not show corruption). Work around this by skipping duplicate frame detection immediately following a decryption failure. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* DPP2: Extend wpa_pmk_to_ptk() to support extra Z.x component in contextJouni Malinen2019-03-171-1/+1
| | | | | | | | | | DPP allows Diffie-Hellman exchange to be used for PFS in PTK derivation. This requires an additional Z.x (x coordinate of the DH shared secret) to be passed to wpa_pmk_to_ptk(). This commit adds that to the function and updates all the callers to pass NULL,0 for that part in preparation of the DPP specific changes to start using this. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* tests: Remove CONFIG_PEERKEYLubomir Rintel2019-02-251-1/+0
| | | | | | | The functionality has been removed in commit a0bf1b68c03 ('Remove all PeerKey functionality'). Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
* OCV: Add wlantest support for indicating OCVMathy Vanhoef2018-12-164-4/+16
| | | | | | Add wlantest parsing of the OCV RSN cpability flag. Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
* FT: FTE parsing for SHA384-based AKMJouni Malinen2018-06-051-1/+1
| | | | | | | The MIC field is now a variable length field, so make the FTE parser aware of the two different field lengths. Signed-off-by: Jouni Malinen <j@w1.fi>
* FT: PMK-R0 derivation using SHA384-based AKMJouni Malinen2018-06-051-1/+1
| | | | Signed-off-by: Jouni Malinen <j@w1.fi>
* FT: Support variable length keysJouni Malinen2018-06-051-2/+2
| | | | | | This is a step in adding support for SHA384-based FT AKM. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Try harder to find a STA entry with PTK for 4-address framesJouni Malinen2017-12-081-3/+6
| | | | | | | | | | | | | | Commit aab66128369c5953e70f867e997a54146bcca88b ('wlantest: Search bss/sta entry more thoroughly for 4-address frames') allowed wlantest to find a STA entry in this type of cases, but it was still possible for that STA entry to be the one that has no derived PTK while the STA entry for the other side of the link might have the derived PTK available. Extend this BSS/STA selection mechanism to use sta->ptk_set to determine which STA entry is more useful for decryption, i.e., select the one with a known PTK. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: Search bss/sta entry more thoroughly for 4-address framesJouni Malinen2017-11-151-2/+16
| | | | | | | | | | | | | Previous design worked for the case where only one of the devices was beaconing, but failed in one direction to find the PTK if both devices beaconed. Fix this by checking the A1/A2 fields in both directions if the first pick fails to find the sta entry. In addition, select the proper rsc value (rsc_tods vs. rsc_fromds) based on A2 (TA) value for ToDS+FromDS frames to avoid reporting incorrect replay issues. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: Do not ignore RSN/WPA/OSEN element before full BSS infoJouni Malinen2017-11-143-3/+8
| | | | | | | | | | wlantest used to ignore RSN/WPA/OSEN element in (Re)Association Request frame if no Beacon frame had been seen from the AP before the association exchange. This could result in not being able to derive keys properly. Work around this by skipping that step if the BSS entry is not yet complete. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: Remove unnecessary duplication of tk_len from STA entriesJouni Malinen2017-11-143-4/+2
| | | | | | | The length of the TK is available within struct wpa_ptk, so there is no need to try to maintain it separately in wlantest. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: Do not update RSC on replaysJouni Malinen2017-10-161-2/+8
| | | | | | | | | | | This changes wlantest behavior to mark CCMP/TKIP replays for more cases in case a device is resetting its TSC. Previously, the RSC check got cleared on the first marked replay and the following packets were not marked as replays if they continued incrementing the PN even if that PN was below the highest value received with this key at some point in the past. Signed-off-by: Jouni Malinen <j@w1.fi>
* wlantest: Add support for decrypting 4-address Data framesJouni Malinen2017-10-061-13/+31
| | | | | | | This covers the case where 4-address Data frames are exchanged between an AP and an associated station. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* FILS: Add DHss into FILS-Key-Data derivation when using FILS SK+PFSJouni Malinen2017-09-131-1/+2
| | | | | | | | | | | | | | | | | This part is missing from IEEE Std 802.11ai-2016, but the lack of DHss here means there would not be proper PFS for the case where PMKSA caching is used with FILS SK+PFS authentication. This was not really the intent of the FILS design and that issue was fixed during REVmd work with the changes proposed in https://mentor.ieee.org/802.11/dcn/17/11-17-0906-04-000m-fils-fixes.docx that add DHss into FILS-Key-Data (and PTK, in practice) derivation for the PMKSA caching case so that a unique ICK, KEK, and TK are derived even when using the same PMK. Note: This is not backwards compatible, i.e., this breaks PMKSA caching with FILS SK+PFS if only STA or AP side implementation is updated. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: FILS keys and (Re)Association Request/Response framesJouni Malinen2017-09-052-8/+313
| | | | | | | | | | | | Try to derive PTK when FILS shared key authentication is used without PFS. The list of available PMKs is interpreted as rMSK for this purpose and PMK and PTK is derived from that. If the resulting PTK (KEK) can be used to decrypt the encrypted parts of (Re)Association Request/Response frames, mark the PTK as derived so that encrypted frames during the association can be decrypted. In addition, write a decrypted version of the (Re)Association Request/Response frames into the output file. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: Support variable length PMKJouni Malinen2017-09-055-24/+37
| | | | | | | This is needed to be able to handle key derivation for FILS authentication. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wlantest: Build helper files with FILS support includedJouni Malinen2017-09-051-0/+1
| | | | | | | wlantest needs this for being able to decrypt FILS (Re)Association Request/Response frames. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* DPP: Add new AKMJouni Malinen2017-06-191-6/+6
| | | | | | | | | | This new AKM is used with DPP when using the signed Connector to derive a PMK. Since the KCK, KEK, and MIC lengths are variable within a single AKM, this needs number of additional changes to get the PMK length delivered to places that need to figure out the lengths of the PTK components. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>