Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2226432/?format=api
{ "id": 2226432, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2226432/?format=api", "web_url": "http://patchwork.ozlabs.org/project/hostap/patch/20260422122424.43776-84-andrei.otcheretianski@intel.com/", "project": { "id": 22, "url": "http://patchwork.ozlabs.org/api/1.2/projects/22/?format=api", "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-84-andrei.otcheretianski@intel.com>", "list_archive_url": null, "date": "2026-04-22T12:24:14", "name": "[83/92] NAN: Add API to retrieve peer pairing configuration", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e960fa34cc36e9aa9e88d718aea556ad18800629", "submitter": { "id": 62065, "url": "http://patchwork.ozlabs.org/api/1.2/people/62065/?format=api", "name": "Andrei Otcheretianski", "email": "andrei.otcheretianski@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/hostap/patch/20260422122424.43776-84-andrei.otcheretianski@intel.com/mbox/", "series": [ { "id": 501001, "url": "http://patchwork.ozlabs.org/api/1.2/series/501001/?format=api", "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/2226432/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2226432/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=CentW13x;\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=LRC1W4ml;\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 4g0z9x0ClZz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 22:31:49 +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 1wFWjf-0000000ABLd-2t37;\n\tWed, 22 Apr 2026 12:31:19 +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 1wFWfo-0000000A34C-1tse\n\tfor hostap@lists.infradead.org;\n\tWed, 22 Apr 2026 12:27:34 +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:49 -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:49 -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=d1xfGK8sX3bivL+nKZv/fbuLur1rxg9Kg+5PJBVvbAo=; b=CentW13x/uo0aD\n\twUq/975+ivapZ4ULBq2Nluq8H1lAQaVPtbsvUknmmijLilEXWThv3XE3ChzZWzq+YUCBzTxsBAFsH\n\tSxS9LWdAG/qlVJ4ojIuggYlYTvujXLs0QdpLOGUAfFHcKP7l2Lwf5TwQ/WgyQ7hvotKIhTyYk/MO/\n\tHzyvURFoUP758Re9USWTZ67M1m/JGBCc69XNptTow9IUCHctwgmjUNAxrIUz4UwyF8co/Wb2QCWTE\n\taZrlWOwRQPy6hVDwcTijxUZ0fze49cul+OgaiiM2mIreCT7itgXXT3bB8VUOjMUSHKNdloPBvAhdg\n\tvB5JpIj2wqhm//L8tTYA==;", "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1776860840; x=1808396840;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=MWWbABERgqFwDGCNsjDKNQC4NZwTPq6NzCkBr7SfFVw=;\n b=LRC1W4mlY8RN3YmQjbxwc7sNRRsPJhYED2jMvm8S+e88COjxAOd6oprs\n 7C3DxUUnPD2K0vUa5e1qet4Hp9/tZBlk7igltigAFxeAAq5ZwLHNNgyTk\n DZOMQbohEVU/hB1oc9dpv5C68qnX7fR/kYL8tfIPN+WDO1JC6VEXSjwnM\n A5Z8BC6i4BQqk1S/9EAVQpgi4vnFc2wyhfrM9KRDGc/IxqKBFv8Muzcq3\n w+9DRL+Q/hQPf4/voYOgymgeUlNJ6CHvG26Y/tAvGjCuFN8t4VMyLbnm/\n P7O11FW7m96FHsp0CuQCnU36ggZU062aujp+NzPJ3I9dgxvbOJt/g/HOR\n Q==;" ], "X-CSE-ConnectionGUID": [ "ZGvefT8YSAClYIvKQQSKFg==", "c/0+RJamRLm5EnN+tOWAnQ==" ], "X-CSE-MsgGUID": [ "xCftC36VRfehIxJnXXjjYw==", "6zxEyAUNT12x0V1z1moCkA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11764\"; a=\"77687597\"", "E=Sophos;i=\"6.23,192,1770624000\";\n d=\"scan'208\";a=\"77687597\"", "E=Sophos;i=\"6.23,192,1770624000\";\n d=\"scan'208\";a=\"231445312\"" ], "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 83/92] NAN: Add API to retrieve peer pairing configuration", "Date": "Wed, 22 Apr 2026 15:24:14 +0300", "Message-ID": "<20260422122424.43776-84-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_052720_650860_3C48C031 ", "X-CRM114-Status": "GOOD ( 16.27 )", "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: Add nan_peer_get_pairing_cfg() API that returns a const\n pointer\n to a peer's NAN pairing configuration. This allows retrieving the pairing\n setup, NPK caching, pairing verification, and cipher suites se [...]\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": "Add nan_peer_get_pairing_cfg() API that returns a const pointer to a\npeer's NAN pairing configuration. This allows retrieving the pairing\nsetup, NPK caching, pairing verification, and cipher suites settings\nfrom peer->pairing.pairing_cfg. In addition this function returns peer's\ntag and nonce.\n\nAlso add support for the \"pairing\" option in wpas_nan_peer_info() to\nquery pairing configuration for a NAN peer. Use the tag/nonce values to\nfind the corresponding identity and dump peer's NPK/NIK.\n\nSigned-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>\n---\n src/nan/nan.c | 27 +++++++++\n src/nan/nan.h | 4 ++\n wpa_supplicant/nan_supplicant.c | 102 +++++++++++++++++++++++++++-----\n 3 files changed, 119 insertions(+), 14 deletions(-)", "diff": "diff --git a/src/nan/nan.c b/src/nan/nan.c\nindex e8556f3638..38006f349f 100644\n--- a/src/nan/nan.c\n+++ b/src/nan/nan.c\n@@ -2092,6 +2092,33 @@ int nan_peer_get_tk(struct nan_data *nan, const u8 *addr,\n }\n \n \n+const struct nan_pairing_cfg * nan_peer_get_pairing_cfg(struct nan_data *nan,\n+\t\t\t\t\t\t\tconst u8 *addr,\n+\t\t\t\t\t\t\tconst u8 **nonce,\n+\t\t\t\t\t\t\tconst u8 **tag)\n+{\n+\tstruct nan_peer *peer;\n+\n+\tif (!nan || !addr || !nonce || !tag)\n+\t\treturn NULL;\n+\n+\tpeer = nan_get_peer(nan, addr);\n+\tif (!peer)\n+\t\treturn NULL;\n+\n+\t/* Return nonce and tag pointers if valid, NULL otherwise */\n+\tif (peer->pairing.nonce_tag_valid) {\n+\t\t*nonce = peer->pairing.nonce;\n+\t\t*tag = peer->pairing.tag;\n+\t} else {\n+\t\t*nonce = NULL;\n+\t\t*tag = NULL;\n+\t}\n+\n+\treturn &peer->pairing.pairing_cfg;\n+}\n+\n+\n static bool\n nan_peer_channel_in_local_sched(const struct nan_data *nan,\n \t\t\t\tint peer_ctrl_freq,\ndiff --git a/src/nan/nan.h b/src/nan/nan.h\nindex 36b9b4acfc..c66b6a3b5a 100644\n--- a/src/nan/nan.h\n+++ b/src/nan/nan.h\n@@ -718,6 +718,10 @@ int nan_peer_get_pot_avail(struct nan_data *nan, const u8 *addr,\n \t\t\t struct nan_peer_potential_avail *pot_avail);\n int nan_peer_dump_pot_avail_to_buf(struct nan_peer_potential_avail *pot_avail,\n \t\t\t\t char *buf, size_t buflen);\n+const struct nan_pairing_cfg * nan_peer_get_pairing_cfg(struct nan_data *nan,\n+\t\t\t\t\t\t\tconst u8 *addr,\n+\t\t\t\t\t\t\tconst u8 **nonce,\n+\t\t\t\t\t\t\tconst u8 **tag);\n int nan_convert_sched_to_avail_attrs(struct nan_data *nan, u8 sequence_id,\n \t\t\t\t u32 map_ids_bitmap,\n \t\t\t\t size_t n_chans,\ndiff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c\nindex acebae9157..8a24937137 100644\n--- a/wpa_supplicant/nan_supplicant.c\n+++ b/wpa_supplicant/nan_supplicant.c\n@@ -943,29 +943,21 @@ fail:\n }\n \n \n-static const struct wpabuf *wpas_nan_get_npk_akmp_cb(void *ctx,\n-\t\t\t\t\t\t const u8 *peer_nmi,\n-\t\t\t\t\t\t const u8 *nonce,\n-\t\t\t\t\t\t const u8 *tag, int *akmp)\n+static const struct wpa_dev_ik *\n+wpas_nan_find_ik_by_nonce_tag(struct wpa_supplicant *wpa_s, const u8 *peer_nmi,\n+\t\t\t const u8 *nonce, const u8 *tag)\n {\n-\tstruct wpa_supplicant *wpa_s = ctx;\n \tstruct wpa_dev_ik *ik;\n \tstruct wpabuf *derived_tag;\n \n-\tif (!akmp) {\n-\t\twpa_printf(MSG_DEBUG, \"NAN: Invalid akmp pointer\");\n-\t\treturn NULL;\n-\t}\n-\n \tif (!nonce || !tag) {\n \t\twpa_printf(MSG_DEBUG, \"NAN: Invalid nonce or tag\");\n \t\treturn NULL;\n \t}\n \n-\twpa_hexdump(MSG_DEBUG, \"NAN: Looking up NPK and AKMP for nonce\",\n-\t\t nonce, NAN_NIRA_NONCE_LEN);\n-\twpa_hexdump(MSG_DEBUG, \"NAN: Looking up NPK and AKMP for tag\",\n-\t\t tag, NAN_NIRA_TAG_LEN);\n+\twpa_printf(MSG_DEBUG, \"NAN: Looking up device identity:\");\n+\twpa_hexdump(MSG_DEBUG, \"NONCE\", nonce, NAN_NIRA_NONCE_LEN);\n+\twpa_hexdump(MSG_DEBUG, \"TAG\", tag, NAN_NIRA_TAG_LEN);\n \n \t/* Iterate over all saved NIKs (stored as device identities) */\n \tfor (ik = wpa_s->conf->identity; ik; ik = ik->next) {\n@@ -1001,7 +993,28 @@ static const struct wpabuf *wpas_nan_get_npk_akmp_cb(void *ctx,\n \t\t\t \"NAN: NIRA validation succeeded with NIK id=%d\",\n \t\t\t ik->id);\n \t\twpabuf_free(derived_tag);\n+\t\treturn ik;\n+\t}\n+\n+\treturn NULL;\n+}\n+\n+\n+static const struct wpabuf *wpas_nan_get_npk_akmp_cb(void *ctx,\n+\t\t\t\t\t\t const u8 *peer_nmi,\n+\t\t\t\t\t\t const u8 *nonce,\n+\t\t\t\t\t\t const u8 *tag, int *akmp)\n+{\n+\tstruct wpa_supplicant *wpa_s = ctx;\n+\tconst struct wpa_dev_ik *ik;\n+\n+\tif (!akmp) {\n+\t\twpa_printf(MSG_DEBUG, \"NAN: Invalid akmp pointer\");\n+\t\treturn NULL;\n+\t}\n \n+\tik = wpas_nan_find_ik_by_nonce_tag(wpa_s, peer_nmi, nonce, tag);\n+\tif (ik) {\n \t\t*akmp = ik->akmp;\n \t\twpa_printf(MSG_DEBUG, \"NAN: Found NPK for NIK id=%d, akmp=%d\",\n \t\t\t ik->id, *akmp);\n@@ -2573,6 +2586,33 @@ int wpas_nan_ndp_terminate(struct wpa_supplicant *wpa_s, char *cmd)\n }\n \n \n+static int wpas_nan_append_ik_info(char *reply, size_t reply_size,\n+\t\t\t\t const struct wpa_dev_ik *ik)\n+{\n+\tchar *pos = reply;\n+\tchar *end = reply + reply_size;\n+\n+\tpos += wpa_scnprintf(pos, end - pos, \"nik_cipher=%d\\n\",\n+\t\t\t ik->dik_cipher);\n+\tpos += wpa_scnprintf(pos, end - pos, \"nik=\");\n+\tpos += wpa_snprintf_hex(pos, end - pos, wpabuf_head(ik->dik),\n+\t\t\t\twpabuf_len(ik->dik));\n+\tpos += wpa_scnprintf(pos, end - pos, \"\\n\");\n+\n+\tif (ik->pmk) {\n+\t\tpos += wpa_scnprintf(pos, end - pos, \"akmp=%s\\n\",\n+\t\t\t\t wpa_key_mgmt_txt(ik->akmp,\n+\t\t\t\t\t\t WPA_PROTO_RSN));\n+\t\tpos += wpa_scnprintf(pos, end - pos, \"npk=\");\n+\t\tpos += wpa_snprintf_hex(pos, end - pos, wpabuf_head(ik->pmk),\n+\t\t\t\t\twpabuf_len(ik->pmk));\n+\t\tpos += wpa_scnprintf(pos, end - pos, \"\\n\");\n+\t}\n+\n+\treturn pos - reply;\n+}\n+\n+\n /* Format: NAN_PEER_INFO <addr> <schedule|potential|capa> [map_id] */\n int wpas_nan_peer_info(struct wpa_supplicant *wpa_s, const char *cmd,\n \t\t char *reply, size_t reply_size)\n@@ -2668,6 +2708,40 @@ int wpas_nan_peer_info(struct wpa_supplicant *wpa_s, const char *cmd,\n \t\tret = wpa_scnprintf(reply, reply_size,\n \t\t\t\t \"supported_methods=0x%04x\\n\",\n \t\t\t\t supported_methods);\n+\t} else if (os_strncmp(pos + 1, \"pairing\", 7) == 0) {\n+\t\tconst struct nan_pairing_cfg *pairing_cfg;\n+\t\tconst struct wpa_dev_ik *ik = NULL;\n+\t\tconst u8 *nonce = NULL;\n+\t\tconst u8 *tag = NULL;\n+\n+\t\tpairing_cfg = nan_peer_get_pairing_cfg(wpa_s->nan, addr,\n+\t\t\t\t\t\t &nonce, &tag);\n+\t\tif (!pairing_cfg) {\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t \"NAN: Failed to get pairing config for peer \"\n+\t\t\t\t MACSTR, MAC2STR(addr));\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tret = wpa_scnprintf(reply, reply_size,\n+\t\t\t\t \"pairing_setup=%d\\n\"\n+\t\t\t\t \"npk_caching=%d\\n\"\n+\t\t\t\t \"pairing_verification=%d\\n\"\n+\t\t\t\t \"cipher_suites=0x%08x\\n\",\n+\t\t\t\t pairing_cfg->pairing_setup,\n+\t\t\t\t pairing_cfg->npk_caching,\n+\t\t\t\t pairing_cfg->pairing_verification,\n+\t\t\t\t pairing_cfg->cipher_suites);\n+\n+\t\t/* Try to find matching NIK if nonce and tag are available */\n+\t\tif (nonce && tag)\n+\t\t\tik = wpas_nan_find_ik_by_nonce_tag(wpa_s, addr, nonce,\n+\t\t\t\t\t\t\t tag);\n+\n+\t\tif (ik)\n+\t\t\tret += wpas_nan_append_ik_info(reply + ret,\n+\t\t\t\t\t\t reply_size - ret, ik);\n+\n \t} else {\n \t\twpa_printf(MSG_INFO, \"NAN: Unknown info type: %s\", pos + 1);\n \t\tret = -1;\n", "prefixes": [ "83/92" ] }