]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Disallow WEP configuration in WPA network
authorJouni Malinen <j@w1.fi>
Sat, 31 Aug 2013 14:18:45 +0000 (17:18 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 31 Aug 2013 14:18:45 +0000 (17:18 +0300)
Some drivers fail to work if WEP keys are configured in a WPA network.
To avoid potentially confusing error cases, reject hostapd configuration
that enables WPA and includes parameters that would imply that WEP keys
would be set.

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

hostapd/config_file.c

index a420c882c48412157a689c6db20b5856ed0906f2..0b4fd772bbfdc7b7a6b4bcb47797f2331c8d1f30 100644 (file)
@@ -1104,6 +1104,24 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
                return -1;
        }
 
+       if (bss->wpa) {
+               int wep, i;
+
+               wep = bss->default_wep_key_len > 0 ||
+                      bss->individual_wep_key_len > 0;
+               for (i = 0; i < NUM_WEP_KEYS; i++) {
+                       if (bss->ssid.wep.keys_set) {
+                               wep = 1;
+                               break;
+                       }
+               }
+
+               if (wep) {
+                       wpa_printf(MSG_ERROR, "WEP configuration in a WPA network is not supported");
+                       return -1;
+               }
+       }
+
        if (bss->wpa && bss->wpa_psk_radius != PSK_RADIUS_IGNORED &&
            bss->macaddr_acl != USE_EXTERNAL_RADIUS_AUTH) {
                wpa_printf(MSG_ERROR, "WPA-PSK using RADIUS enabled, but no "