{"id":2226430,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2226430/?format=json","web_url":"http://patchwork.ozlabs.org/project/hostap/patch/20260422122424.43776-82-andrei.otcheretianski@intel.com/","project":{"id":22,"url":"http://patchwork.ozlabs.org/api/1.2/projects/22/?format=json","name":"HostAP Development","link_name":"hostap","list_id":"hostap.lists.infradead.org","list_email":"hostap@lists.infradead.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260422122424.43776-82-andrei.otcheretianski@intel.com>","list_archive_url":null,"date":"2026-04-22T12:24:12","name":"[81/92] NAN: Add NAN-PAIRING-REQUEST notification","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"f45f9de65b991baa71fee7f45745e3cbe860f275","submitter":{"id":62065,"url":"http://patchwork.ozlabs.org/api/1.2/people/62065/?format=json","name":"Andrei Otcheretianski","email":"andrei.otcheretianski@intel.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/hostap/patch/20260422122424.43776-82-andrei.otcheretianski@intel.com/mbox/","series":[{"id":501001,"url":"http://patchwork.ozlabs.org/api/1.2/series/501001/?format=json","web_url":"http://patchwork.ozlabs.org/project/hostap/list/?series=501001","date":"2026-04-22T12:23:05","name":"Add NAN PASN pairing support","version":1,"mbox":"http://patchwork.ozlabs.org/series/501001/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226430/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226430/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PQGiBPCo;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=Gk2HlEAo;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0z9s3swDz1yHB\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 22:31:45 +1000 (AEST)","from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wFWjW-0000000AB8J-3869;\n\tWed, 22 Apr 2026 12:31:10 +0000","from mgamail.intel.com ([192.198.163.17])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wFWfm-0000000A3P1-2R1U\n\tfor hostap@lists.infradead.org;\n\tWed, 22 Apr 2026 12:27:31 +0000","from orviesa010.jf.intel.com ([10.64.159.150])\n  by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Apr 2026 05:26:46 -0700","from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com)\n ([10.167.28.6])\n  by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 22 Apr 2026 05:26:45 -0700"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=R5kjJQqU+W/BqAU0krPfK9eRmVP/0U/9BG4sZnQsVi8=; b=PQGiBPCoFgt9YC\n\tRidKEjItQykt4/GFkoVaL3SzYDc/zLKMkR87dkYsKIXge3JeAd1JvvIpKbzOAk3Ch/x/WS7UzRQPp\n\tTEPNvmIh174uaWhsmxVCYv7tGPbkqqJBgTLqjRUyd2q5wNVxCBZUA3FENRODBt9a7SaDh1UD7R9TR\n\tTGmv6Wq7lfe/CAUiGBRvfsPj1IzAsp4bvO7Dz57IsX11a9AH78OIYdr8wKJbswmuR659rv98H8rHU\n\tKnPj/J2BTmOArL7bZ9rC5ZBHnt2q9w4HsV1eUVPwmqOGKJ363COxvdhjHpN5Bsf57XnKXE2FwImlO\n\tr0893eluikt1bMXyfviw==;","v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1776860838; x=1808396838;\n  h=from:to:cc:subject:date:message-id:in-reply-to:\n   references:mime-version:content-transfer-encoding;\n  bh=OUnmKhLbklf4IYAYfYVQq4oeL7q3W/PJe7pTNj+GuE8=;\n  b=Gk2HlEAoUzsbJSCks83eF4ZMuZuauXhO/x3L/AxQv2iqOMxtmnwFa5rM\n   EyIaFrG1FRcvIPL6QxClFW7UPDBd/+KajjrrtOEKEDqiOsNqL/QkUjnJY\n   3sAcxfM3JoxhSM0oPbmz8PfkljQabqOZjebpTQV4R8ec5lvCtJ8lmQsI5\n   eUm3CxF8IDElzFcqOQuVh2CbgXp5PhZNVyIQKIDFgKjt0CaTHMXkE3pDv\n   uU3owjGiZshgA6+IQrKVsMiCI0oP70uzuWo4sJOuXFak/mZXjyilKlcYq\n   1gCNupyMr3FFKGKNYpM62optGeQM1t1wKHk4T7aBByYAkmjQTB0GpNBG5\n   w==;"],"X-CSE-ConnectionGUID":["BQB2tQdZTLC/tBlAPwG4fw==","sISJzWnyR6mHHKXViHjoXA=="],"X-CSE-MsgGUID":["PBJgxD8VRB6vuxgO5vC3wg==","7zqiMSTUTpqMon7/VV+Qog=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11764\"; a=\"77687580\"","E=Sophos;i=\"6.23,192,1770624000\";\n   d=\"scan'208\";a=\"77687580\"","E=Sophos;i=\"6.23,192,1770624000\";\n   d=\"scan'208\";a=\"231445304\""],"X-ExtLoop1":"1","From":"Andrei Otcheretianski <andrei.otcheretianski@intel.com>","To":"hostap@lists.infradead.org","Cc":"vamsin@qti.qualcomm.com,\n\tmaheshkkv@google.com,\n\tAndrei Otcheretianski <andrei.otcheretianski@intel.com>","Subject":"[PATCH 81/92] NAN: Add NAN-PAIRING-REQUEST notification","Date":"Wed, 22 Apr 2026 15:24:12 +0300","Message-ID":"<20260422122424.43776-82-andrei.otcheretianski@intel.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260422122424.43776-1-andrei.otcheretianski@intel.com>","References":"<20260422122424.43776-1-andrei.otcheretianski@intel.com>","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20260422_052718_805640_150C9CA7 ","X-CRM114-Status":"GOOD (  19.15  )","X-Spam-Score":"-4.4 (----)","X-Spam-Report":"Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  When PASN pairing authentication message is received and\n the\n    peer wasn't authorized to pair yet,\n store the frame and notify upper layers.\n    Upon NAN_PAIR authorization, process the stored frame. This is [...]\n Content analysis details:   (-4.4 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,\n                             medium trust\n                             [192.198.163.17 listed in list.dnswl.org]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n -0.0 DKIMWL_WL_HIGH         DKIMwl.org - High trust sender","X-BeenThere":"hostap@lists.infradead.org","X-Mailman-Version":"2.1.34","Precedence":"list","List-Id":"<hostap.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/hostap/>","List-Post":"<mailto:hostap@lists.infradead.org>","List-Help":"<mailto:hostap-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"Hostap\" <hostap-bounces@lists.infradead.org>","Errors-To":"hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"When PASN pairing authentication message is received and the peer wasn't\nauthorized to pair yet, store the frame and notify upper layers. Upon\nNAN_PAIR authorization, process the stored frame.\nThis is needed, as otherwise the responder side may not know that it\nshould authorize pairing with the peer.\n\nSigned-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>\n---\n src/common/wpa_ctrl.h           |  1 +\n src/nan/nan.h                   | 11 +++++++++\n src/nan/nan_i.h                 |  2 ++\n src/nan/nan_pairing.c           | 41 +++++++++++++++++++++++++++++++--\n wpa_supplicant/nan_supplicant.c | 10 ++++++++\n wpa_supplicant/notify.c         | 10 ++++++++\n wpa_supplicant/notify.h         |  3 +++\n 7 files changed, 76 insertions(+), 2 deletions(-)","diff":"diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h\nindex afb207b509..628b64cf7d 100644\n--- a/src/common/wpa_ctrl.h\n+++ b/src/common/wpa_ctrl.h\n@@ -255,6 +255,7 @@ extern \"C\" {\n #define NAN_BOOTSTRAP_SUCCESS \"NAN-BOOTSTRAP-SUCCESS \"\n #define NAN_BOOTSTRAP_FAILURE \"NAN-BOOTSTRAP-FAILURE \"\n #define NAN_NIK_RECEIVED \"NAN-NIK-RECEIVED \"\n+#define NAN_PAIRING_REQUEST \"NAN-PAIRING-REQUEST \"\n \n /* NAN Pairing status\n  * addr=<peer address> akmp=<SAE|PASN> cipher=<CCMP|GCMP-256> status=<success|failure> [nd_pmk=<hex>]\ndiff --git a/src/nan/nan.h b/src/nan/nan.h\nindex ab89fc6599..36b9b4acfc 100644\n--- a/src/nan/nan.h\n+++ b/src/nan/nan.h\n@@ -663,6 +663,17 @@ struct nan_config {\n \tconst struct wpabuf *(*get_npk_akmp)(void *ctx, const u8 *peer_nmi,\n \t\t\t\t\t     const u8 *nonce, const u8 *tag,\n \t\t\t\t\t     int *akmp);\n+\n+\n+\t/**\n+\t * pairing_request - Notify about received pairing request\n+\t *\n+\t * @ctx: Callback context from cb_ctx\n+\t * @peer_nmi: Peer NMI address\n+\t * @csid: Cipher suite ID requested by the peer\n+\t * @instance_id: Service instance ID for which the pairing is requested\n+\t */\n+\tvoid (*pairing_request)(void *ctx, const u8 *peer_nmi, u8 csid, u8 instance_id);\n };\n \n struct nan_data * nan_init(const struct nan_config *cfg);\ndiff --git a/src/nan/nan_i.h b/src/nan/nan_i.h\nindex 598b552e81..c2257f56fb 100644\n--- a/src/nan/nan_i.h\n+++ b/src/nan/nan_i.h\n@@ -488,6 +488,7 @@ enum nan_pairing_role {\n  * @nonce: Nonce from peer's NIRA attribute\n  * @tag: Tag from peer's NIRA attribute\n  * @flags: Bitmap of pairing flags. See NAN_PAIRING_FLAG_*\n+ * @pending_auth1: Pending PASN Authentication frame 1 to be processed\n  */\n struct nan_pairing_peer_data {\n \tstruct nan_pairing_cfg pairing_cfg;\n@@ -499,6 +500,7 @@ struct nan_pairing_peer_data {\n \tu8 nonce[NAN_NIRA_NONCE_LEN];\n \tu8 tag[NAN_NIRA_TAG_LEN];\n \tu32 flags;\n+\tstruct wpabuf *pending_auth1;\n };\n \n /**\ndiff --git a/src/nan/nan_pairing.c b/src/nan/nan_pairing.c\nindex b468de3bb4..43b59e154f 100644\n--- a/src/nan/nan_pairing.c\n+++ b/src/nan/nan_pairing.c\n@@ -85,6 +85,9 @@ int nan_pairing_add_attrs(struct nan_data *nan, struct wpabuf *buf)\n \n void nan_pairing_deinit_peer(struct nan_peer *peer)\n {\n+\twpabuf_free(peer->pairing.pending_auth1);\n+\tpeer->pairing.pending_auth1 = NULL;\n+\n \tif (!peer->pairing.pasn)\n \t\treturn;\n \n@@ -107,7 +110,7 @@ int nan_pairing_abort(struct nan_data *nan_data, const u8 *peer_addr)\n \t\treturn -1;\n \t}\n \n-\tif (!peer->pairing.pasn) {\n+\tif (!peer->pairing.pasn && !peer->pairing.pending_auth1) {\n \t\twpa_printf(MSG_DEBUG,\n \t\t\t   \"NAN: Pairing abort: No PASN in progress with peer \"\n \t\t\t   MACSTR, MAC2STR(peer_addr));\n@@ -554,8 +557,20 @@ int nan_pairing_initiate_pasn_auth(struct nan_data *nan_data, const u8 *addr,\n \n \tnan_configure_peer_schedule(nan_data, peer, sched);\n \n-\tif (responder)\n+\tif (responder) {\n+\t\tif (peer->pairing.pending_auth1) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Pairing: Responder - process pending Auth1\");\n+\t\t\tret = nan_pairing_auth_rx(nan_data,\n+\t\t\t\twpabuf_head(peer->pairing.pending_auth1),\n+\t\t\t\twpabuf_len(peer->pairing.pending_auth1));\n+\t\t\twpabuf_free(peer->pairing.pending_auth1);\n+\t\t\tpeer->pairing.pending_auth1 = NULL;\n+\n+\t\t\treturn ret;\n+\t\t}\n \t\treturn 0;\n+\t}\n \n \tif (auth_mode == NAN_PASN_AUTH_MODE_PMK) {\n \t\tpeer->pairing.flags |= NAN_PAIRING_FLAG_NPK_VERIFICATION;\n@@ -1210,6 +1225,28 @@ int nan_pairing_auth_rx(struct nan_data *nan_data,\n \t}\n \n \tif (!peer->pairing.pasn) {\n+\t\tif (status_code == WLAN_STATUS_SUCCESS &&\n+\t\t    auth_transaction == 1) {\n+\t\t\tstruct nan_cipher_suite cs;\n+\n+\t\t\tif (nan_pairing_process_elems(nan_data, peer, mgmt, len, &cs)) {\n+\t\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t\t   \"NAN: Pairing: Handle Auth1 NAN attributes failed\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\n+\t\t\twpabuf_free(peer->pairing.pending_auth1);\n+\t\t\tpeer->pairing.pending_auth1 =\n+\t\t\t\twpabuf_alloc_copy((const u8 *)mgmt, len);\n+\t\t\tif (!peer->pairing.pending_auth1)\n+\t\t\t\treturn -1;\n+\n+\t\t\tnan_data->cfg->pairing_request(nan_data->cfg->cb_ctx,\n+\t\t\t\t\t\t       peer->nmi_addr, cs.csid,\n+\t\t\t\t\t\t       cs.instance_id);\n+\t\t\treturn 0;\n+\t\t}\n+\n \t\twpa_printf(MSG_DEBUG,\n \t\t\t   \"NAN: Pairing: PASN data not initialized for peer\");\n \t\treturn -1;\ndiff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c\nindex 94b7366a8c..432e752fc3 100644\n--- a/wpa_supplicant/nan_supplicant.c\n+++ b/wpa_supplicant/nan_supplicant.c\n@@ -1057,6 +1057,15 @@ static const struct wpabuf *wpas_nan_get_npk_akmp_cb(void *ctx,\n \twpa_printf(MSG_DEBUG, \"NAN: No matching NIK found\");\n \treturn NULL;\n }\n+\n+\n+static void\n+wpas_nan_pasn_pairing_request_cb(void *ctx, const u8 *peer_nmi, u8 csid,\n+\t\t\t\t u8 instance_id)\n+{\n+\tstruct wpa_supplicant *wpa_s = ctx;\n+\twpas_notify_nan_pairing_request(wpa_s, peer_nmi, csid, instance_id);\n+}\n #endif /* CONFIG_PASN */\n \n \n@@ -1088,6 +1097,7 @@ int wpas_nan_init(struct wpa_supplicant *wpa_s)\n \t\tnan.update_pairing_credentials =\n \t\t\twpas_nan_update_pairing_credentials_cb;\n \t\tnan.get_npk_akmp = wpas_nan_get_npk_akmp_cb;\n+\t\tnan.pairing_request = wpas_nan_pasn_pairing_request_cb;\n \t\tnan.pairing_cfg.pairing_setup = true;\n \t\tnan.pairing_cfg.npk_caching = true;\n \t\tnan.pairing_cfg.pairing_verification = true;\ndiff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c\nindex 82f05fd117..3e122ed7fe 100644\n--- a/wpa_supplicant/notify.c\n+++ b/wpa_supplicant/notify.c\n@@ -1330,6 +1330,16 @@ out:\n \tos_free(npk_hex);\n }\n \n+\n+void wpas_notify_nan_pairing_request(struct wpa_supplicant *wpa_s,\n+\t\t\t\t     const u8 *peer_nmi, u8 csid,\n+\t\t\t\t     u8 instance_id)\n+{\n+\twpa_msg_global(wpa_s, MSG_INFO, NAN_PAIRING_REQUEST\n+\t\t       \"peer_nmi=\" MACSTR \" csid=%u instance_id=%u\",\n+\t\t       MAC2STR(peer_nmi), csid, instance_id);\n+}\n+\n #endif /* CONFIG_NAN || CONFIG_NAN_USD */\n \n \ndiff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h\nindex 3db90b780e..3b1517d91b 100644\n--- a/wpa_supplicant/notify.h\n+++ b/wpa_supplicant/notify.h\n@@ -230,5 +230,8 @@ void wpas_notify_nan_bootstrap_failure(struct wpa_supplicant *wpa_s,\n \t\t\t\t       const u8 *peer_addr, u16 pbm,\n \t\t\t\t       u8 reason, int handle,\n \t\t\t\t       u8 requestor_instance_id);\n+void wpas_notify_nan_pairing_request(struct wpa_supplicant *wpa_s,\n+\t\t\t\t     const u8 *peer_nmi, u8 csid,\n+\t\t\t\t     u8 instance_id);\n \n #endif /* NOTIFY_H */\n","prefixes":["81/92"]}