@@ -1345,10 +1345,23 @@ wpas_nan_pasn_pairing_request_cb(void *ctx, const u8 *peer_nmi, u8 csid,
const struct wpa_ie_data *rsn_data)
{
struct wpa_supplicant *wpa_s = ctx;
+ const struct nan_pairing_cfg *pairing_cfg;
+ const u8 *nonce = NULL;
+ const u8 *tag = NULL;
+
+ pairing_cfg = nan_peer_get_pairing_cfg(wpa_s->nan, peer_nmi,
+ &nonce, &tag);
+ if (!pairing_cfg) {
+ wpa_printf(MSG_DEBUG,
+ "NAN: No pairing config found for peer " MACSTR,
+ MAC2STR(peer_nmi));
+ return;
+ }
wpas_notify_nan_pairing_request(wpa_s, peer_nmi, csid, instance_id,
rsn_data->key_mgmt,
- !!rsn_data->num_pmkid);
+ !!rsn_data->num_pmkid,
+ nonce, tag);
}
#endif /* CONFIG_PASN */
@@ -1388,7 +1388,8 @@ out:
void wpas_notify_nan_pairing_request(struct wpa_supplicant *wpa_s,
const u8 *peer_nmi, u8 csid,
u8 instance_id, int key_mgmt,
- bool verify)
+ bool verify, const u8 *nonce,
+ const u8 *tag)
{
wpa_msg_global(wpa_s, MSG_INFO, NAN_PAIRING_REQUEST
"peer_nmi=" MACSTR
@@ -249,7 +249,8 @@ void wpas_notify_nan_bootstrap_failure(struct wpa_supplicant *wpa_s,
void wpas_notify_nan_pairing_request(struct wpa_supplicant *wpa_s,
const u8 *peer_nmi, u8 csid,
u8 instance_id, int key_mgmt,
- bool verify);
+ bool verify, const u8 *nonce,
+ const u8 *tag);
void wpas_notify_nan_pkr_update(struct wpa_supplicant *wpa_s,
const u8 *peer_nmi, const u8 *iik,
bool revoked);
When a peer initiates a PASN pairing request, upper-layer notification handlers need the peer's NAN Identity Resolution Attribute (NIRA) nonce and tag to perform identity resolution and pairing verification. - Retrieve the peer's NIRA nonce and tag via nan_peer_get_pairing_cfg() in wpas_nan_pasn_pairing_request_cb(). - Pass the nonce and tag to wpas_notify_nan_pairing_request(). Signed-off-by: Junyu Lai <junyulai@google.com> --- v2: - Rebase onto latest main and resolve conflict in wpa_supplicant/notify.h after commit ae95402b2d2e ("NAN-PKBST: Accept Public Key Record updates over Protected Transport"). --- wpa_supplicant/nan_supplicant.c | 15 ++++++++++++++- wpa_supplicant/notify.c | 3 ++- wpa_supplicant/notify.h | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-)