]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - src/ap/ap_config.c
AP: Allow PTK rekeying without Ext KeyID to be disabled as a workaround
[thirdparty/hostap.git] / src / ap / ap_config.c
index 27c4b48e4c56edd03fd39380531131fb3bcd5b43..fddc8ca4462d2366a4d283c0bbea30e5032e0de5 100644 (file)
@@ -64,6 +64,7 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss)
 
        bss->wpa_group_rekey = 600;
        bss->wpa_gmk_rekey = 86400;
+       bss->wpa_deny_ptk0_rekey = PTK0_REKEY_ALLOW_ALWAYS;
        bss->wpa_group_update_count = 4;
        bss->wpa_pairwise_update_count = 4;
        bss->wpa_disable_eapol_key_retries =
@@ -251,6 +252,9 @@ struct hostapd_config * hostapd_config_defaults(void)
                HE_OPERATION_RTS_THRESHOLD_OFFSET;
        /* Set default basic MCS/NSS set to single stream MCS 0-7 */
        conf->he_op.he_basic_mcs_nss_set = 0xfffc;
+       conf->he_op.he_bss_color_disabled = 1;
+       conf->he_op.he_bss_color_partial = 0;
+       conf->he_op.he_bss_color = 1;
 #endif /* CONFIG_IEEE80211AX */
 
        /* The third octet of the country string uses an ASCII space character
@@ -301,6 +305,7 @@ static int hostapd_config_read_wpa_psk(const char *fname,
 
        while (fgets(buf, sizeof(buf), f)) {
                int vlan_id = 0;
+               int wps = 0;
 
                line++;
 
@@ -331,6 +336,8 @@ static int hostapd_config_read_wpa_psk(const char *fname,
                                value = "";
                        if (!os_strcmp(name, "keyid")) {
                                keyid = value;
+                       } else if (!os_strcmp(name, "wps")) {
+                               wps = atoi(value);
                        } else if (!os_strcmp(name, "vlanid")) {
                                vlan_id = atoi(value);
                        } else {
@@ -348,8 +355,9 @@ static int hostapd_config_read_wpa_psk(const char *fname,
                if (!token)
                        token = "";
                if (hwaddr_aton(token, addr)) {
-                       wpa_printf(MSG_ERROR, "Invalid MAC address '%s' on "
-                                  "line %d in '%s'", token, line, fname);
+                       wpa_printf(MSG_ERROR,
+                                  "Invalid MAC address '%s' on line %d in '%s'",
+                                  token, line, fname);
                        ret = -1;
                        break;
                }
@@ -377,16 +385,17 @@ static int hostapd_config_read_wpa_psk(const char *fname,
 
                ok = 0;
                len = os_strlen(pos);
-               if (len == 64 && hexstr2bin(pos, psk->psk, PMK_LEN) == 0)
+               if (len == 2 * PMK_LEN &&
+                   hexstr2bin(pos, psk->psk, PMK_LEN) == 0)
                        ok = 1;
-               else if (len >= 8 && len < 64) {
-                       pbkdf2_sha1(pos, ssid->ssid, ssid->ssid_len,
-                                   4096, psk->psk, PMK_LEN);
+               else if (len >= 8 && len < 64 &&
+                        pbkdf2_sha1(pos, ssid->ssid, ssid->ssid_len,
+                                    4096, psk->psk, PMK_LEN) == 0)
                        ok = 1;
-               }
                if (!ok) {
-                       wpa_printf(MSG_ERROR, "Invalid PSK '%s' on line %d in "
-                                  "'%s'", pos, line, fname);
+                       wpa_printf(MSG_ERROR,
+                                  "Invalid PSK '%s' on line %d in '%s'",
+                                  pos, line, fname);
                        os_free(psk);
                        ret = -1;
                        break;
@@ -404,6 +413,8 @@ static int hostapd_config_read_wpa_psk(const char *fname,
                        }
                }
 
+               psk->wps = wps;
+
                psk->next = ssid->wpa_psk;
                ssid->wpa_psk = psk;
        }
@@ -1159,7 +1170,6 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
        }
 #endif /* CONFIG_IEEE80211R_AP */
 
-#ifdef CONFIG_IEEE80211N
        if (full_config && conf->ieee80211n &&
            conf->hw_mode == HOSTAPD_MODE_IEEE80211B) {
                bss->disable_11n = 1;
@@ -1184,7 +1194,6 @@ static int hostapd_config_check_bss(struct hostapd_bss_config *bss,
                           "requires CCMP/GCMP to be enabled, disabling HT "
                           "capabilities");
        }
-#endif /* CONFIG_IEEE80211N */
 
 #ifdef CONFIG_IEEE80211AC
        if (full_config && conf->ieee80211ac &&