Move PSK/passphrase configuration check into use time from parsing

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>
This commit is contained in:
Jouni Malinen 2012-08-03 20:56:18 +03:00
parent 1ecd2ada33
commit 2518aad3e8
3 changed files with 3 additions and 13 deletions

View file

@ -99,12 +99,6 @@ static int wpa_config_validate_network(struct wpa_ssid *ssid, int line)
wpa_config_update_psk(ssid); 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) && if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
!(ssid->pairwise_cipher & WPA_CIPHER_CCMP) && !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
!(ssid->pairwise_cipher & WPA_CIPHER_NONE)) { !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {

View file

@ -344,13 +344,6 @@ static struct wpa_ssid * wpa_config_read_network(HKEY hk, const TCHAR *netw,
wpa_config_update_psk(ssid); 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) && if ((ssid->group_cipher & WPA_CIPHER_CCMP) &&
!(ssid->pairwise_cipher & WPA_CIPHER_CCMP) && !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
!(ssid->pairwise_cipher & WPA_CIPHER_NONE)) { !(ssid->pairwise_cipher & WPA_CIPHER_NONE)) {

View file

@ -3388,6 +3388,9 @@ int wpas_network_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
return 1; /* invalid WEP key */ return 1; /* invalid WEP key */
} }
if (wpa_key_mgmt_wpa_psk(ssid->key_mgmt) && !ssid->psk_set)
return 1;
return 0; return 0;
} }