Commit Graph

4223 Commits

Author SHA1 Message Date
Marcel Holtmann 3487aa5365 README: Mention --disable-manual-pages in case rst2man is missing 2019-10-12 20:14:39 +02:00
James Prestwood fe179f96fd eap: utilize IWD_MODULE
Converts eap into an IWD module.
2019-10-11 15:45:26 -05:00
James Prestwood f71a28ce38 unit: update wsc/eapol with new eap_init
test-eapol was passing zero as the MTU, so this simply needed to be
updated to remove that parameter.

test-wsc was actually setting a MTU value so when building the
settings we now add the proper value so the MTU can be set with
__eap_set_config.
2019-10-11 15:45:26 -05:00
James Prestwood a30620d8a9 wired: update with new eap_init 2019-10-11 15:45:25 -05:00
James Prestwood 8f600ee1b5 eap: remove mtu argument from eap_init
This was refactored to set the mtu via __eap_set_config rather than
passing the MTU into eap_init. This makes eap work in a similar fashion
as eapol (i.e. __eapol_set_config).

If __eap_set_config is not used, the MTU will be set to 1020, which is
the same as previously passing 0 to eap_init.
2019-10-11 15:44:38 -05:00
James Prestwood d53dcf2334 wiphy: utilize IWD_MODULE
This converts wiphy into an IWD module. nl80211 was completely removed
from main.c as it is no longer passed with manager or wiphy.
2019-10-11 15:42:13 -05:00
James Prestwood 97bac236c8 wiphy: remove white/blacklist from wiphy_init
wiphy will now use getters for the phy white/black list.
2019-10-11 15:41:54 -05:00
Denis Kenzior cc2d4f97e2 manager: Make sure pending_wiphys remains NULL on error 2019-10-11 15:41:16 -05:00
James Prestwood 2d8d47c9dd manager: utilize IWD_MODULE
Converts manager into an IWD module.
2019-10-11 15:38:25 -05:00
James Prestwood 87c42bccf1 manager: remove white/black list from argument
Instead we add getters for these lists that manager_init can use.
2019-10-11 15:37:58 -05:00
James Prestwood 2ab8d4bbed anqp: utilize IWD_MODULE
This converts anqp into an IWD module.
2019-10-11 15:37:33 -05:00
James Prestwood 369c5fbd0b eapol: utilize IWD_MODULE
This converts eapol to using IWD modules. The init/exit APIs did need
to remain exposed for unit tests.

Netdev was updated to depend on eapol.
2019-10-11 15:36:45 -05:00
Denis Kenzior cb57d44cb4 netdev: Fix resource leaks in netdev_init 2019-10-11 15:34:54 -05:00
James Prestwood d42c4a57b8 netdev: utilize IWD_MODULE
Since iwd_modules_init is now defered until nl80211_appeared, we can
assume the nl80211 object is available. This removes the need for
netdev_set_nl80211 completely.
2019-10-11 15:30:28 -05:00
James Prestwood df8fc5f918 main: move module init into nl80211_appeared
In preparation for integrating IWD_MODULE into modules which require
nl80211 we move the module init into the nl80211_appeared callback.
This will guarentee that the nl80211 is available during module init
and allow modules to get their own copy of nl80211 rather than needing
a set function (e.g. netdev_set_nl80211).

Since the dbus name request callback happens before this as well any
dbus module can also use IWD_MODULE and simply assume the dbus object
is ready.

plugin_init was also deferred to nl80211_appeared since some plugins
depend on modules being initialized.
2019-10-11 15:21:32 -05:00
James Prestwood 046fe96537 agent: utilize IWD_MODULE
Converts agent into an IWD module. This removes the dbus dependency
on agent. Since dbus is initialized very early we can assume
dbus_get_bus is going to return a valid object.
2019-10-11 13:52:22 -05:00
Marcel Holtmann 1382c4724a Release 0.22 2019-10-11 09:13:28 +02:00
Marcel Holtmann 5508833bab build: Hide the PKCS8 unit tests behind MAINTAINER_MODE for now 2019-10-11 08:57:38 +02:00
Marcel Holtmann ac7af81866 build: Require at least version 0.24 when building with external ELL 2019-10-11 01:59:01 +02:00
Tim Kourt 3aa336cb2a resolve: Add IPv6 handler for systemd msg appender 2019-10-10 11:54:58 -05:00
Tim Kourt 8168b22233 netconfig: Don't clear IPv6 addresses on shutdown
Unlike IPv4, the IPv6 address are removed by the kernel.
2019-10-09 17:53:26 -05:00
Tim Kourt 2d02816efd station: Subscribe to netconfig event notifier 2019-10-09 17:52:36 -05:00
Tim Kourt c4a17ed711 netconfig: Add netconfig event notifier
The notifier allows to subscribe for the netconfig events such as
‘connected’.
2019-10-09 17:51:57 -05:00
Tim Kourt 624933fab0 station: Move 'connected' logic out of enter state func
Previously, station state 'connected' used to identify an interface associated
with AP. With the introduction of netconfig, an interface is assumed to be
connected after the IP addresses have been assigned to it. If netconfig is
disabled, the behavior remains unchanged.
2019-10-09 17:05:42 -05:00
James Prestwood e39bb6bfa0 test-runner: allow all unit tests to be run in VM
The -U parameter only allowed for a list of unit tests to be run.
Most of the time for sanity checking you want to run all the unit
tests so this has been changed to take an optional argument.

