public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [RFC PATCH v1 2/2] sae: Allow ability to force Group 19 / Hunt and Peck
Date: Fri, 23 Aug 2024 12:41:54 -0500	[thread overview]
Message-ID: <20240823174220.498594-3-denkenz@gmail.com> (raw)
In-Reply-To: <20240823174220.498594-1-denkenz@gmail.com>

---
 src/netdev.c |  5 ++++-
 src/sae.c    | 20 ++++++++++++++++++++
 src/sae.h    |  3 +++
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/netdev.c b/src/netdev.c
index a1342d1bef94..5bc055acacfe 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -3933,11 +3933,14 @@ static void netdev_connect_common(struct netdev *netdev,
 		netdev->ap = sae_sm_new(hs, netdev_sae_tx_authenticate,
 					netdev_sae_tx_associate,
 					netdev);
-	else
+	else {
 		netdev->ap =
 			sae_sm_new(hs, netdev_external_auth_sae_tx_authenticate,
 					netdev_external_auth_sae_tx_associate,
 					netdev);
+		sae_sm_force_default_group(netdev->ap);
+		sae_sm_force_hunt_and_peck(netdev->ap);
+	}
 
 	if (sae_sm_is_h2e(netdev->ap)) {
 		uint8_t own_rsnxe[20];
diff --git a/src/sae.c b/src/sae.c
index 97c0af052f14..eb4634848afa 100644
--- a/src/sae.c
+++ b/src/sae.c
@@ -1550,6 +1550,26 @@ struct auth_proto *sae_sm_new(struct handshake_state *hs,
 	return &sm->ap;
 }
 
+bool sae_sm_force_hunt_and_peck(struct auth_proto *ap)
+{
+	struct sae_sm *sm = l_container_of(ap, struct sae_sm, ap);
+
+	sae_debug("Forcing SAE Hunting and Pecking");
+	sm->sae_type = CRYPTO_SAE_LOOPING;
+
+	return true;
+}
+
+bool sae_sm_force_default_group(struct auth_proto *ap)
+{
+	struct sae_sm *sm = l_container_of(ap, struct sae_sm, ap);
+
+	sae_debug("Forcing Default Group");
+	sm->force_default_group = true;
+
+	return true;
+}
+
 static int sae_init(void)
 {
 	if (getenv("IWD_SAE_DEBUG"))
diff --git a/src/sae.h b/src/sae.h
index 668d084f3402..4a59999bfba0 100644
--- a/src/sae.h
+++ b/src/sae.h
@@ -34,3 +34,6 @@ struct auth_proto *sae_sm_new(struct handshake_state *hs,
 				sae_tx_authenticate_func_t tx_auth,
 				sae_tx_associate_func_t tx_assoc,
 				void *user_data);
+
+bool sae_sm_force_hunt_and_peck(struct auth_proto *ap);
+bool sae_sm_force_default_group(struct auth_proto *ap);
-- 
2.45.2


  parent reply	other threads:[~2024-08-23 17:42 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 17:41 [RFC PATCH v1 0/2] External Auth support Denis Kenzior
2024-08-23 17:41 ` [RFC PATCH v1 1/2] netdev: external auth support Denis Kenzior
2024-08-26 12:03   ` James Prestwood
2024-08-23 17:41 ` Denis Kenzior [this message]
2024-08-24  0:38 ` [RFC PATCH v1 0/2] External Auth support KeithG
2024-08-24  3:21   ` Denis Kenzior
2024-08-24 16:20     ` KeithG
2024-08-24 23:32       ` KeithG
2024-08-26 15:43         ` Denis Kenzior
2024-08-26 16:54           ` Arend Van Spriel
2024-09-02 19:32             ` KeithG
2024-09-07 18:43               ` KeithG
2024-09-21 18:58 ` Yuxuan Shui
2024-09-22  3:35   ` Denis Kenzior
     [not found]     ` <CAG17S_NOs=rdUFsFRk4ZPsC=GER2J7nHikGEw=3AW0SBYHUEfg@mail.gmail.com>
2024-09-22  4:23       ` Denis Kenzior
2024-09-22  6:09     ` Arend Van Spriel
2024-09-22 15:36       ` KeithG
2024-09-22 16:20         ` Arend Van Spriel
2024-09-22 16:29           ` KeithG
2024-10-10 15:38             ` KeithG
2024-12-11 22:59               ` Jeremy Blum
2024-12-12 14:33                 ` KeithG
2024-09-22 18:56 ` KeithG
2024-09-22 21:01   ` 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=20240823174220.498594-3-denkenz@gmail.com \
    --to=denkenz@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