wpa_supplicant: nl80211: set_key failed; err=-22

Richard Knoop richard.knoop
Tue Nov 18 03:19:12 PST 2014


Hi,

we are using wpa_supplicant 2.3 and libnl 3.2.25 in combination with a 
WL1271 device on a i.MX28.

We encounter something strange errors.
All works well and stable but a soon as we have a AP with a TKIP cypher, 
we get an error:

Failed to set PTK to the driver (alg=2 keylen=32 bssid=00:11:50:7d:05:c0)

If we enable the debug we see:

===========================

wlan0: WPA: Installing PTK to the driver
WPA: RSC - hexdump(len=6): 00 00 00 00 00 00
wpa_driver_nl80211_set_key: ifindex=5 alg=2 addr=0xe46ec key_idx=0 
set_tx=1 seq_len=6 key_len=32
    addr=00:11:50:7d:05:c0
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: WPA: Failed to set PTK to the driver (alg=2 keylen=32 
bssid=00:11:50:7d:05:c0)

===Some more debug===========

wlan0: State: ASSOCIATED -> 4WAY_HANDSHAKE
wlan0: WPA: RX message 1 of 4-Way Handshake from 00:11:50:7d:05:c0 (ver=1)
Get randomness: len=32 entropy=2
WPA: Renewed SNonce - hexdump(len=32): b1 6c 21 d2 1c fb 78 a0 21 48 75 
78 c1 8f 2c fd ab 94 df 92 92 02 00 57 bb 33 95 fb 77 1c b8 e9
WPA: PTK derivation - A1=de:ad:be:ef:00:00 A2=00:11:50:7d:05:c0
WPA: Nonce1 - hexdump(len=32): b1 6c 21 d2 1c fb 78 a0 21 48 75 78 c1 8f 
2c fd ab 94 df 92 92 02 00 57 bb 33 95 fb 77 1c b8 e9
WPA: Nonce2 - hexdump(len=32): 53 7c 7c 67 8e 06 35 2c 8e e7 ce 10 be 3e 
3d 91 b3 f0 1f 63 63 80 1a ad 42 27 1e de ec d4 bc 00
WPA: PMK - hexdump(len=32): [REMOVED]
WPA: PTK - hexdump(len=64): [REMOVED]
WPA: WPA IE for msg 2/4 - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 
f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02
WPA: Replay Counter - hexdump(len=8): 00 00 00 00 00 00 00 00
wlan0: WPA: Sending EAPOL-Key 2/4
WPA: KCK - hexdump(len=16): [REMOVED]
WPA: Derived Key MIC - hexdump(len=16): ce 6a 38 88 ff 70 6a 10 85 d3 88 
71 9e 2c dc d0
WPA: TX EAPOL-Key - hexdump(len=123): 01 03 00 77 fe 01 09 00 20 00 00 
00 00 00 00 00 00 b1 6c 21 d2 1c fb 78 a0 21 48 75 78 c1 8f 2c fd ab 94 
df 92 92 02 00 57 bb 33 95 fb 77 1c b8 e9 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ce 6a 
38 88 ff 70 6a 10 85 d3 88 71 9e 2c dc d0 00 18 dd 16 00 50 f2 01 01 00 
00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan0' added
nl80211: if_removed already cleared - ignore event
nl80211: Event message available
nl80211: Ignore connect event (cmd=46) when using userspace SME
wlan0: RX EAPOL from 00:11:50:7d:05:c0
RX EAPOL - hexdump(len=123): 01 03 00 77 fe 01 c9 00 20 00 00 00 00 00 
00 00 01 53 7c 7c 67 8e 06 35 2c 8e e7 ce 10 be 3e 3d 91 b3 f0 1f 63 63 
80 1a ad 42 27 1e de ec d4 bc 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 9c 2b da 57 
09 e3 2c 04 5e 59 f9 ae 97 6c f9 00 18 dd 16 00 50 f2 01 01 00 00 50 f2 
02 01 00 00 50 f2 02 01 00 00 50 f2 02
wlan0: IEEE 802.1X RX: version=1 type=3 length=119
wlan0:   EAPOL-Key type=254
wlan0:   key_info 0x1c9 (ver=1 keyidx=0 rsvd=0 Pairwise Install Ack MIC)
wlan0:   key_length=32 key_data_length=24
   replay_counter - hexdump(len=8): 00 00 00 00 00 00 00 01
   key_nonce - hexdump(len=32): 53 7c 7c 67 8e 06 35 2c 8e e7 ce 10 be 
