From patchwork Thu May 7 19:11:30 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 2234531 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=32krYuOy; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=AktfHWIp; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) 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 4gBMNg2v80z1yM5 for ; Fri, 08 May 2026 05:13: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=sgpmfjftzx8AEqzERK6Fqr54p2IFqJPstUPGQuWxBbA=; b=32krYuOyfoXkiS tiVsKtIRdWxy7anCUUw/DgK6rDorPdRUXNSuDV+YOU2rLDFIkD1waj8FPxmOwxH+NpLGtSE6reHFZ tFd0h8k0+W42Xc5EFn4282bvW1eWTBLKkKQHz1Q+1kloFxPjH/HtppwuadOrwF5yFkI1CilAM9OjO Wesa9dNWo2N8omKhk4w/hN/URZsE0ULFHI13mAg4jAEw1b0VatSIOStS8ytGPF8Zh1E0XLrl+lfjO rxbwTcA5k7nbaLZRWDEAr6oxIa7AA5B36arNH8baZIVXrQgFmallOD5KMBnwmnKAqySfwDT4XjgI0 1t3/nJVYHFpv3u1zNtfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wL48e-00000004fwJ-037N; Thu, 07 May 2026 19:12:00 +0000 Received: from mgamail.intel.com ([198.175.65.9]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wL48b-00000004fuK-0KCh for hostap@lists.infradead.org; Thu, 07 May 2026 19:11:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778181117; x=1809717117; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=j6vD0l4b8bXh8QUpxyWXIPGtJHEWijGUU4ROKMyDzK8=; b=AktfHWIpVYuqxg+S7Zpej3D9XJfOGH8Q31kqdQzOPGLNFIEiG1JyqVTw iKPNH4PRtlSsomMbDK0B1MncZ+eeVs7d6dH95AmdTq5PeYRnHeYUG13sO eB1dTRWYryWlYTql+cqseEpvROsNj4nKy2W7a3o+1WhXSw3Bd/YNHka6V 8uhd1pA+hekmYiZnHRZ+jK/b7e0k3PdwUUVo6WrGkBVjgmiFTXkB9cv+/ 4BA1jWAr/fqNDoO8/NHXep45kDMwqXvWULqrrWn+pqaBvh6AN0hPzxvEd TpRC2KWXHXJycvkIQ6yfzKKJTTTOMLCJTNBjmLYdzQ7hbIz4uLLGAV8SV A==; X-CSE-ConnectionGUID: XpN2RqoSRlyxKg/JTV/5ZA== X-CSE-MsgGUID: L+kuXKvGSsqZIS8JjRaOlw== X-IronPort-AV: E=McAfee;i="6800,10657,11779"; a="101818687" X-IronPort-AV: E=Sophos;i="6.23,222,1770624000"; d="scan'208";a="101818687" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2026 12:11:55 -0700 X-CSE-ConnectionGUID: yoXrd/gLQICnbNFSQ1ZpCQ== X-CSE-MsgGUID: Gf04jz/ASxqRUyM/g++svA== X-ExtLoop1: 1 Received: from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com) ([10.167.28.6]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 May 2026 12:11:54 -0700 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer Subject: [PATCH] NAN: Set new NIK before computing the new tag Date: Thu, 7 May 2026 22:11:30 +0300 Message-ID: <20260507191130.36955-4-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260507_121157_152145_21F1FF85 X-CRM114-Status: UNSURE ( 9.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.8 (----) 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: Ilan Peer Set the new NIK before computing the new tag, as the computation uses the stored NIK. Signed-off-by: Ilan Peer --- src/nan/nan_pairing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Content analysis details: (-4.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [198.175.65.9 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an 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.4 DKIMWL_WL_HIGH DKIMwl.org - High trust sender -0.0 DMARC_PASS DMARC pass 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: Ilan Peer Set the new NIK before computing the new tag, as the computation uses the stored NIK. Signed-off-by: Ilan Peer --- src/nan/nan_pairing.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nan/nan_pairing.c b/src/nan/nan_pairing.c index b03ca68dac..ad29c8427e 100644 --- a/src/nan/nan_pairing.c +++ b/src/nan/nan_pairing.c @@ -1493,6 +1493,8 @@ int nan_pairing_set_nik(struct nan_data *nan, const u8 *nik, size_t nik_len) return -1; } + os_memcpy(nan->cfg->nik, nik, NAN_NIK_LEN); + if (nan->cfg->pairing_cfg.pairing_verification) { if (nan_nira_get_tag_nonce(nan->cfg, nonce, tag) < 0) { wpa_printf(MSG_INFO, @@ -1510,8 +1512,6 @@ int nan_pairing_set_nik(struct nan_data *nan, const u8 *nik, size_t nik_len) os_memset(nan->nira_tag, 0, NAN_NIRA_TAG_LEN); } - os_memcpy(nan->cfg->nik, nik, NAN_NIK_LEN); - wpa_hexdump_key(MSG_DEBUG, "NAN: New NIK", nan->cfg->nik, NAN_NIK_LEN); return 0;