Move PSK/passphrase configuration check into use time from parsing
authorJouni Malinen <j@w1.fi>
Fri, 3 Aug 2012 17:56:18 +0000 (20:56 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 3 Aug 2012 19:15:42 +0000 (22:15 +0300)
Instead of rejecting network blocks without PSK/passphrase at the time
the configuration file is read, allow such configuration to be loaded
and only behave as if the network block with missing PSK/passphrase is
disabled.

Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/config_file.c
wpa_supplicant/config_winreg.c
wpa_supplicant/wpa_supplicant.c

index 8badc7b..a55a5c9 100644 (file)
@@ -99,12 +99,6 @@ static int wpa_config_validate_network(struct wpa_ssid *ssid, int line)
                wpa_config_update_psk(ssid);
        }
 
-       if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set) {
-               wpa_printf(MSG_ERROR, "Line %d: WPA-PSK accepted for key "
-                          "management, but no PSK configured.", line);
-               errors++;
-       }
-
        if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
            !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
            !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {
index de2ec58..6d9876c 100644 (file)
@@ -344,13 +344,6 @@ static struct wpa_ssid * wpa_config_read_network(HKEY hk, const TCHAR *netw,
                wpa_config_update_psk(ssid);
        }
 
-       if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set) {
-               wpa_printf(MSG_ERROR, "WPA-PSK accepted for key management, "
-                          "but no PSK configured for network '" TSTR "'.",
-                          netw);
-               errors++;
-       }
-
        if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
            !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
            !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {
index c65dc3c..5025410 100644 (file)
@@ -3388,6 +3388,9 @@ int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
                return 1; /* invalid WEP key */
        }
 
+       if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set)
+               return 1;
+
        return 0;
 }