This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to identify Authentication failure using wpa_supplicant?

Hello Friends,

I am using i.MX28 as host with WL1835MOD. I am using wpa_supplicant to connect to AP. It works fine but when there is authentication failure, I dont get any way to tell application to stop wpa_supplicant as it will keep trying even if there is an authentication failure. Even I tried to tract the command wpa_cli status but didnt get any concrete information.


Can any one throw some light how can I handle this situation in best case?

Regards,

Ankur

  • Hi Ankur,

    Can you please paste the complete logs (including the wpa_supplicant logs)?

    Regards,
    Gigi Joseph.

  • Hello Giji,

    Thank you for quick response. Please find the details at below.

    Snapshot of WiFi driver loading at booting time:
    Starting udev
    [    8.182353] udevd[62]: starting version 182
    [   13.147095] compat-drivers backport release:
    [   13.151670] Backport based on  ol_r8.a8.10
    [   13.155809] compat.git:
    [   15.528701] cfg80211: Calling CRDA to update world regulatory domain
    [   16.352485] wlcore: wl18xx driver version:
    Starting Bootlog daemon: [   17.023414] wlcore: wl18xx HW: 183x or 180x, PG 2.2 (ROM 0x11)
    [   17.152504] wlcore: loaded
    [   17.155393] wlcore: driver version:
    [   17.159008] wlcore: compilation time: Mon Jun 16 12:12:03 2014


    wpa_supplicant.conf (AP with incorrect password) used in this exercise:
    root@imx28evk:~# cat /etc/wpa_supplicant.conf
    ctrl_interface=/var/run/wpa_supplicant
    update_config=1
    ap_scan=1
    network={
            ssid="RADAR_WiFi-1"
            proto=RSN
            key_mgmt=WPA-PSK
            pairwise=CCMP TKIP
            group=CCMP TKIP
            psk="11111111"
    }

    Wpa_supplicant log file option -f not working (not available in list):
    root@imx28evk:~# wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -f /var/tmp/wpa.log -c /etc/wpa_supplicant.conf -D wext
    wpa_supplicant v2.0
    Copyright (c) 2003-2012, Jouni Malinen <j@w1.fi> and contributors
    This software may be distributed under the terms of the BSD license.
    See README for more details.
    usage:
      wpa_supplicant [-BddhKLqqstuvW] [-P<pid file>] [-g<global ctrl>] \
            -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
            [-b<br_ifname>] [-f<debug file>] [-e<entropy file>] \
            [-o<override driver>] [-O<override ctrl>] \
            [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
            [-p<driver_param>] [-b<br_ifname>] ...]
    drivers:
      wext = Linux wireless extensions (generic)
      nl80211 = Linux nl80211/cfg80211
      wired = Wired Ethernet driver
    options: // Missing -f option here
      -b = optional bridge interface name
      -B = run daemon in the background
      -c = Configuration file
      -C = ctrl_interface parameter (only used if -c is not)
      -i = interface name
      -d = increase debugging verbosity (-dd even more)
      -D = driver name (can be multiple drivers: nl80211,wext)
      -e = entropy file
      -g = global ctrl_interface
      -K = include keys (passwords, etc.) in debug output
      -t = include timestamp in debug messages
      -h = show this help text
      -L = show license (BSD)
      -o = override driver parameter for new interfaces
      -O = override ctrl_interface parameter for new interfaces
      -p = driver parameters
      -P = PID file
      -q = decrease debugging verbosity (-qq even less)
      -u = enable DBus control interface
      -v = show version
      -W = wait for a control interface monitor before starting
      -N = start describing new interface
    example:
      wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
     
     
    Started wpa_supplicant as application instead of daemon:  
    root@imx28evk:~# wpa_supplicant -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -c /etc/wpa_supplicant.conf -D wext
    Successfully initialized wpa_supplicant
    [ 4829.191264] wlcore: PHY firmware version: Rev 8.2.0.0.195
    [ 4829.301128] wlcore: firmware booted (Rev 8.8.0.0.13)
    wlan0: Trying to associate with 98:fc:11:92:62:61 (SSID=[ 4833.197041] wlan0: authenticate with 98:fc:11:92:62:61
    'RADAR_WiFi-1' freq=2437 MHz)
    ioctl[SIOCSIWFREQ]: Device or resource busy
    [ 4833.215963] wlan0: send auth to 98:fc:11:92:62:61 (try 1/3)
    wlan0: Association request to the driver failed
    [ 4833.240838] wlan0: authenticated
    [ 4833.251260] wlan0: associate with 98:fc:11:92:62:61 (try 1/3)
    [ 4833.263044] wlan0: RX AssocResp from 98:fc:11:92:62:61 (capab=0x11 status=0 aid=4)
    [ 4833.298092] wlcore: Association completed.
    [ 4833.310828] wlan0: associated
    wlan0: Associated with 98:fc:11:92:62:61
    [ 4841.407678] wlan0: deauthenticated from 98:fc:11:92:62:61 (Reason: 15)
    [ 4841.483950] cfg80211: Calling CRDA to update world regulatory domain
    wlan0: CTRL-EVENT-DISCONNECTED bssid=98:fc:11:92:62:61 reason=0
    wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
    wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="RADAR_WiFi-1" auth_failures=1 duration=10
    wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="RADAR_WiFi-1[ 4853.829283] wlan0: authenticate with 98:fc:11:92:62:61
    wlan0: Trying to associate with 98:fc:11:92:62:61 (SSID='RADAR_WiFi-1' freq=2437 MHz)
    ioctl[SIOCSIWFREQ]: Device or resource busy
    [ 4853.849289] wlan0: send auth to 98:fc:11:92:62:61 (try 1/3)
    wlan0: Association request to the driver failed
    [ 4853.873810] wlan0: authenticated
    [ 4853.881268] wlan0: associate with 98:fc:11:92:62:61 (try 1/3)
    [ 4853.892580] wlan0: RX AssocResp from 98:fc:11:92:62:61 (capab=0x11 status=0 aid=4)
    [ 4853.902997] unwind: Index not found bf0ff3bc
    [ 4853.934653] wlcore: Association completed.
    [ 4853.946677] wlan0: associated
    wlan0: Associated with 98:fc:11:92:62:61
    [ 4862.064058] wlan0: deauthenticated from 98:fc:11:92:62:61 (Reason: 15)
    [ 4862.142309] cfg80211: Calling CRDA to update world regulatory domain
    wlan0: CTRL-EVENT-DISCONNECTED bssid=98:fc:11:92:62:61 reason=0
    wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
    wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="RADAR_WiFi-1" auth_failures=2 duration=20
    wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="RADAR_WiFi-1[ 4883.538788] wlan0: authenticate with 98:fc:11:92:62:61
    wlan0: Trying to associate with 98:fc:11:92:62:61 (SSID='RADAR_WiFi-1' freq=2437 MHz)
    ioctl[SIOCSIWFREQ]: Device or resource busy
    [ 4883.559989] wlan0: send auth to 98:fc:11:92:62:61 (try 1/3)
    wlan0: Association request to the driver failed
    [ 4883.584943] wlan0: authenticated
    [ 4883.591251] wlan0: associate with 98:fc:11:92:62:61 (try 1/3)
    [ 4883.603234] wlan0: RX AssocResp from 98:fc:11:92:62:61 (capab=0x11 status=0 aid=4)
    [ 4883.639917] wlcore: Association completed.
    [ 4883.652312] wlan0: associated
    wlan0: Associated with 98:fc:11:92:62:61
    [ 4891.765852] wlan0: deauthenticated from 98:fc:11:92:62:61 (Reason: 15)
    [ 4891.849198] cfg80211: Calling CRDA to update world regulatory domain
    wlan0: CTRL-EVENT-DISCONNECTED bssid=98:fc:11:92:62:61 reason=0
    wlan0: WPA: 4-Way Handshake failed - pre-shared key may be incorrect
    wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="RADAR_WiFi-1" auth_failures=3 duration=20
    ...

    Please feel free to share in case if you need more logs.

    Regards,

    Ankur

  • Hello Gigi,

    I am still trying to find out the way to use wpa_supplicant for disconnect notification. Could you please share your concern or insight how can I achieve it?


    Regards,

    Ankur

  • Hello Gigi,

    I missed to update you..

    I appreciate your kind Help!!.. I have modified the wpa_supplicant.c file esp. "wpas_auth_failed" function and resolved my requirement.


    Regards,

    Ankur