Search code examples
wifiiwconfig

wpa_supplicant / wpa_cli not able to detect wrong key of access point


I am developing a handheld device based on IMX233 running embedded linux and is using Unifi CSR6026 for connecting to the WiFi networks. I have got the basic WiFi connectivity running using the wpa_supplicant and wpa_cli utilities. But i'm not able to detect when the user has entered a wrong key for the access point. The 'wpa_cli status' shows 'wpa_state=COMPLETED' and the iwconfig also returns the correct ESSID and MAC address of the access point as currently connected. Is there any other way to find out whether the user has entered a wrong key or not ??

root@freescale ~$ wpa_cli status

Selected interface 'eth0'
bssid=00:24:01:6a:3f:26
ssid=FirstFloorBGN
id=1
pairwise_cipher=WEP-40
group_cipher=WEP-40
key_mgmt=NONE
wpa_state=COMPLETED


root@freescale ~$ iwconfig

lo        no wireless extensionsunifi1: unifi_giwencode: Surprise, do not have a
 valid key index (0)
.

eth0      IEEE 802.11-b/g  ESSID:"FirstFloorBGN"
          Mode:Managed  Frequency:2.422 GHz  Access Point: 00:24:01:6A:3F:26
          Bit Rate=24 Mb/s
          RTS thr=0 B   Fragment thr:off
          Encryption key:off
          Power Management period:500ms  mode:All packets received
          Link Quality=25/40  Signal level=-47 dBm  Noise level=-72 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

Solution

  • With WEP, there is no explicit key exchange, so there is no place in which a decryption error could be noticed. Your options are

    1. switch to WPA
    2. monitor the wireless statistics for decryption errors.

    Note that the latter need not be an indication that the access point is using a different key.