public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 4/4] handshake: check expiration propery in set_pmksa()
Date: Mon,  9 Mar 2026 08:36:29 -0700	[thread overview]
Message-ID: <20260309153629.2012710-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20260309153629.2012710-1-prestwoj@gmail.com>

The existing check was only looking at s->expiration and if it was
zero or non-zero. If a PMKSA exists for a BSS the expiration will
be non-zero, but that shouldn't preclude us from setting that into
the handshake.

Instead check if the PMKSA is actually expired, and only then
return false.
---
 src/handshake.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/handshake.c b/src/handshake.c
index ef1a8220..5e864af3 100644
--- a/src/handshake.c
+++ b/src/handshake.c
@@ -1227,8 +1227,9 @@ done:
 bool handshake_state_set_pmksa(struct handshake_state *s,
 					struct pmksa *pmksa)
 {
-	/* checks for both expiration || pmksa being set */
-	if (s->expiration)
+	uint64_t now = l_time_now();
+
+	if (s->expiration && l_time_after(now, s->expiration))
 		return false;
 
 	s->pmksa = pmksa;
-- 
2.34.1


      parent reply	other threads:[~2026-03-09 15:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 15:36 [PATCH v2 1/4] station: check return of handshake_state_set_pmksa James Prestwood
2026-03-09 15:36 ` [PATCH v2 2/4] auto-t: refactor testSAE-roam into connect/roam functions James Prestwood
2026-03-09 15:36 ` [PATCH v2 3/4] auto-t: Add test to roam back to BSS with existing PMKSA James Prestwood
2026-03-09 15:36 ` James Prestwood [this message]

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=20260309153629.2012710-4-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