# wpa_supplicant: Failed to set PTK, GTK, to the driver

## TBerben

Hello everyone,

I've been trying to get my laptop to connect to the wireless network for some hours now. I compiled the kernel (2.6.24.2) with IEEE 802.11 and Intel Pro Wirless 2100 support and emerged ipw2100-firmware.

The problem lies with wpa_supplicant, I can't get it to properly exchange WPA2 keys with the router.

/etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

network={

   ssid="berben-wireless"

   scan_ssid=1

   proto=WPA RSN

   key_mgmt=WPA-PSK

   pairwise=CCMP TKIP

   group=CCMP TKIP

   psk="key"

```

~# wpa_supplicant -w -Dwext -ieth1 -c/etc/wpa_supplicant.conf -dd

output:

```
Initializing interface 'eth1' conf '/etc/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

Line: 4 - start of a new network block

ssid - hexdump_ascii(len=15):

     62 65 72 62 65 6e 2d 77 69 72 65 6c 65 73 73      berben-wireless 

scan_ssid=1 (0x1)

proto: 0x3

key_mgmt: 0x2

pairwise: 0x18

group: 0x18

PSK (ASCII passphrase) - hexdump_ascii(len=63): [REMOVED]

PSK (from passphrase) - hexdump(len=32): [REMOVED]

Priority group 0

   id=0 ssid='berben-wireless'

Initializing interface (2) 'eth1'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=22 WE(source)=18 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:0c:f1:40:0a:9a

wpa_driver_wext_set_wpa

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_countermeasures

wpa_driver_wext_set_drop_unencrypted

Setting scan request: 0 sec 100000 usec

Added interface eth1

RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added

State: DISCONNECTED -> SCANNING

Starting AP scan (specific SSID)

Scan SSID - hexdump_ascii(len=15):

     62 65 72 62 65 6e 2d 77 69 72 65 6c 65 73 73      berben-wireless 

Trying to get current scan results first without requesting a new scan to speed up initial association

Received 1997 bytes of scan results (8 BSSes)

Scan results: 8

Selecting BSS from priority group 0

0: 00:0c:f6:21:31:b5 ssid='berben-wireless' wpa_ie_len=0 rsn_ie_len=22 caps=0x11

   selected based on RSN IE

Trying to associate with 00:0c:f6:21:31:b5 (SSID='berben-wireless' freq=2462 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

RSN: using IEEE 802.11i/D9.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2 proto 2

WPA: clearing AP WPA IE

WPA: set AP RSN IE - hexdump(len=22): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Set own WPA IE default - hexdump(len=22): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00

No keys have been configured - skip key clearing

wpa_driver_wext_set_drop_unencrypted

State: SCANNING -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_associate

Association request to the driver failed

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

RSN: Ignored PMKID candidate without preauth flag

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b1a len=23

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b15 len=20

Wireless event: new AP: 00:00:00:00:00:00

Added BSSID 00:0c:f6:21:31:b5 into blacklist

CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

State: ASSOCIATING -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

EAPOL: External notification - EAP success=0

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b19 len=8

Received 1999 bytes of scan results (8 BSSes)

Scan results: 8

Selecting BSS from priority group 0

0: 00:0c:f6:21:31:b5 ssid='berben-wireless' wpa_ie_len=0 rsn_ie_len=22 caps=0x11

   selected based on RSN IE

Trying to associate with 00:0c:f6:21:31:b5 (SSID='berben-wireless' freq=2462 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

RSN: using IEEE 802.11i/D9.0

WPA: Selected cipher suites: group 8 pairwise 8 key_mgmt 2 proto 2

WPA: clearing AP WPA IE

WPA: set AP RSN IE - hexdump(len=22): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00

WPA: using GTK TKIP

WPA: using PTK TKIP

WPA: using KEY_MGMT WPA-PSK

WPA: Set own WPA IE default - hexdump(len=22): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00

No keys have been configured - skip key clearing

wpa_driver_wext_set_drop_unencrypted

State: DISCONNECTED -> ASSOCIATING

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_associate

Association request to the driver failed

Setting authentication timeout: 5 sec 0 usec

EAPOL: External notification - EAP success=0

EAPOL: External notification - EAP fail=0

EAPOL: External notification - portControl=Auto

RSN: Ignored PMKID candidate without preauth flag

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b06 len=8

RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])

Wireless event: cmd=0x8b1a len=23

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

Wireless event: cmd=0x8b15 len=20

Wireless event: new AP: 00:0c:f6:21:31:b5

State: ASSOCIATING -> ASSOCIATED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

Associated to a new BSS: BSSID=00:0c:f6:21:31:b5

No keys have been configured - skip key clearing

Associated with 00:0c:f6:21:31:b5

WPA: Association event - clear replay counter

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

EAPOL: External notification - EAP success=0

EAPOL: External notification - portEnabled=1

EAPOL: SUPP_PAE entering state CONNECTING

EAPOL: SUPP_BE entering state IDLE

Setting authentication timeout: 10 sec 0 usec

Cancelling scan request

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

RTM_NEWLINK, IFLA_IFNAME: Interface 'eth1' added

RX EAPOL from 00:0c:f6:21:31:b5

RX EAPOL - hexdump(len=121): 01 03 00 75 02 00 8a 00 20 00 00 00 00 00 00 00 01 2f 23 39 ed 9f 34 2a ec a0 03 e9 b7 94 01 44 7a 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b0 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 16 dd 14 00 0f ac 04 4d 1e dc cb c1 26 7d a8 78 f6 1b 1f 62 e3 85 57

Setting authentication timeout: 10 sec 0 usec

IEEE 802.1X RX: version=1 type=3 length=117

  EAPOL-Key type=2

  key_info 0x8a (ver=2 keyidx=0 rsvd=0 Pairwise Ack)

  key_length=32 key_data_length=22

  replay_counter - hexdump(len=8): 00 00 00 00 00 00 00 01

  key_nonce - hexdump(len=32): 2f 23 39 ed 9f 34 2a ec a0 03 e9 b7 94 01 44 7a 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b0

  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): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

