Commit Graph

4731 Commits

Author SHA1 Message Date
Andrew Zaborowski 1675c765a3 p2p: Add the WSC interface on peer DBus objects
Add net.connman.iwd.SimpleConfiguration interfaces to peer objects on
DBus and handle method calls.  Building and transmitting the actual
action frames to start the connection sequence is done in the following
commits.
2020-04-24 22:18:52 -05:00
Andrew Zaborowski 3d4725870d p2p: Add the Listen State
Start a remain-on-channel cmd implementing the Listen State, after each
the Scan Phase implemented as an active scan.
2020-04-24 22:16:43 -05:00
Diego Santa Cruz f0e3defa3e wired: use 802.1X-2001 instead of 802.1X-2004
For wired authentication the protocol version used in the EAPOL
packets sent by ead is fixed to 802.1X-2004 (2) but some switches
implementing only 802.1X-2001 erroneously ignore these packets.

As ead only sends EAPOL-Start and EAP-Packet packets and these have
not changed between 802.1X-2001 and 802.1X-2004 there should be
no reason to use 802.1X-2004. Hence, this changes ead to always use
802.1X-2001 (1) instead.

Switches implementing newer versions of 802.1X should not have
problems responding to packets using the original version.
2020-04-24 22:04:22 -05:00
Andrew Zaborowski 6e98d8a888 p2p: Add the Scan Phase
Add some of the Device Discovery logic and the DBus API.  Device
Discovery is documented as having three states: the Scan Phase, the Find
Phase and the Listen State.

This patch adds the Scan Phase and the next patch adds the Listen State,
which will happen sequentially in a loop until discovery is stopped.

The Find Phase, which is documented as happening at the beginning of the
Discovery Phase, is incorporated into the Scan Phases.  The difference
between the two is that Find Phase scans all of the supported channels
while the Scan Phase only scans the three "social" channels.  In
practical terms the Find Phase would discover existing groups, which may
operate on any channel, while the Scan Phase will only discover P2P
Devices -- peers that are not in a group yet.  To cover existing groups,
we add a few "non-social" channels to each of our active scans
implementing the Scan Phases.
2020-04-24 11:42:46 -05:00
Andrew Zaborowski b43e915b98 wiphy: Track regulatory domain changes
When a new wiphy is added query its regulatory domain and listen for
nl80211 regulatory notifications to be able to provide current
regulatory country code through the new wiphy_get_reg_domain_country().
2020-04-24 11:39:00 -05:00
Andrew Zaborowski 0f3f0086ae nl80211util: Parse NL80211_ATTR_REG_ALPHA2 attrs 2020-04-24 11:38:44 -05:00
Andrew Zaborowski 59cc1e27c2 p2p: Add device enable/disable logic
Implement the Enabled property on device interface.  The P2P device is
currently disabled on startup but automatically enabling the P2P device
can be considered.
2020-04-24 11:36:54 -05:00
Andrew Zaborowski ff65e1fd9a p2p: Add main device settings
Read WSC configuration methods and the Primary Device Type from the
config file and expose device name as a property.
2020-04-24 11:35:30 -05:00
Andrew Zaborowski e1b1461a8e doc: List possible P2P peer category/subcategory values 2020-04-24 11:10:54 -05:00
Denis Kenzior 1277a01426 wscutil: Fix dbus string using spaces 2020-04-23 14:50:33 -05:00
Andrew Zaborowski 945abadc8a p2p: Add peer WSC device type properties 2020-04-23 14:49:24 -05:00
Denis Kenzior 46215a6624 build: Remove eap-wsc and wscutil from eap_sources
With the previous commit, wscutil now depends on ie.h.  Unfortunately,
wired also includes eap-wsc and wscutil in the build, but not ie, which
results in a link-time failure.

Fix this by droppig eap-wsc and wscutil from wired.  There's no reason
that ethernet authentication would ever use the WiFi Protected Setup
authentication.
2020-04-23 14:47:30 -05:00
Andrew Zaborowski ed81fe1f4f wscutil: Add device type category/subcategory string api
FTR ie.h is included for @microsoft_oui
2020-04-23 14:41:17 -05:00
Fabrice Fontaine c352714e61 frame-xchg.c: fix build with glibc < 2.24
SOL_NETLINK is used since commit
87a198111a resulting in the following
build failure with glibc < 2.24:

src/frame-xchg.c: In function 'frame_watch_group_io_read':
src/frame-xchg.c:328:27: error: 'SOL_NETLINK' undeclared (first use in this function)
   if (cmsg->cmsg_level != SOL_NETLINK)
                           ^

This failure is due to glibc that doesn't support SOL_NETLINK before
version 2.24 and
f9b437d5ef

Fixes:
 - http://autobuild.buildroot.org/results/3485088b84111c271bbcfaf025aa4103c6452072
