All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 10/12] auto-t: hostapd.py: separate GTK and PTK rekeys
Date: Mon, 04 Oct 2021 09:49:00 -0700	[thread overview]
Message-ID: <20211004164902.2274318-10-prestwoj@gmail.com> (raw)
In-Reply-To: 20211004164902.2274318-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

REKEY_GTK kicks off the GTK only handshake where REKEY_PTK does
both (via the 4-way). The way this utility was written was causing
hostapd some major issues since both REKEY_GTK and REKEY_PTK was
used.

Instead if address is set only do REKEY_PTK. This will also rekey
the GTK via the 4-way handshake.

If no address is set do REKEY_GTK which will only rekey the GTK.
---
 autotests/util/hostapd.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py
index 9f2dc745..22802be6 100644
--- a/autotests/util/hostapd.py
+++ b/autotests/util/hostapd.py
@@ -202,11 +202,15 @@ class HostapdCLI(object):
         cmd = self.cmdline + ['req_beacon', addr, request]
         ctx.start_process(cmd).wait()
 
-    def rekey(self, address):
+    def rekey(self, address=None):
+        if address:
+            cmd = 'REKEY_PTK %s' % address
+            self.ctrl_sock.sendall(cmd.encode('utf-8'))
+            self.wait_for_event('EAPOL-4WAY-HS-COMPLETED')
+            return
+
         cmd = 'REKEY_GTK'
         self.ctrl_sock.sendall(cmd.encode('utf-8'))
-        cmd = 'REKEY_PTK %s' % address
-        self.ctrl_sock.sendall(cmd.encode('utf-8'))
 
     @property
     def bssid(self):
-- 
2.31.1

                 reply	other threads:[~2021-10-04 16:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20211004164902.2274318-10-prestwoj@gmail.com \
    --to=unknown@example.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.