From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 03/11] network: retain default ECC group for OWE after setting
Date: Tue, 27 Feb 2024 10:33:57 -0800 [thread overview]
Message-ID: <20240227183405.257206-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20240227183405.257206-1-prestwoj@gmail.com>
There is special handling for buggy OWE APs which set a network flag
to use the default OWE group. Utilize the more persistent setting
within known-networks as well as the network object (in case there
is no profile).
This also renames the get/set APIs to be generic to ECC groups rather
than only OWE.
---
src/network.c | 38 +++++++++++++++++++++++++++++++-------
src/network.h | 4 ++--
src/station.c | 4 ++--
3 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/src/network.c b/src/network.c
index 287e2be0..a0a89e63 100644
--- a/src/network.c
+++ b/src/network.c
@@ -89,7 +89,7 @@ struct network {
bool provisioning_hidden:1;
uint8_t transition_disable; /* Temporary cache until info is set */
bool have_transition_disable:1;
- bool force_default_owe_group:1;
+ bool force_default_ecc_group:1;
int rank;
/* Holds DBus Connect() message if it comes in before ANQP finishes */
struct l_dbus_message *connect_after_anqp;
@@ -271,8 +271,12 @@ struct network *network_create(struct station *station, const char *ssid,
network->security = security;
network->info = known_networks_find(ssid, security);
- if (network->info)
+ if (network->info) {
network->info->seen_count++;
+ if (network->info->config.ecc_group ==
+ KNOWN_NETWORK_ECC_GROUP_DEFAULT)
+ network->force_default_ecc_group = true;
+ }
network->bss_list = l_queue_new();
network->blacklist = l_queue_new();
@@ -553,7 +557,7 @@ int network_handshake_setup(struct network *network, struct scan_bss *bss,
}
if (hs->akm_suite == IE_RSN_AKM_SUITE_OWE)
- hs->force_default_owe_group = network->force_default_owe_group;
+ hs->force_default_owe_group = network->force_default_ecc_group;
/*
* The randomization options in the provisioning file are dependent on
@@ -818,14 +822,34 @@ void network_set_info(struct network *network, struct network_info *info)
IWD_NETWORK_INTERFACE, "KnownNetwork");
}
-void network_set_force_default_owe_group(struct network *network)
+void network_set_force_default_ecc_group(struct network *network)
{
- network->force_default_owe_group = true;
+ /* No network info, likely a failed OWE connection */
+ if (!network->info) {
+ network->force_default_ecc_group = true;
+ return;
+ }
+
+ /* Profile explicitly wants to try the most secure group */
+ if (network->info->config.ecc_group ==
+ KNOWN_NETWORK_ECC_GROUP_MOST_SECURE)
+ return;
+
+ l_debug("Forcing default group for %s", network->ssid);
+
+ network->force_default_ecc_group = true;
+ network->info->config.ecc_group = KNOWN_NETWORK_ECC_GROUP_DEFAULT;
}
-bool network_get_force_default_owe_group(struct network *network)
+bool network_get_force_default_ecc_group(struct network *network)
{
- return network->force_default_owe_group;
+ if (!network->info)
+ return network->force_default_ecc_group;
+
+ if (network->info->config.ecc_group == KNOWN_NETWORK_ECC_GROUP_DEFAULT)
+ return true;
+
+ return false;
}
int network_can_connect_bss(struct network *network, const struct scan_bss *bss)
diff --git a/src/network.h b/src/network.h
index ea619f3f..17dfcca8 100644
--- a/src/network.h
+++ b/src/network.h
@@ -58,8 +58,8 @@ void network_sync_settings(struct network *network);
const struct network_info *network_get_info(const struct network *network);
void network_set_info(struct network *network, struct network_info *info);
-void network_set_force_default_owe_group(struct network *network);
-bool network_get_force_default_owe_group(struct network *network);
+void network_set_force_default_ecc_group(struct network *network);
+bool network_get_force_default_ecc_group(struct network *network);
bool network_update_known_frequencies(struct network *network);
diff --git a/src/station.c b/src/station.c
index 8817637b..3712d5bb 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3152,7 +3152,7 @@ static bool station_retry_owe_default_group(struct station *station)
return false;
/* If we already forced group 19, allow the BSS to be blacklisted */
- if (network_get_force_default_owe_group(station->connected_network))
+ if (network_get_force_default_ecc_group(station->connected_network))
return false;
l_warn("Failed to connect to OWE BSS "MAC" possibly because the AP is "
@@ -3160,7 +3160,7 @@ static bool station_retry_owe_default_group(struct station *station)
"Retrying with group 19 as a workaround",
MAC_STR(station->connected_bss->addr));
- network_set_force_default_owe_group(station->connected_network);
+ network_set_force_default_ecc_group(station->connected_network);
return true;
}
--
2.34.1
next prev parent reply other threads:[~2024-02-27 18:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 18:33 [PATCH 01/11] doc: Document UseDefaultEccGroup James Prestwood
2024-02-27 18:33 ` [PATCH 02/11] knownnetworks: add option to force a default ECC group James Prestwood
2024-02-27 18:33 ` James Prestwood [this message]
2024-02-27 18:33 ` [PATCH 04/11] network: set use default ECC group in handshake setup James Prestwood
2024-02-27 18:33 ` [PATCH 05/11] sae: remove sae_sm_set_force_group_19, use handshake James Prestwood
2024-02-27 18:34 ` [PATCH 06/11] netdev: add NETDEV_EVENT_ECC_GROUP_RETRY, handle in station James Prestwood
2024-02-27 18:34 ` [PATCH 07/11] auto-t: add Device.event_ocurred James Prestwood
2024-02-27 18:34 ` [PATCH 08/11] auto-t: add HostapdCLI.sta_status James Prestwood
2024-02-27 18:34 ` [PATCH 09/11] auto-t: refactor/fix testSAE James Prestwood
2024-02-27 18:34 ` [PATCH 10/11] auto-t: Add test for new SAE default group behavior James Prestwood
2024-02-27 18:34 ` [PATCH 11/11] auto-t: add OWE test for auto default group James Prestwood
2024-02-27 19:56 ` [PATCH 01/11] doc: Document UseDefaultEccGroup Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240227183405.257206-3-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox