]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - hostapd/config_file.c
Allow RSNE in EAPOL-Key msg 3/4 to be replaced for testing purposes
[thirdparty/hostap.git] / hostapd / config_file.c
index f77651a7b540fa00a584f2a85c7557a8da19d644..98e9fd21b605a5591c02676dbd8de3100da895b1 100644 (file)
@@ -793,6 +793,7 @@ static int hostapd_config_parse_cipher(int line, const char *value)
 }
 
 
+#ifdef CONFIG_WEP
 static int hostapd_config_read_wep(struct hostapd_wep_keys *wep, int keyidx,
                                   char *val)
 {
@@ -843,6 +844,7 @@ static int hostapd_config_read_wep(struct hostapd_wep_keys *wep, int keyidx,
 
        return 0;
 }
+#endif /* CONFIG_WEP */
 
 
 static int hostapd_parse_chanlist(struct hostapd_config *conf, char *val)
@@ -2664,6 +2666,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
        } else if (os_strcmp(buf, "erp_domain") == 0) {
                os_free(bss->erp_domain);
                bss->erp_domain = os_strdup(pos);
+#ifdef CONFIG_WEP
        } else if (os_strcmp(buf, "wep_key_len_broadcast") == 0) {
                int val = atoi(pos);
 
@@ -2691,6 +2694,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                   line, bss->wep_rekeying_period);
                        return 1;
                }
+#endif /* CONFIG_WEP */
        } else if (os_strcmp(buf, "eap_reauth_period") == 0) {
                bss->eap_reauth_period = atoi(pos);
                if (bss->eap_reauth_period < 0) {
@@ -2874,6 +2878,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->wpa_gmk_rekey = atoi(pos);
        } else if (os_strcmp(buf, "wpa_ptk_rekey") == 0) {
                bss->wpa_ptk_rekey = atoi(pos);
+       } else if (os_strcmp(buf, "wpa_deny_ptk0_rekey") == 0) {
+               bss->wpa_deny_ptk0_rekey = atoi(pos);
+               if (bss->wpa_deny_ptk0_rekey < 0 ||
+                   bss->wpa_deny_ptk0_rekey > 2) {
+                       wpa_printf(MSG_ERROR,
+                                  "Line %d: Invalid wpa_deny_ptk0_rekey=%d; allowed range 0..2",
+                                  line, bss->wpa_deny_ptk0_rekey);
+                       return 1;
+               }
        } else if (os_strcmp(buf, "wpa_group_update_count") == 0) {
                char *endp;
                unsigned long val = strtoul(pos, &endp, 0);
@@ -3302,6 +3315,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->ignore_broadcast_ssid = atoi(pos);
        } else if (os_strcmp(buf, "no_probe_resp_if_max_sta") == 0) {
                bss->no_probe_resp_if_max_sta = atoi(pos);
+#ifdef CONFIG_WEP
        } else if (os_strcmp(buf, "wep_default_key") == 0) {
                bss->ssid.wep.idx = atoi(pos);
                if (bss->ssid.wep.idx > 3) {
@@ -3320,6 +3334,7 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                                   line, buf);
                        return 1;
                }
+#endif /* CONFIG_WEP */
 #ifndef CONFIG_NO_VLAN
        } else if (os_strcmp(buf, "dynamic_vlan") == 0) {
                bss->ssid.dynamic_vlan = atoi(pos);
@@ -4161,6 +4176,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
        } else if (os_strcmp(buf, "sae_commit_override") == 0) {
                wpabuf_free(bss->sae_commit_override);
                bss->sae_commit_override = wpabuf_parse_bin(pos);
+       } else if (os_strcmp(buf, "rsne_override_eapol") == 0) {
+               wpabuf_free(bss->rsne_override_eapol);
+               bss->rsne_override_eapol = wpabuf_parse_bin(pos);
        } else if (os_strcmp(buf, "rsnxe_override_eapol") == 0) {
                wpabuf_free(bss->rsnxe_override_eapol);
                bss->rsnxe_override_eapol = wpabuf_parse_bin(pos);