hostap/src
Beniamino Galvani 77a020a118 wpa_supplicant: Fix auth failure when the MAC is updated externally
When connecting to a WPA-EAP network and the MAC address is changed
just before the association (for example by NetworkManager, which sets
a random MAC during scans), the authentication sometimes fails in the
following way ('####' logs added by me):

wpa_supplicant logs:
 wlan0: WPA: RX message 1 of 4-Way Handshake from 02:00:00:00:01:00 (ver=1)
 RSN: msg 1/4 key data - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 WPA: PMKID in EAPOL-Key - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 RSN: PMKID from Authenticator - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 wlan0: RSN: no matching PMKID found
 EAPOL: Successfully fetched key (len=32)
 WPA: PMK from EAPOL state machines - hexdump(len=32): [REMOVED]
 #### WPA: rsn_pmkid():
 #### WPA: aa              - hexdump(len=6): 02 00 00 00 01 00
 #### WPA: spa             - hexdump(len=6): 66 20 cf ab 8c dc
 #### WPA: PMK             - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7
 #### WPA: computed PMKID  - hexdump(len=16): ea 73 67 b1 8e 5f 18 43 58 24 e8 1c 47 23 87 71
 RSN: Replace PMKSA entry for the current AP and any PMKSA cache entry that was based on the old PMK
 nl80211: Delete PMKID for 02:00:00:00:01:00
 wlan0: RSN: PMKSA cache entry free_cb: 02:00:00:00:01:00 reason=1
 RSN: Added PMKSA cache entry for 02:00:00:00:01:00 network_ctx=0x5630bf85a270
 nl80211: Add PMKID for 02:00:00:00:01:00
 wlan0: RSN: PMKID mismatch - authentication server may have derived different MSK?!

hostapd logs:
 WPA: PMK from EAPOL state machine (MSK len=64 PMK len=32)
 WPA: 02:00:00:00:00:00 WPA_PTK entering state PTKSTART
 wlan1: STA 02:00:00:00:00:00 WPA: sending 1/4 msg of 4-Way Handshake
 #### WPA: rsn_pmkid():
 #### WPA: aa              - hexdump(len=6): 02 00 00 00 01 00
 #### WPA: spa             - hexdump(len=6): 02 00 00 00 00 00
 #### WPA: PMK             - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7
 #### WPA: computed PMKID  - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23
 WPA: Send EAPOL(version=1 secure=0 mic=0 ack=1 install=0 pairwise=1 kde_len=22 keyidx=0 encr=0)

That's because wpa_supplicant computed the PMKID using the wrong (old)
MAC address used during the scan. wpa_supplicant updates own_addr when
the interface goes up, as the MAC can only change while the interface
is down. However, drivers don't report all interface state changes:
for example the nl80211 driver may ignore a down-up cycle if the down
message is processed later, when the interface is already up. In such
cases, wpa_supplicant (and in particular, the EAP state machine) would
continue to use the old MAC.

Add a new driver event that notifies of MAC address changes while the
interface is active.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
2018-03-30 12:16:42 +03:00
..
ap Add hostapd.conf venue_url to set Venue URL ANQP-element 2018-03-26 16:10:47 +03:00
common Add SAR V2 power selection capability (QCA vendor attributes) 2018-03-30 10:49:11 +03:00
crypto Add support for wolfSSL cryptographic library 2018-03-03 11:52:40 +02:00
drivers wpa_supplicant: Fix auth failure when the MAC is updated externally 2018-03-30 12:16:42 +03:00
eap_common EAP-pwd: Use abstract crypto API 2017-12-24 21:40:21 +02:00
eap_peer EAP-SIM/AKA: Separate identity for MK derivation 2018-01-21 11:28:53 +02:00
eap_server EAP-pwd: Use abstract crypto API 2017-12-24 21:40:21 +02:00
eapol_auth Add hostapd tls_flags parameter 2017-09-18 12:12:48 +03:00
eapol_supp eap_proxy: Support multiple SIMs in get_imsi() 2017-06-06 03:42:32 +03:00
fst FST: Silence compiler warning on WPA_ASSERT 2017-01-29 18:45:29 +02:00
l2_packet tests: Add TEST_FAIL() checks in l2_packet 2017-03-04 11:43:58 +02:00
p2p P2P: Continue P2P_WAIT_PEER_(IDLE/CONNECT) sequence on a listen cancel 2017-11-03 21:47:32 +02:00
pae mka: Mark ieee802_1x_kay_create_mka() ckn and cak arguments const 2018-03-11 17:04:34 +02:00
radius Add definitions for RADIUS attributes standardised in RFC 7055 2018-03-30 11:04:29 +03:00
rsn_supp FILS: Fix CONFIG_FILS=y build without CONFIG_IEEE80211R=y 2018-03-26 12:33:52 +03:00
tls Use os_memdup() 2017-03-07 13:19:10 +02:00
utils Define host_to_le64() for Windows builds 2018-02-17 18:04:54 +02:00
wps WPS: Do not increment wildcard_uuid when pin is locked 2017-10-03 19:19:01 +03:00
lib.rules Add QUIET=1 option for make 2014-12-29 15:49:05 +02:00
Makefile FST: Add the Fast Session Transfer (FST) module 2015-07-16 18:26:15 +03:00