3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2026-03-25 15:18:05 +01:00

Compare commits

..

No commits in common. "master" and "3.10" have entirely different histories.
master ... 3.10

43 changed files with 83 additions and 162 deletions

View File

@ -1,12 +1,3 @@
ver 3.12:
Fix issue with handling expiration of PMKSA.
Fix issue with handling uninitialized buffer and PMKID.
Fix issue with checking for PKCS#8 key parser in unit tests.
Fix issue with using -std=c23 compiler setting.
ver 3.11:
Fix issue with interface registration before acquiring name.
ver 3.10:
Fix issue with handling neighbor report on BSS TM request.
Fix issue with handling deauth and FT association failure.

View File

@ -40,7 +40,7 @@ class Test(unittest.TestCase):
to_bss.wait_for_event('AP-STA-CONNECTED %s' % self.device.address)
else:
self.device.wait_for_event("no-roam-candidates", timeout=20)
self.device.wait_for_event("no-roam-candidates")
def test_disassoc_imminent(self):
self.initial_connection()
@ -76,8 +76,6 @@ class Test(unittest.TestCase):
(cls.bss_hostapd[1].bssid, "8f0000005102060603000000"),
]
cls.bss_hostapd[2].disable()
@classmethod
def tearDownClass(cls):
IWD.clear_storage()

View File

@ -13,46 +13,29 @@ import testutil
from config import ctx
class Test(unittest.TestCase):
def connect(self, wd, device, hapd):
def validate_connection(self, wd, ft=True, check_used_pmksa=False):
device = wd.list_devices(1)[0]
# This won't guarantee all BSS's are found, but at least ensures that
# at least one will be.
device.get_ordered_network('TestFT', full_scan=True)
self.assertFalse(hapd.list_sta())
self.assertFalse(self.bss_hostapd[0].list_sta())
self.assertFalse(self.bss_hostapd[1].list_sta())
device.connect_bssid(hapd.bssid)
device.connect_bssid(self.bss_hostapd[0].bssid)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
hapd.wait_for_event('AP-STA-CONNECTED %s' % device.address)
self.bss_hostapd[0].wait_for_event('AP-STA-CONNECTED %s' % device.address)
self.assertFalse(self.bss_hostapd[1].list_sta())
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(hapd.ifname, device.name)
def roam(self, wd, device, hapd_from, hapd_to):
device.roam(hapd_to.bssid)
# Check that iwd is on hapd_to once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between
from_condition = 'obj.state == DeviceState.roaming'
to_condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_change(device, from_condition, to_condition)
hapd_to.wait_for_event('AP-STA-CONNECTED %s' % device.address)
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(hapd_to.ifname, device.name)
testutil.test_ifaces_connected(self.bss_hostapd[0].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(hapd_from.ifname, device.name, True, True))
def validate_connection(self, wd, ft=True, check_used_pmksa=False):
device = wd.list_devices(1)[0]
self.connect(wd, device, self.bss_hostapd[0])
(self.bss_hostapd[1].ifname, device.name, True, True))
# If PMKSA was used, hostapd should not include the sae_group key in
# its status for the station.
@ -62,12 +45,41 @@ class Test(unittest.TestCase):
else:
self.assertIn("sae_group", sta_status.keys())
self.roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[1])
device.roam(self.bss_hostapd[1].bssid)
# Check that iwd is on BSS 1 once out of roaming state and doesn't
# go through 'disconnected', 'autoconnect', 'connecting' in between
from_condition = 'obj.state == DeviceState.roaming'
to_condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_change(device, from_condition, to_condition)
self.bss_hostapd[1].wait_for_event('AP-STA-CONNECTED %s' % device.address)
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[1].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[0].ifname, device.name, True, True))
if not ft:
return
self.roam(wd, device, self.bss_hostapd[1], self.bss_hostapd[2])
device.roam(self.bss_hostapd[2].bssid)
condition = 'obj.state == DeviceState.roaming'
wd.wait_for_object_condition(device, condition)
condition = 'obj.state != DeviceState.roaming'
wd.wait_for_object_condition(device, condition)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
self.bss_hostapd[2].wait_for_event('AP-STA-CONNECTED %s' % device.address)
testutil.test_iface_operstate(device.name)
testutil.test_ifaces_connected(self.bss_hostapd[2].ifname, device.name)
self.assertRaises(Exception, testutil.test_ifaces_connected,
(self.bss_hostapd[1].ifname, device.name, True, True))
def test_ft_roam_success(self):
wd = IWD(True)
@ -109,26 +121,6 @@ class Test(unittest.TestCase):
self.validate_connection(wd, True, check_used_pmksa=True)
def test_ft_roam_with_pmksa(self):
wd = IWD(True)
self.bss_hostapd[0].set_value('wpa_key_mgmt', 'FT-SAE SAE')
self.bss_hostapd[0].reload()
self.bss_hostapd[0].wait_for_event("AP-ENABLED")
self.bss_hostapd[1].set_value('wpa_key_mgmt', 'FT-SAE SAE')
self.bss_hostapd[1].reload()
self.bss_hostapd[1].wait_for_event("AP-ENABLED")
self.bss_hostapd[2].set_value('wpa_key_mgmt', 'FT-PSK')
self.bss_hostapd[2].reload()
self.bss_hostapd[2].wait_for_event("AP-ENABLED")
device = wd.list_devices(1)[0]
self.connect(wd, device, self.bss_hostapd[0])
self.roam(wd, device, self.bss_hostapd[0], self.bss_hostapd[1])
self.roam(wd, device, self.bss_hostapd[1], self.bss_hostapd[0])
def test_reassociate_roam_success(self):
wd = IWD(True)

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <linux/limits.h>