2020-04-22 10:38:51 -05:00
Tim Kourt 001b9035e0 station: Fix init return type 2020-04-17 12:22:48 -05:00
Tim Kourt 749d45f58f device: Fix init return type 2020-04-17 12:22:47 -05:00
Andrew Zaborowski 358d0ca201 manager: Create/destroy P2P devices
Create a P2P device interface along with the station interface when
setting up a wiphy and handle the interface being removed.
2020-04-10 06:39:48 -05:00
Andrew Zaborowski 326a8cd6ee Add minimal p2p.c and p2p.h
Add the functions to be called by manager.c and a minimal DBus API.
2020-04-10 06:31:19 -05:00
Andrew Zaborowski 042f88e3e9 dbus: Add P2P interface name defines 2020-04-10 06:31:19 -05:00
Marcel Holtmann ef6084dcb4 Release 1.7 2020-04-14 20:37:39 +02:00
Marcel Holtmann 4eabc1bed0 build: Require at least version 0.31 when building with external ELL 2020-04-14 20:23:02 +02:00
Tim Kourt 57ce53f1ac auto-t: Fix event order
In addition, use the conditional wait for the expected number
of known networks
2020-04-09 16:46:31 -05:00
Tim Kourt 000b533194 auto-t: Remove unused imports 2020-04-09 16:46:31 -05:00
Tim Kourt d3339ddb72 auto-t: Use proper connection status indicator
'Connected' property of the network object is set before the connection
attempt is made and does not indicate a connection success. Therefore,
use device status property to identify the connection status of the device.
2020-04-09 16:46:31 -05:00
Tim Kourt 104e6898ca main: Fix freeing invalid pointer 2020-04-08 21:47:46 -05:00
Rosen Penev 1dfc28d21a module: add void to empty argument functions
Found with clang's -Wstrict-prototypes
2020-04-08 21:03:13 -05:00
Rosen Penev a47609acbe iwd: remove unnecessary semicolons
Found with clang's -Wextra-semi-stmt
2020-04-08 21:02:15 -05:00
Tim Kourt 5d68fbd55f client: Automate display refresh enablement
The display refresh is automatically enabled or disabled depending on
the width of the window. This allows to avoid the incorrect display on
refresh for the small windows.
2020-04-08 21:01:27 -05:00
Tim Kourt 9eeaedf189 client: Rename window change signal for clarity 2020-04-08 21:01:18 -05:00
James Prestwood 83128c797f auto-t: check linkmode/operstate in adhoc test (open)
A previous patch fixed the linkmode/operstate for open AdHoc networks.
2020-04-08 16:35:06 -05:00
Tim Kourt a074f30edc main: Simplify config file search logic 2020-04-08 16:19:52 -05:00
Denis Kenzior 98e4f84348 main: pretty up formatting 2020-04-08 16:19:37 -05:00
Tim Kourt 19a5250b34 main: Fix failure cleanup sequence 2020-04-08 16:18:05 -05:00
Tim Kourt f92ce9441e storage: Refactor dirs creation logic to cleanup on failure 2020-04-08 16:18:04 -05:00
Rosen Penev 2acda158ef client: apply format attribute to two functions
Clang was able to find these extra ones.
2020-04-08 16:14:44 -05:00
Tim Kourt 36f962a4f0 client: Rephrase the wait messages 2020-04-08 16:14:29 -05:00
Tim Kourt 61e8a640b1 client: Rewrite workaround for readline
Instead of calling display(""), explicitly use the sequence of
commands to force readline to properly update its internal state
and re-display the prompt.
2020-04-08 16:13:45 -05:00
Denis Kenzior 848897ec17 adhoc: Set linkmode & operstate for open networks
For PSK networks we have netdev.c taking care of setting the linkmode &
operstate.  For open adhoc networks, netdev.c was never involved which
resulted in linkmode & operstate never being set.  Fix this by invoking
the necessary magic when a connection is established.
2020-04-08 12:35:04 -05:00
Denis Kenzior 6c95933663 netdev: Use the global rtnl object 2020-04-08 12:35:04 -05:00
Denis Kenzior 520f851564 netconfig: Use the global rtnl object 2020-04-08 12:35:02 -05:00
Denis Kenzior 5ea86c98fc main: Add iwd_get_rtnl 2020-04-08 12:27:57 -05:00
Denis Kenzior 7c14a79fee AUTHORS: Mention Diego's contributions 2020-04-06 17:17:29 -05:00
Diego Santa Cruz f5a7510a22 adhoc: segfault when exiting iwd after adhoc stop
adhoc_reset() destroys ssid and sta_states but leaves the pointers
around, athough the adhoc_state structure is not always freed.

This causes a segfault when exiting iwd after a client has done
adhoc start and adhoc stop on a device since adhoc_reset() is called
from adhoc_sta_free although it was previously called from
adhoc_leave_cb().
2020-04-06 17:17:19 -05:00
Diego Santa Cruz d66dcc9412 adhoc: fix bogus Failed error and segfault on stop
The netdev_leave_adhoc() returns a negative errno on errors and zero
on success, but adhoc_dbus_stop() assumed the inverse when checking for
an error.

Also, the DBus message was not being referenced in adhoc->pending and
then adhoc_leave_cb() segfaulted attempting to dereference it.
2020-04-06 17:17:19 -05:00
Diego Santa Cruz 0b65fe3a95 client: fix ad-hoc start_open DBus method name
Doing 'ad-hoc <wlan> start_open <"network name">' returned a
"No matching method found" error because start_open called
net.connman.iwd.AdHoc.Start instead of net.connman.iwd.AdHoc.StartOpen.
2020-04-06 17:17:19 -05:00
Andrew Zaborowski 508d71e3c1 eap-wsc: Convert memsets to explicit_bzero 2020-04-06 16:21:35 -05:00
Andrew Zaborowski 0ffb96056a wsc: Clear the pin copy in wsc_generate_pin 2020-04-06 16:21:31 -05:00
Denis Kenzior aba3da32ac netdev: work around APs that send igtk in big endian
It seems some APs send the IGTK key in big endian format (it is a
uin16).  The kernel rightly reports an -EINVAL error when iwd issues a
NEW_KEY with such a value, resulting in the connection being aborted.

Work around this by trying to detect big-endian key indexes and 'fixing'
them up.
2020-04-06 15:56:46 -05:00
Denis Kenzior 5576722d29 eapol: Make sure igtk key index is uint16_t
Fixes: 1cc7346d6a ("handshake: Change signature of (i)gtk setters")
2020-04-02 18:16:56 -05:00
Denis Kenzior 45824ff7eb unit: Update to the new handshake API 2020-04-02 00:41:18 -05:00