fix(wpa_supplicant): accept NIK follow-up key descriptor with Key Type=0

iPhone (and hostap) set Key Type=0 in the pairing NIK follow-up Shared-Key
Descriptor (key_info=0x1340) since the NIK is not a pairwise key. We required
the pairwise bit and rejected the frame before decryption, so the NIK
exchange timed out and pairing was torn down. Require only the Encrypted
Key Data bit.

(cherry picked from commit 94988c5aa4)
This commit is contained in:
Sarvesh Bodakhe
2026-09-01 14:18:47 +08:00
committed by Jack
parent 897dd47eb5
commit 7aee122f30
@@ -761,11 +761,7 @@ int nan_pasn_followup_decrypt_keys(const uint8_t *shared_key_attr,
key_desc = (const struct wpa_eapol_key *)(body + 1);
key_info = WPA_GET_BE16(key_desc->key_info);
if (!(key_info & WPA_KEY_INFO_KEY_TYPE)) {
wpa_printf(MSG_INFO,
"NAN: Follow-up frame does not contain pairwise key");
return -1;
}
/* iPhone/hostap set Key Type=0 (NIK is not a pairwise key); don't require the bit. */
if (!(key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) {
wpa_printf(MSG_INFO,
"NAN: Follow-up frame does not contain encrypted key data");