Now, the -U flag (by itself) will run all unit tests. Running a
single or list of unit tests can still be achieved by:

--unit-tests=test-eapol,test-crypto
2019-10-09 14:33:08 -05:00
Tim Kourt beca75830c netconfig: Split route add/del callbacks 2019-10-09 14:18:07 -05:00
Tim Kourt 48be2c0252 station: Simplify and comply with coding style 2019-10-09 14:18:02 -05:00
James Prestwood 94e2769e93 doc: fix broken link in test-runner.txt 2019-10-08 14:50:19 -05:00
James Prestwood c4ecf2c5c6 tools: ios_convert: embed certs rather than using paths 2019-10-07 23:09:29 -05:00
James Prestwood 8885135e63 auto-t: add TLS test with embedded PEMs 2019-10-07 23:09:29 -05:00
Marcel Holtmann d2e4b7d288 gitignore: Add unit/*-settings.8021x 2019-10-07 22:04:35 +02:00
James Prestwood fddf15f527 unit: add test for embedded certs to test-eapol
Refactored eapol_sm_test_tls to take a l_settings object rather than
a settings string. This lets the caller either load from data or
from file (the new test loads the build time generated tls-settings
file).
2019-10-07 14:41:15 -05:00
James Prestwood be55eb0b5e build: generate tls config for unit tests
To test embedded certs we need a settings file containing the same
PEMs that we generate during build time. In the same fashion generate
tls-settings.8021x file using the previously generated PEMs.
2019-10-07 14:41:15 -05:00
James Prestwood bea1d22a5c eap-tls-common: allow embedded PEMs in settings
Refactoring was required to allow for embedded certs. The existing
eap_tls_state object was changed to hold the cert types (l_queue,
l_certchain, l_key) rather than the file path, since there may not
actually be separate PEM files.

Care was taken to properly manage the memory of these objects.
Since the TLS object takes ownership when setting auth data or the
CA certs all error cases must be handled properly to free these
objects after they are loaded and in addition they must be set to
NULL so that the cleanup doesn't double free them.

If everything goes to plan, we load all the PEMs in settings_load,
provide these objects to the TLS APIs, and then NULL out the
pointers (TLS now owns this memory). If anything fails between
settings_load and l_tls_start we must free these objects.

A special format must be used to indicate that a PEM is embedded
inside the settings file. First, the l_settings format should be
followed for the PEM itself, e.g.

[@pem@my_ca_cert]
<CA Cert data>

This PEM can then be referenced by "embed:my_ca_cert", e.g.

EAP-TLS-CACert=embed:my_ca_cert

Any other value not starting with "embed:" will be treated as a file
path.
2019-10-07 11:39:30 -05:00
James Prestwood 3f13c4029a doc: add section about regulatory.db missing
It was found that some distros do not ship with a regulatory.db file.
This is required to run some of the autotests, and if not found on the
system the kernel build will fail due to some of the IWD config
options which require regulatory.db.

The fix is to manually download regulatory.db from git.kernel.org and
place it in /lib/firmware.
2019-10-07 11:38:47 -05:00
James Prestwood aa94450edd build: add pem-private.h to Makefile.am 2019-10-04 12:17:20 -05:00
Tim Kourt e0651cf25b netconfig: Allow to override IPv6 DHCP DNSs with static addresses 2019-10-04 12:17:20 -05:00
Tim Kourt 0fdd27463e netconfig: Allow to override IPv4 DHCP DNSs with static addresses 2019-10-04 12:17:20 -05:00
Denis Kenzior 46a88744c1 netconfig: Remove unused member 2019-10-04 12:17:20 -05:00
Marcel Holtmann 6476d68aed build: Add manual page for iwd configuration file 2019-10-03 22:36:39 +02:00
Marcel Holtmann f9f12533fc doc: Add more detailed description for iwd daemon 2019-10-03 22:35:47 +02:00
Marcel Holtmann 95f2bc09a6 README: Mention that tarballs include a copy of ELL 2019-10-03 22:22:06 +02:00
Marcel Holtmann 6472428597 README: Mention the manual pages generation 2019-10-03 22:21:15 +02:00
Will Dietz 44ae6a46da station: don't reset/(re)configure/destroy NULL netconfig's
Fixes crashes when `enable_network_config` is false (default).
2019-10-03 12:34:56 -05:00
Will Dietz 6672bc2a37 station: record dependency on netconfig module
The netconfig module must be initialized (netconfig_list, for example)
before station module can be used, record this to ensure that happens.
2019-10-03 12:30:43 -05:00
Will Dietz f74e6ff2f2 crypto: fix copy size causing overruns/crashing
num_ad is already accounted for in `sizeof(iov)`
as iov has size `sizeof(struct iovec) * (num_ad+1)`.
2019-10-03 12:25:57 -05:00
Tim Kourt 3e634bfbcc netconfig: Optimize IPv4 address deletion
Decrease the queue traversals to a single pass
2019-10-03 10:56:07 -05:00
Tim Kourt 444491490e netconfig: Remove IPv6 default route
The IPv6 default route needs to be explicitly revoked. Unlike in IPv4,
there is no SRC address associated with the route and it will not be
removed on address removal.
2019-10-03 10:56:07 -05:00
Tim Kourt eebd44cfc0 rtnlutil: Add IPv6 route deletion helper 2019-10-03 10:56:07 -05:00
Tim Kourt cd21d4d3e7 netconfig: Fix return type for module init 2019-10-03 10:56:07 -05:00