diff mbox series

[04/11] network: set use default ECC group in handshake setup

Message ID 20240227183405.257206-4-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/11] doc: Document UseDefaultEccGroup | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Feb. 27, 2024, 6:33 p.m. UTC
If either the settings specify it, or the scan_bss is flagged, set
the use_default_ecc_group flag in the handshake.

This also renames the flag to cover both OWE and SAE
---
 src/handshake.h | 2 +-
 src/network.c   | 4 ++--
 src/owe.c       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/handshake.h b/src/handshake.h
index 6c58e4d2..62118fe2 100644
--- a/src/handshake.h
+++ b/src/handshake.h
@@ -140,7 +140,7 @@  struct handshake_state {
 	bool authenticator_ocvc : 1;
 	bool supplicant_ocvc : 1;
 	bool ext_key_id_capable : 1;
-	bool force_default_owe_group : 1;
+	bool force_default_ecc_group : 1;
 	uint8_t ssid[32];
 	size_t ssid_len;
 	char *passphrase;
diff --git a/src/network.c b/src/network.c
index a0a89e63..7b996f51 100644
--- a/src/network.c
+++ b/src/network.c
@@ -556,8 +556,8 @@  int network_handshake_setup(struct network *network, struct scan_bss *bss,
 		handshake_state_set_protocol_version(hs, eapol_proto_version);
 	}
 
-	if (hs->akm_suite == IE_RSN_AKM_SUITE_OWE)
-		hs->force_default_owe_group = network->force_default_ecc_group;
+	hs->force_default_ecc_group = network->force_default_ecc_group ||
+						bss->force_default_sae_group;
 
 	/*
 	 * The randomization options in the provisioning file are dependent on
diff --git a/src/owe.c b/src/owe.c
index faa4e17d..da1d643b 100644
--- a/src/owe.c
+++ b/src/owe.c
@@ -45,7 +45,7 @@  struct owe_sm {
 
 static bool owe_reset(struct owe_sm *owe)
 {
-	if (owe->hs->force_default_owe_group) {
+	if (owe->hs->force_default_ecc_group) {
 		if (owe->retry != 0) {
 			l_warn("Forced default OWE group but was rejected!");
 			return false;