3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-09 21:49:23 +01:00
Commit Graph

175 Commits

Author SHA1 Message Date
James Prestwood
3b801526f0 monitor: allow monitor to support other MIC lengths
Unfortunately there is no way to determine the MIC length just from the
eapol frame. 802.11 defined AKMs define the MIC length, but non 802.11
AKMs (e.g. OWE) can define their own MIC length. For this reason it seem
infeasable to track these special AKM's data flow to determine the MIC
length.

To work around this we can just try different MIC lengths (since there
are only 3 after all). This allows us to get key data length and see if
the total packet size equals the frame length + key data length. If the
sizes don't match we can try the next MIC length.
2019-01-17 15:20:28 -06:00
James Prestwood
374b367ba4 eapol: allow 16, 24 and 32 byte MIC lengths
The MIC length was hard coded to 16 bytes everywhere, and since several
AKMs require larger MIC's (24/32) this needed to change. The main issue
was that the MIC was hard coded to 16 bytes inside eapol_key. Instead
of doing this, the MIC, key_data_length, and key_data elements were all
bundled into key_data[0]. In order to retrieve the MIC, key_data_len,
or key_data several macros were introduced which account for the MIC
length provided.

A consequence of this is that all the verify functions inside eapol now
require the MIC length as a parameter because without it they cannot
determine the byte offset of key_data or key_data_length.

