Commit Graph

241 Commits

Author SHA1 Message Date
Denis Kenzior 7397903234 monitor: Fix unused variable warning 2019-10-17 12:36:44 -05:00
Denis Kenzior e4dc23a523 monitor: Use print_ie in auth frame dumper
Do not assume that the challenge IE is present or the only IE in the
authentication frame
2019-10-17 12:04:08 -05:00
Denis Kenzior e34af3cfac monitor: Reset rtnl to NULL after destruction 2019-10-17 11:51:54 -05:00
Denis Kenzior 0b8de3d5df monitor: Fix p2p channel list dumper
This dumper probably intended to update pos after invoking strncpy.
However, strncpy returns the number of bytes that *would* have been
copied and so the logic gets a bit complex to get completely right.

Instead, switch to using l_string since this is inside the monitor and
not particularly performance critical.
2019-10-17 11:49:11 -05:00
Denis Kenzior 39bb4d07ee monitor: Fix potential memory leak
In case l_netlink object was not created successfully, rtmmsg would
leak.
2019-10-17 11:28:11 -05:00
Marcel Holtmann 765bb92084 build: Add skeleton manual pages for all installed binaries 2019-09-22 21:57:47 +02:00
James Prestwood 2fd667af94 monitor: print QoS Map
The actual data in the map is very low level, but this at least shows
us that the IE was included.
2019-09-13 17:05:31 -05:00
James Prestwood 6902bb9dae monitor: print association response events 2019-09-09 15:41:15 -05:00
Denis Kenzior e01a036a41 monitor: decode additional Extended Capability bits 2019-08-23 08:54:17 -05:00
Denis Kenzior 571d66fe42 monitor: Dump PAE frames from CONTROL_PORT_FRAME events 2019-08-15 15:06:59 -05:00
Denis Kenzior e6102141f5 monitor: Dump Supported Operating Classes IE 2019-08-04 09:56:42 -05:00
Denis Kenzior 60078478cf monitor: Dump RTM_NEWROUTE/DELROUTE/GETROUTE 2019-07-23 11:35:27 -05:00
Denis Kenzior c439a2614c monitor: Dump IFLA_LINKINFO 2019-07-23 09:31:05 -05:00
Denis Kenzior 45dfd26689 monitor: Supported nested rtnl attributes 2019-07-23 09:30:42 -05:00
Denis Kenzior c47fee2e78 monitor: Print string length of rtnl attributes 2019-07-23 09:22:57 -05:00
Denis Kenzior 140c626a4b monitor: Remove duplicate monitor_interface structure
The global structure was intended to be used, not the one local to the
main function.
2019-07-23 09:22:01 -05:00
Denis Kenzior 45ce4bc8eb monitor: Fix printing of nlmsgerr netlink messages 2019-07-23 08:21:51 -05:00
Denis Kenzior e0eb824fe3 monitor: nlmsg attributes are unsigned 2019-07-23 07:41:53 -05:00
Denis Kenzior d63f73adf9 monitor: Generalize flag printing 2019-07-23 07:24:20 -05:00
James Prestwood 2b12759595 monitor: basic ANQP printing
Simply prints the ANQP ID (human readable) and the length. Once
the ANQP dependency on netdev is removed the full ANQP parser
can be used, but for now its done manually. Once this is done it
will be much easier to print the actual ANQP ID data.
2019-07-15 14:53:47 -05:00
Denis Kenzior 7f0b169e71 monitor: Use nl80211cmd_to_string 2019-07-15 14:06:26 -05:00
James Prestwood b483a78464 monitor: update nlmon.c to use exposed vendor OUIs 2019-07-15 12:42:34 -05:00
Andrew Zaborowski 2a5c2cec46 monitor: Print "None" for empty p2p flags 2019-07-15 11:30:44 -05:00
Denis Kenzior c60b0ed3cf monitor: Dump additional attributes 2019-07-10 17:01:19 -05:00
Andrew Zaborowski 884cbd4cbb monitor: Drop an include causing build error
After 56f3e54a1d546bfd59db673525929a34173ec796 wscutil.h is included
indirectly through p2putil.h.
2019-07-08 22:03:18 -05:00
Andrew Zaborowski 7d7c79fbf0 monitor: Parse and print P2P IE payloads 2019-07-08 14:44:29 -05:00
Andrew Zaborowski 90dc88bfa0 monitor: Show P2P Public action frame types 2019-07-08 14:42:47 -05:00
Andrew Zaborowski 2862a89d4f monitor: Show P2P action frame types 2019-07-08 14:42:04 -05:00
Andrew Zaborowski 6081438564 monitor: Show IP Allocation KDEs from EAPoL-Key 2/4, 3/4 frames 2019-07-08 14:41:01 -05:00
Andrew Zaborowski 6618ad1fee monitor: Show Radio Management action frame types 2019-07-08 14:40:40 -05:00
Andrew Zaborowski 91a156b4b1 monitor: Show Public Action frame types 2019-07-08 14:40:05 -05:00
Andrew Zaborowski 8eb1fbecce monitor: Show Action frame types 2019-07-08 14:39:50 -05:00
Andrew Zaborowski 6c8b4d13f0 monitor: Parse and show EAPoL-Key KDE types
For now only show the KDE type, not the contents
2019-07-08 14:38:54 -05:00
Denis Kenzior cd67e66f8e monitor: Fix ARRAY output
Commit 3ff9f59ba1 ("monitor: Print MAC_ADDRS array") introduced a
small bug where some arguments were erroneously printed as an address.
2019-06-22 12:38:35 -05:00
Denis Kenzior 3ff9f59ba1 monitor: Print MAC_ADDRS array 2019-06-21 12:22:08 -05:00
James Prestwood e0c9b68467 monitor: parse/print HS2.0/WFA IEs
This is just a few of the WiFi Alliance IEs used for Hotspot 2.0
2019-06-05 16:53:11 -05:00
James Prestwood b9d97c9d87 monitor: change naming of Microsoft OUI
Inside print_ie_vendor, the Microsoft OUI is checked for a WPA IE. The
variable name for the OUI was wfa_oui, but this OUI is not actually the
WiFi-Alliance (sometimes refered to as 'wfa') but rather the Microsoft
OUI.
2019-06-05 16:53:11 -05:00
Marcel Holtmann 1ca82f4e49 monitor: Fix length parameter of strncpy for kernel names 2019-04-30 16:59:28 +02:00
James Prestwood a4af9dc9f5 monitor: support printing FILS IEs/Attributes
Added handling for several FILS IEs and NL attributes specific to
FILS. Also changed "SAE Data" to "Auth Data" since its now used for
both SAE and FILS.
2019-04-05 17:57:31 -05:00
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
Peter Seiderer 330a930b01 monitor: add missing sys/stat.h include
Fixes:

    CC       monitor/pcap.o
  monitor/pcap.c: In function ‘pcap_create’:
  monitor/pcap.c:121:6: error: ‘S_IRUSR’ undeclared (first use in this function)
        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
        ^
  monitor/pcap.c:121:6: note: each undeclared identifier is reported only once for each function it appears in
  monitor/pcap.c:121:16: error: ‘S_IWUSR’ undeclared (first use in this function)
        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
                  ^
  monitor/pcap.c:121:26: error: ‘S_IRGRP’ undeclared (first use in this function)
        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
                            ^
  monitor/pcap.c:121:36: error: ‘S_IROTH’ undeclared (first use in this function)
        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
                                      ^
2018-11-10 17:49:04 +01:00
Marcel Holtmann 5d9278913f monitor: Fix includes for using with -std=c99 compiler option 2018-11-01 22:19:11 +01:00
Marcel Holtmann 72a64fa7fb build: Adjust to the latest ELL signal API changes 2018-11-01 22:09:19 +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
Marcel Holtmann 0689877858 monitor: Use l_main_run_with_signal instead of open coding it 2018-11-01 20:02:53 +01:00