X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=package%2Fnetwork%2Fservices%2Fhostapd%2Ffiles%2Fhostapd.sh;h=540d1182cce60ad530b23c4bd3158442b6efcbb7;hp=2c015f9c4b28705ef68e2c825dac46b616859544;hb=4c3fae4adcd41f43cf734e4d07a457b111a3d864;hpb=4ed40be3e32643560874688d34b6fc69e6c4d20d diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 2c015f9c4b..540d1182cc 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -37,11 +37,38 @@ hostapd_append_wep_key() { } hostapd_append_wpa_key_mgmt() { - local auth_type="$(echo $auth_type | tr 'a-z' 'A-Z')" + local auth_type_l="$(echo $auth_type | tr 'a-z' 'A-Z')" - append wpa_key_mgmt "WPA-$auth_type" - [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type}" - [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type}-SHA256" + case "$auth_type" in + psk|eap) + append wpa_key_mgmt "WPA-$auth_type_l" + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-${auth_type_l}" + [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-${auth_type_l}-SHA256" + ;; + eap192) + append wpa_key_mgmt "WPA-EAP-SUITE-B-192" + ;; + eap-eap192) + append wpa_key_mgmt "WPA-EAP-SUITE-B-192" + append wpa_key_mgmt "WPA-EAP" + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-EAP" + [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-EAP-SHA256" + ;; + sae) + append wpa_key_mgmt "SAE" + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-SAE" + ;; + psk-sae) + append wpa_key_mgmt "WPA-PSK" + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-PSK" + [ "${ieee80211w:-0}" -gt 0 ] && append wpa_key_mgmt "WPA-PSK-SHA256" + append wpa_key_mgmt "SAE" + [ "${ieee80211r:-0}" -gt 0 ] && append wpa_key_mgmt "FT-SAE" + ;; + owe) + append wpa_key_mgmt "OWE" + ;; + esac } hostapd_add_log_config() { @@ -67,6 +94,7 @@ hostapd_common_add_device_config() { config_add_boolean legacy_rates config_add_string acs_chan_bias + config_add_array hostapd_options hostapd_add_log_config } @@ -127,6 +155,11 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" + json_get_values opts hostapd_options + for val in $opts; do + append base_cfg "$val" "$N" + done + cat > "$config" <