3e 3d 91 b3 f0 1f 63 63 80 1a ad 42 27 1e de ec d4 bc 00
   key_iv - hexdump(len=16): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   key_rsc - hexdump(len=8): 00 00 00 00 00 00 00 00
   key_id (reserved) - hexdump(len=8): 00 00 00 00 00 00 00 00
   key_mic - hexdump(len=16): 44 9c 2b da 57 09 e3 2c 04 5e 59 f9 ae 97 
6c f9
WPA: RX EAPOL-Key - hexdump(len=123): 01 03 00 77 fe 01 c9 00 20 00 00 
00 00 00 00 00 01 53 7c 7c 67 8e 06 35 2c 8e e7 ce 10 be 3e 3d 91 b3 f0 
1f 63 63 80 1a ad 42 27 1e de ec d4 bc 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 44 9c 
2b da 57 09 e3 2c 04 5e 59 f9 ae 97 6c f9 00 18 dd 16 00 50 f2 01 01 00 
00 50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02
wlan0: State: 4WAY_HANDSHAKE -> 4WAY_HANDSHAKE
wlan0: WPA: RX message 3 of 4-Way Handshake from 00:11:50:7d:05:c0 (ver=1)
WPA: IE KeyData - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 50 f2 02 
01 00 00 50 f2 02 01 00 00 50 f2 02
WPA: WPA IE in EAPOL-Key - hexdump(len=24): dd 16 00 50 f2 01 01 00 00 
50 f2 02 01 00 00 50 f2 02 01 00 00 50 f2 02
wlan0: WPA: Sending EAPOL-Key 4/4
WPA: KCK - hexdump(len=16): [REMOVED]
WPA: Derived Key MIC - hexdump(len=16): 29 56 38 cb bb 4f 18 53 85 b6 37 
38 f3 54 06 40
WPA: TX EAPOL-Key - hexdump(len=99): 01 03 00 5f fe 01 09 00 20 00 00 00 
00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 29 56 38 
cb bb 4f 18 53 85 b6 37 38 f3 54 06 40 00 00
wlan0: WPA: Installing PTK to the driver
WPA: RSC - hexdump(len=6): 00 00 00 00 00 00
wpa_driver_nl80211_set_key: ifindex=5 alg=2 addr=0xe46ec key_idx=0 
set_tx=1 seq_len=6 key_len=32
    addr=00:11:50:7d:05:c0
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: WPA: Failed to set PTK to the driver (alg=2 keylen=32 
bssid=00:11:50:7d:05:c0)
wlan0: Request to deauthenticate - bssid=00:11:50:7d:05:c0 
pending_bssid=00:00:00:00:00:00 reason=1 state=4WAY_HANDSHAKE
wpa_driver_nl80211_deauthenticate(addr=00:11:50:7d:05:c0 reason_code=1)
wlan0: Event DEAUTH (12) received
wlan0: Deauthentication notification
wlan0:  * reason 1 (locally generated)
Deauthentication frame IE(s) - hexdump(len=0): [NULL]
wlan0: CTRL-EVENT-DISCONNECTED bssid=00:11:50:7d:05:c0 reason=1 
locally_generated=1
wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="blabla" auth_failures=1 
duration=10
wlan0: Auto connect enabled: try to reconnect (wps=0 wpa_state=7)
wlan0: Setting scan request: 0 sec 500000 usec
Added BSSID 00:11:50:7d:05:c0 into blacklist
wlan0: Blacklist count 1 --> request scan in 100 ms
wlan0: Setting scan request: 0 sec 100000 usec
wlan0: Disconnect event - remove keys
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=0 
set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=1 
set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=2 
set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=(nil) key_idx=3 
set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=5 alg=0 addr=0xe3680 key_idx=0 
set_tx=0 seq_len=0 key_len=0
    addr=00:11:50:7d:05:c0
nl80211: No pending priority to cancel
wlan0: State: 4WAY_HANDSHAKE -> DISCONNECTED

===================================

Anyone any bright ideas?

-- 
Met vriendelijke groet / With kind regards,

Richard Knoop (richard.knoop at actum.com), Actum Solutions
Tel +31 72 576 2555
Newtonstraat 27, 1704SB Heerhugowaard, Netherlands


-- 
Met vriendelijke groet / With kind regards,

Richard Knoop (richard.knoop at ibb.nl), Ingenieursburo Balvers BV
Tel +31 72 576 2552
Newtonstraat 27, 1704SB Heerhugowaard, Netherlands




More information about the Hostap mailing list