View File

@ -279,35 +279,35 @@ static const struct proxy_interface *known_network_proxy_find_by_name(
struct network_args network_args;
struct l_queue *match;
const struct proxy_interface *proxy;
size_t name_len;
char *args_name;
if (!name)
return NULL;
name_len = strlen(name);
if (l_str_has_suffix(name, ".psk")) {
if (l_str_has_suffix(name, ".psk"))
network_args.type = "psk";
name_len -= 4;
} else if (l_str_has_suffix(name, ".8021x")) {
else if (l_str_has_suffix(name, ".8021x"))
network_args.type = "8021x";
name_len -= 6;
} else if (l_str_has_suffix(name, ".open")) {
else if (l_str_has_suffix(name, ".open"))
network_args.type = "open";
name_len -= 5;
} else
else
network_args.type = NULL;
args_name = l_strndup(name, name_len);
network_args.name = args_name;
if (network_args.type) {
char *dot = strrchr(name, '.');
if (!dot)
/* This shouldn't ever be the case */
return NULL;
*dot = '\0';
}
network_args.name = name;
match = proxy_interface_find_all(known_network_interface_type.interface,
known_network_match,
&network_args);
l_free(args_name);
if (!match) {
display("No network with specified parameters was found\n");
return NULL;

View File

@ -1,5 +1,5 @@
AC_PREREQ([2.69])
AC_INIT([iwd],[3.12])
AC_INIT([iwd],[3.10])
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_AUX_DIR(build-aux)

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <errno.h>
#include <linux/if_ether.h>
#include <netinet/in.h>

View File

@ -26,7 +26,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdbool.h>
#include <string.h>
#include <errno.h>

View File

@ -24,9 +24,7 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <errno.h>
#include <string.h>
#include <ell/ell.h>

View File

@ -24,11 +24,9 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,10 +24,8 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,10 +24,8 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,11 +24,9 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <errno.h>

View File

@ -24,9 +24,7 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <ell/ell.h>

View File

@ -24,12 +24,10 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
#include <alloca.h>
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,11 +24,9 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <alloca.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <errno.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <errno.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <alloca.h>
#include <linux/if_ether.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdint.h>
#include <stdio.h>
#include <errno.h>

View File

@ -25,8 +25,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdlib.h>
#include <ell/ell.h>
#include "ell/useful.h"

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#include <alloca.h>
#include <ell/ell.h>
#include "src/ie.h"

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <unistd.h>
#include <errno.h>
@ -1268,7 +1267,6 @@ static struct pmksa *handshake_state_steal_pmksa(struct handshake_state *s)
pmksa = l_new(struct pmksa, 1);
pmksa->expiration = s->expiration;
s->expiration = 0;
memcpy(pmksa->spa, s->spa, sizeof(s->spa));
memcpy(pmksa->aa, s->aa, sizeof(s->aa));
memcpy(pmksa->ssid, s->ssid, s->ssid_len);

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
#include <stdio.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>

View File

@ -197,12 +197,29 @@ static void request_name_callback(struct l_dbus *dbus, bool success,
{
if (!success) {
l_error("Name request failed");
l_main_quit();
goto fail_exit;
}
if (!l_dbus_object_manager_enable(dbus, "/"))
l_warn("Unable to register the ObjectManager");
if (!l_dbus_object_add_interface(dbus, IWD_BASE_PATH,
IWD_DAEMON_INTERFACE,
NULL) ||
!l_dbus_object_add_interface(dbus, IWD_BASE_PATH,
L_DBUS_INTERFACE_PROPERTIES,
NULL))
l_info("Unable to add %s and/or %s at %s",
IWD_DAEMON_INTERFACE, L_DBUS_INTERFACE_PROPERTIES,
IWD_BASE_PATH);
/* TODO: Always request nl80211 for now, ignoring auto-loading */
l_genl_request_family(genl, NL80211_GENL_NAME, nl80211_appeared,
NULL, NULL);
return;
fail_exit:
l_main_quit();
}
static struct l_dbus_message *iwd_dbus_get_info(struct l_dbus *dbus,
@ -232,25 +249,12 @@ static void dbus_ready(void *user_data)
{
struct l_dbus *dbus = user_data;
l_dbus_name_acquire(dbus, "net.connman.iwd", false, false, false,
request_name_callback, NULL);
l_dbus_register_interface(dbus, IWD_DAEMON_INTERFACE,
iwd_setup_deamon_interface,
NULL, false);
if (!l_dbus_object_manager_enable(dbus, "/"))
l_warn("Unable to register the ObjectManager");
if (!l_dbus_object_add_interface(dbus, IWD_BASE_PATH,
IWD_DAEMON_INTERFACE,
NULL) ||
!l_dbus_object_add_interface(dbus, IWD_BASE_PATH,
L_DBUS_INTERFACE_PROPERTIES,
NULL))
l_info("Unable to add %s and/or %s at %s",
IWD_DAEMON_INTERFACE, L_DBUS_INTERFACE_PROPERTIES,
IWD_BASE_PATH);
l_dbus_name_acquire(dbus, "net.connman.iwd", false, false, false,
request_name_callback, NULL);
}
static void dbus_disconnected(void *user_data)

View File

@ -24,9 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <errno.h>
#include <arpa/inet.h>
#include <net/if_arp.h>
@ -32,7 +31,6 @@
#include <limits.h>
#include <string.h>
#include <fcntl.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdlib.h>
#include <alloca.h>
#include <stdio.h>
@ -33,8 +32,8 @@
#include <linux/if.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>
#include <linux/filter.h>
#include <arpa/inet.h>
#include <linux/filter.h>
#include <sys/socket.h>
#include <errno.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdlib.h>
#include <linux/rtnetlink.h>
#include <linux/if_ether.h>
@ -36,7 +35,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <linux/if.h>
#include <sys/param.h>
#include <ell/ell.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <errno.h>
#include <arpa/inet.h>
#include <sys/stat.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

View File

@ -24,11 +24,9 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <ctype.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <ell/ell.h>
#include "src/missing.h"

View File

@ -1358,12 +1358,11 @@ build_ie:
bss->ssid, bss->ssid_len,
info.akm_suites);
if (pmksa) {
if (!L_WARN_ON(!handshake_state_set_pmksa(hs, pmksa))) {
handshake_state_set_pmksa(hs, pmksa);
info.num_pmkids = 1;
info.pmkids = hs->pmksa->pmkid;
}
}
}
/* RSN takes priority */
if (bss->rsne) {

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <errno.h>
#include <stdio.h>
#include <ell/ell.h>

View File

@ -28,7 +28,6 @@
#include <stdarg.h>
#include <errno.h>
#include <stdio.h>
#include <strings.h>
#include <ell/ell.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>

View File

@ -27,7 +27,6 @@
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <sys/stat.h>
#include <linux/if_ether.h>
#include <ell/ell.h>
@ -3924,18 +3923,6 @@ static bool aes_precheck(const void *data)
static bool pkcs8_precheck(const void *data)
{
struct stat st;
/*
* Despite the path, this directory exists whether the module
* is external or built-in.
*/
if (stat("/sys/module/pkcs8_key_parser", &st) < 0)
return false;
if (!S_ISDIR(st.st_mode))
return false;
return (IS_ENABLED(HAVE_PKCS8_SUPPORT) &&
l_cipher_is_supported(L_CIPHER_AES) &&
l_cipher_is_supported(L_CIPHER_AES_CBC) &&

View File

@ -25,7 +25,6 @@
#endif
#include <string.h>
#include <alloca.h>
#include <assert.h>
#include <ell/ell.h>

View File

@ -24,7 +24,6 @@
#include <config.h>
#endif
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <unistd.h>