The MIC length for a given handshake is set inside the SM when starting
EAPoL. This length is determined by the AKM for the handshake.
2019-01-17 15:20:28 -06:00
Marcel Holtmann
5e31b194e2 monitor: List all enum values in switch statement 2018-12-07 09:04:36 +01:00
James Prestwood
22f4f2bc38 monitor: print OWE related info
Added support to print IE_TYPE_OWE_DH_PARAM element as well as added
the AKM suite string/type for OWE.
2018-11-16 16:20:59 -06:00
James Prestwood
35bce47022 monitor: allow printing extension IE's
print_ie was using a uint8_t for tag, which overflowed if the IE was an
extension type.
2018-11-16 16:20:59 -06:00
James Prestwood
c3785df735 monitor: fix indent on AKM types 2018-11-16 16:20:59 -06:00
Marcel Holtmann
5d9278913f monitor: Fix includes for using with -std=c99 compiler option 2018-11-01 22:19:11 +01:00
Marcel Holtmann
a9c2d71874 monitor: Use l_get_be16 and l_put_be16 instead of open coding it 2018-11-01 21:28:55 +01:00
Andreas Henriksson
d4064ea1b6 monitor: Fix spelling errors spotted by lintian
The debian package checking tool lintian spotted a bunch
of spelling errors in the built binaries.
2018-08-06 12:28:57 -05:00
John Zimmermann
37173350e2 monitor: move inclusion of linux headers after libc ones
to fix compilation against MUSL libc.
The struct ethhdr does exists in netinet/if_ether.h and linux/if_ether.h
so including the linux headers after the libc headers lets libc_compat.h
work as intended.
2018-05-17 17:34:08 -05:00
James Prestwood
5c5bfbb423 monitor: added scan/wiphy flags
Specifying --noscan will filter out any scan related packets
Specifying --nowiphy will filter out any "new wiphy" packets
2018-05-15 19:42:46 -05:00
Andrew Zaborowski
b55e080b21 nlmon: Update Auth Algorithm switch statement 2017-09-22 12:18:10 -05:00
Marcel Holtmann
af22a75fbb monitor: Include OUI value for AVM 2017-09-06 03:50:30 -07:00
Marcel Holtmann
fa98cee942 monitor: Fix minor typo 2017-09-06 03:15:46 -07:00
Andrew Zaborowski
76dd86d816 monitor: Use new mpdu.h structs
This may also fix displaying authentication and deauthentication frames.
2017-08-31 15:12:49 -05:00
Marcel Holtmann
1db66dbe51 monitor: Use extra unsigned variable to make NLMSG_OK macro happy 2017-08-30 22:56:23 +02:00
Tim Kourt
4d626d6576 monitor: Fix casting error
Fix for the cros-compilation with Chromium OS’s toolchain
that uses GCC 4.9
2017-08-23 16:26:05 -05:00
Andrew Zaborowski
e6765c1e9b monitor: Actually print management frame subtype
The subtype was only printed if mpdu_validate had returned an error for
the frame, i.e. would not be printed for well formed frames.  This was
probably an intent to avoid printing the frame subtype after all the
conents of the body frame had been printed already, but iwmon only
supports printing of Authentication and Deauthentication frames so far.
2017-08-15 15:18:40 -05:00
Marcel Holtmann
60bc0ecf22 monitor: Use temporary variable for RTA_PAYLOAD 2017-08-07 23:48:22 -07:00
Andrew Zaborowski
a01e57d1b2 monitor: Receive Preauthentication frames and log them
Use the same packet filter as in eapol.c
2017-04-18 11:43:59 -05:00
Mat Martineau
0e108f9727 monitor: Remove GENL_ID_GENERATE
Kernel v4.10 and later no longer export GENL_ID_GENERATE (which was
defined as 0). iwd was using this symbol to check for unmodified local
values rather than to ask for a dynamically generated netlink ID anyway,
so it makes sense to use the value 0 directly. This will work with
kernels before and after the GENL_ID_GENERATE change.
2017-04-14 15:52:11 -05:00
Marcel Holtmann
25a2ec7c11 monitor: Use PRIu64 for format modifier of uint64_t 2017-03-07 21:44:49 +01:00
Denis Kenzior
e5f12bd133 monitor: Pretty print WSC OS Version 2016-09-15 10:55:22 -05:00
Denis Kenzior
1ebf21de0b monitor: Pretty print various bytestream attributes 2016-09-15 10:55:04 -05:00
Denis Kenzior
fe7751ac43 monitor: Pretty print WSC Encryption Type Flags 2016-09-15 10:54:43 -05:00
Denis Kenzior
a175375cc5 monitor: Pretty print WSC Connection Type Flags 2016-09-15 10:54:16 -05:00
Denis Kenzior
4d7c98fa22 monitor: Pretty print WSC Authenticator 2016-09-15 10:53:52 -05:00
Denis Kenzior
260a666b4b monitor: Pretty print WSC authentication type flags 2016-09-15 10:53:29 -05:00
Denis Kenzior
1d9741bedc monitor: Pretty print WSC MAC Address 2016-09-14 22:15:23 -05:00
Denis Kenzior
2d80f03faf monitor: pretty print WSC Message Type 2016-09-14 22:07:52 -05:00
Denis Kenzior
1447c7fe03 monitor: pretty-print eap-wsc packets 2016-09-14 21:56:18 -05:00
Andrew Zaborowski
4a00c25241 iwmon: RX dBm is a signed integer 2016-09-05 22:46:53 -05:00
Andrew Zaborowski
a1f1046dcb iwmon: Fix PMKID display
Use unsigned to prevent the PMKID bytes being sign-extended.
2016-09-05 22:43:53 -05:00
Andrew Zaborowski
755605fddf iwmon: Fix RSN capability bit positions
The numbers displayed for other bits are 0-based.
2016-09-05 22:40:07 -05:00
Denis Kenzior
296eda2ee8 monitor: Print EAPoL packet headers
Previously we only printed EAPoL packets that were of type 'Key'.  With
this change, iwmon now prints all EAPoL packet headers.
2016-08-06 10:47:13 -05:00
Denis Kenzior
6ffbfeb897 monitor: Dump WSC IEs in association response 2016-08-05 16:51:25 -05:00
Denis Kenzior
d6a9b0f85a monitor: Add option to not print rtnl output 2016-07-13 10:14:28 -05:00
Andrew Zaborowski
ef9b6f41ce eapol: Separate EAPOL header from struct eapol_key
This is needed so we can better handle sending and receiving EAPoL
packets other than EAPoL-Key.
2015-11-02 21:40:21 -06:00
Denis Kenzior
7f52c8ec9d monitor: Fix unused variable error 2015-10-06 15:25:30 -05:00
Denis Kenzior
9be930442c monitor: Dump WIPHY_BANDS attribute 2015-10-06 14:33:18 -05:00
Denis Kenzior
e055460709 wsc: Rename wsc.[ch] to wscutil.[ch] 2015-09-10 23:07:34 -05:00
Denis Kenzior
3e927ea6c9 nlmon: Fix up bitwise logic
The flags in question contain multiple set bits.  So we should only
print the relevant details if all bits are set, not just one of the
bits.
2015-09-09 08:52:49 -05:00
Denis Kenzior
913bf61447 nlmon: print NetworkKeyShareable, RequestToEnroll 2015-09-07 09:36:42 -05:00
Denis Kenzior
7cb5a83732 monitor: Print WSC WFA extended attributes
Introduced in Version 2.0 of the spec
2015-09-07 09:34:53 -05:00
Denis Kenzior
410d74f772 nlmon: Pretty print WSC_ATTR_CONFIGURATION_ERROR 2015-09-02 13:37:50 -05:00
Denis Kenzior
312ff46f88 nlmon: Pretty-print WSC_ATTR_ASSOCIATION_STATE 2015-09-01 17:19:42 -05:00
Denis Kenzior
0496a79eea nlmon: Print WSC_ATTR_REQUEST_TYPE 2015-09-01 17:10:41 -05:00
Denis Kenzior
a6a26cfe7f nlmon: Print WSC frames in other IE elements
Trigger Scan Event, Trigger Scan Requests, etc.
2015-09-01 16:58:41 -05:00
Denis Kenzior
add4458a32 nlmon: Print human-readable reason-code 2015-09-01 16:48:50 -05:00
Denis Kenzior
f912e63df5 nlmon: decode RF_BANDS attributes 2015-07-24 21:23:29 -05:00