WPA: RX EAPOL-Key - hexdump(len=121): 01 03 00 75 02 00 8a 00 20 00 00 00 00 00 00 00 01 2f 23 39 ed 9f 34 2a ec a0 03 e9 b7 94 01 44 7a 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b0 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 16 dd 14 00 0f ac 04 4d 1e dc cb c1 26 7d a8 78 f6 1b 1f 62 e3 85 57

State: ASSOCIATED -> 4WAY_HANDSHAKE

WPA: RX message 1 of 4-Way Handshake from 00:0c:f6:21:31:b5 (ver=2)

RSN: msg 1/4 key data - hexdump(len=22): dd 14 00 0f ac 04 4d 1e dc cb c1 26 7d a8 78 f6 1b 1f 62 e3 85 57

RSN: PMKID from Authenticator - hexdump(len=16): 4d 1e dc cb c1 26 7d a8 78 f6 1b 1f 62 e3 85 57

RSN: no matching PMKID found

WPA: Renewed SNonce - hexdump(len=32): 8d 9f 48 a9 a4 20 85 2a 6f 1c 26 c8 dc fe 03 37 4b fd 62 b2 c2 41 a5 ce a7 c8 1d 43 9c ac cb 0f

WPA: PMK - hexdump(len=32): [REMOVED]

WPA: PTK - hexdump(len=64): [REMOVED]

WPA: WPA IE for msg 2/4 - hexdump(len=22): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00

WPA: Sending EAPOL-Key 2/4

WPA: TX EAPOL-Key - hexdump(len=121): 01 03 00 75 02 01 0a 00 00 00 00 00 00 00 00 00 01 8d 9f 48 a9 a4 20 85 2a 6f 1c 26 c8 dc fe 03 37 4b fd 62 b2 c2 41 a5 ce a7 c8 1d 43 9c ac cb 0f 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 4b 32 77 5c e5 0c d7 62 f5 fa 4a 03 c4 8f 37 d6 00 16 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00

RX EAPOL from 00:0c:f6:21:31:b5

RX EAPOL - hexdump(len=171): 01 03 00 a7 02 13 ca 00 20 00 00 00 00 00 00 00 02 2f 23 39 ed 9f 34 2a ec a0 03 e9 b7 94 01 44 7a 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b0 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 eb 71 16 80 79 fb 32 69 78 19 7b 11 c1 61 76 d3 00 48 8a bf eb eb 81 b1 ea 91 3f 7e c1 00 a0 ae f7 a0 37 33 e9 ad 58 1e d1 22 83 13 72 91 c9 c8 6c 70 9d 6d e5 93 f4 63 e2 5f 81 ae 9d 0e 4d 31 de 63 ce a9 55 30 05 94 7e ea a6 7c 1a ae 61 14 3a 37 a4 cb e1 da 0b 1c 8f 1d

IEEE 802.1X RX: version=1 type=3 length=167

  EAPOL-Key type=2

  key_info 0x13ca (ver=2 keyidx=0 rsvd=0 Pairwise Install Ack MIC Secure Encr)

  key_length=32 key_data_length=72

  replay_counter - hexdump(len=8): 00 00 00 00 00 00 00 02

  key_nonce - hexdump(len=32): 2f 23 39 ed 9f 34 2a ec a0 03 e9 b7 94 01 44 7a 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b0

  key_iv - hexdump(len=16): 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b4

  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): eb 71 16 80 79 fb 32 69 78 19 7b 11 c1 61 76 d3

