From patchwork Fri Sep 11 04:21:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 2302837 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=YJzyCTSd; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=sipsolutions.net header.i=@sipsolutions.net header.a=rsa-sha256 header.s=mail header.b=OjkP4uIB; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4hhGxP10q6z1xxw for ; Sat, 12 Sep 2026 00:23:37 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zkXDPIsaFsRgxyUOo8RFtI9bHdfTmlOkeEFCd1xlUDg=; b=YJzyCTSdjsXTxC Jb8mJoPUadlbEkU0bvkBe9fj63+R7rUOyRSJ0moagT7PqECHqmGs/3iBxswYTu2GCsdwQVnLZ8QgH PCgOlkEudbP83UL4DT0nZtaTFUFA6LNrlL68XRSrpW5v8gRAFoThsKVnMy3fFtsPKibO1BuUlb0mn MWTrf6A3GuV208ieZbUNi10HCntnAWyzArqlZuFPqVgYxUcTeBacs7WR07UY1z8scSX61exz45aF3 pvaPLp/sbpoesks+ZdnChVDLWZsjtg1+swm2vMYYcu+syKqL4QANqJRGRDEoHpCVXciXdkEN+VvnV dBuD9NPPWSV36Wa/eORA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1x528m-0000000GtdP-0Ze6; Fri, 11 Sep 2026 14:22:08 +0000 Received: from s3.sipsolutions.net ([2a01:4f8:242:246e::2] helo=sipsolutions.net) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1x528i-0000000Gtbd-2CHh for hostap@lists.infradead.org; Fri, 11 Sep 2026 14:22:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=/BHVfwTTWCoE/lsRIi663o+jxNs1awXeKL5QTpu1guU=; t=1789136524; x=1790346124; b=OjkP4uIBYnbdbqoxxWLIeQGi/Nw8cNGt37tM0jDdN5UFRS6xrTaLOMpFYuy563ehdbV8Z+Mmho8 eyZwp24Npm2xRsbpX+WEGAiUTCbAQAImIaVqPynNdPRkIy7Ea2uPOSHYNRVQBQWw0bUuPnmE+HIxH sHpAndddjEjMrhUChKKY6KLUBs2tEel5Mroi5RYwVYFOHzrJhtLqAiR6SyBSXGcmUEHbTBk1L+kEc sJ0hcLhGF7mBcTckfcm93F7JsKIa7FLD8OJvSC2hNqdfh1m7eVO9DkgLeKHv1OrRCa6Pz7Tvf0H2/ UYE2CRbgIIB1B/Flninzpcu3svp5rpKM5eMw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__ECDSA_SECP256R1_SHA256__AES_256_GCM:256) (Exim 4.98.2) (envelope-from ) id 1x528c-0000000C3Fz-0aZy; Fri, 11 Sep 2026 16:21:58 +0200 From: Johannes Berg To: hostap@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 1/3] hostapd: ctrl_iface: add commands to get GTK/IGTK/BIGTK Date: Fri, 11 Sep 2026 16:21:56 +0200 Message-ID: <20260911162155.a68a3333d735.I91a1d4893862b7f2e04707626ba62c2216e835c9@changeid> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260911_072204_845366_843DFB73 X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Johannes Berg For some of the tests that the relay module enables we'll have to have beacon protection, so the relay will have to recalculate the MIC in the MME. Add testing commands to get the GTK/IGTK/BIGTK from hostapd. Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 DMARC_MISSING Missing DMARC policy X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Johannes Berg For some of the tests that the relay module enables we'll have to have beacon protection, so the relay will have to recalculate the MIC in the MME. Add testing commands to get the GTK/IGTK/BIGTK from hostapd. Signed-off-by: Johannes Berg --- hostapd/ctrl_iface.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 380a7bc24b6b..dc36b302de57 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -2559,6 +2559,39 @@ static int hostapd_ctrl_get_pmk(struct hostapd_data *hapd, const char *cmd, } +static int hostapd_ctrl_get_gtk(struct hostapd_data *hapd, char *buf, + size_t buflen) +{ + if (hapd->last_gtk_alg == WPA_ALG_NONE) + return -1; + + return wpa_snprintf_hex(buf, buflen, hapd->last_gtk, + hapd->last_gtk_len); +} + + +static int hostapd_ctrl_get_igtk(struct hostapd_data *hapd, char *buf, + size_t buflen) +{ + if (hapd->last_igtk_alg == WPA_ALG_NONE) + return -1; + + return wpa_snprintf_hex(buf, buflen, hapd->last_igtk, + hapd->last_igtk_len); +} + + +static int hostapd_ctrl_get_bigtk(struct hostapd_data *hapd, char *buf, + size_t buflen) +{ + if (hapd->last_bigtk_alg == WPA_ALG_NONE) + return -1; + + return wpa_snprintf_hex(buf, buflen, hapd->last_bigtk, + hapd->last_bigtk_len); +} + + static int hostapd_ctrl_register_frame(struct hostapd_data *hapd, const char *cmd) { @@ -4486,6 +4519,12 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd, } else if (os_strncmp(buf, "GET_PMK ", 8) == 0) { reply_len = hostapd_ctrl_get_pmk(hapd, buf + 8, reply, reply_size); + } else if (os_strcmp(buf, "GET_GTK") == 0) { + reply_len = hostapd_ctrl_get_gtk(hapd, reply, reply_size); + } else if (os_strcmp(buf, "GET_IGTK") == 0) { + reply_len = hostapd_ctrl_get_igtk(hapd, reply, reply_size); + } else if (os_strcmp(buf, "GET_BIGTK") == 0) { + reply_len = hostapd_ctrl_get_bigtk(hapd, reply, reply_size); } else if (os_strncmp(buf, "REGISTER_FRAME ", 15) == 0) { if (hostapd_ctrl_register_frame(hapd, buf + 16) < 0) reply_len = -1;