WPA: RX EAPOL-Key - hexdump(len=171): 01 03 00 a7 02 13 ca 00 20 00 00 00 00 00 00 00 02 2f 23 39 ed 9f 34 2a ec a0 03 e9 b7 94 01 44 7a 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b0 2f 60 c5 fe 38 53 a8 b4 92 6f fa 30 66 4d 6d b4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 eb 71 16 80 79 fb 32 69 78 19 7b 11 c1 61 76 d3 00 48 8a bf eb eb 81 b1 ea 91 3f 7e c1 00 a0 ae f7 a0 37 33 e9 ad 58 1e d1 22 83 13 72 91 c9 c8 6c 70 9d 6d e5 93 f4 63 e2 5f 81 ae 9d 0e 4d 31 de 63 ce a9 55 30 05 94 7e ea a6 7c 1a ae 61 14 3a 37 a4 cb e1 da 0b 1c 8f 1d

RSN: encrypted key data - hexdump(len=72): 8a bf eb eb 81 b1 ea 91 3f 7e c1 00 a0 ae f7 a0 37 33 e9 ad 58 1e d1 22 83 13 72 91 c9 c8 6c 70 9d 6d e5 93 f4 63 e2 5f 81 ae 9d 0e 4d 31 de 63 ce a9 55 30 05 94 7e ea a6 7c 1a ae 61 14 3a 37 a4 cb e1 da 0b 1c 8f 1d

WPA: decrypted EAPOL-Key key data - hexdump(len=64): [REMOVED]

State: 4WAY_HANDSHAKE -> 4WAY_HANDSHAKE

WPA: RX message 3 of 4-Way Handshake from 00:0c:f6:21:31:b5 (ver=2)

WPA: IE KeyData - hexdump(len=64): 30 14 01 00 00 0f ac 02 01 00 00 0f ac 02 01 00 00 0f ac 02 00 00 dd 26 00 0f ac 01 01 00 63 62 bf 17 5b 76 fd 13 22 3d d6 58 09 05 06 bf 0a 4b 15 f1 93 47 92 ba f2 9c df 28 4f dd 01 d1 dd 00

WPA: Sending EAPOL-Key 4/4

WPA: TX EAPOL-Key - hexdump(len=99): 01 03 00 5f 02 03 0a 00 00 00 00 00 00 00 00 00 02 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 67 be f9 13 49 ef d6 1c af 05 e3 15 0f 4c 6d 25 00 00

WPA: Installing PTK to the driver.

wpa_driver_wext_set_key: alg=2 key_idx=0 set_tx=1 seq_len=6 key_len=32

Driver did not support SIOCSIWENCODEEXT

WPA: Failed to set PTK to the driver.

EAPOL: External notification - portValid=1

State: 4WAY_HANDSHAKE -> GROUP_HANDSHAKE

RSN: received GTK in pairwise handshake - hexdump(len=34): [REMOVED]

WPA: Group Key - hexdump(len=32): [REMOVED]

WPA: Installing GTK to the driver (keyidx=1 tx=0).

WPA: RSC - hexdump(len=6): 00 00 00 00 00 00

wpa_driver_wext_set_key: alg=2 key_idx=1 set_tx=0 seq_len=6 key_len=32

Driver did not support SIOCSIWENCODEEXT

WPA: Failed to set GTK to the driver.

RSN: Failed to install GTK

RSN: Failed to configure GTK

EAPOL: startWhen --> 0

EAPOL: SUPP_PAE entering state CONNECTING

EAPOL: txStart

WPA: drop TX EAPOL in non-IEEE 802.1X mode (type=1 len=0)

RTM_NEWLINK: operstate=0 ifi_flags=0x11003 ([UP][LOWER_UP])

Wireless event: cmd=0x8b19 len=8

Received 1263 bytes of scan results (5 BSSes)

Scan results: 5

Selecting BSS from priority group 0

0: 00:0c:f6:21:31:b5 ssid='berben-wireless' wpa_ie_len=0 rsn_ie_len=22 caps=0x11

   selected based on RSN IE

Already associated with the selected AP.

Authentication with 00:0c:f6:21:31:b5 timed out.

BSSID 00:0c:f6:21:31:b5 blacklist count incremented to 2

State: GROUP_HANDSHAKE -> DISCONNECTED

wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_wext_disassociate

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0

wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0

EAPOL: External notification - portEnabled=0

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: SUPP_BE entering state INITIALIZE

EAPOL: External notification - portValid=0

Setting scan request: 0 sec 0 usec

State: DISCONNECTED -> SCANNING
```

----------

## davidgurvich

Have you tried to get an IP after using wpa_supplicant?  What you have there won't generate an ip address for your interface, just make it possible to do so.  Does the ap you are trying to connect with use dhcp or do you need to set a static ip?

Also, wpa2 requires certain settings in the kernel (not sure which).  See what crypt modules are loaded.

----------

