config_add_string nasid
config_add_string ownip
config_add_string iapp_interface
- config_add_string eap_type ca_cert client_cert identity auth priv_key priv_key_pwd
+ config_add_string eap_type ca_cert client_cert identity anonymous_identity auth priv_key priv_key_pwd
config_add_int dynamic_vlan vlan_naming
config_add_string vlan_tagged_interface vlan_bridge
wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 \
wps_device_type wps_device_name wps_manufacturer wps_pin \
macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
- iapp_interface eapol_version
+ iapp_interface eapol_version acct_server acct_secret acct_port
set_default isolate 0
set_default maxassoc 0
set_default wmm 1
set_default uapsd 1
set_default eapol_version 0
+ set_default acct_port 1813
append bss_conf "ctrl_interface=/var/run/hostapd"
if [ "$isolate" -gt 0 ]; then
[ -n "$wpa_master_rekey" ] && append bss_conf "wpa_gmk_rekey=$wpa_master_rekey" "$N"
}
+ [ -n "$acct_server" ] && {
+ append bss_conf "acct_server_addr=$acct_server" "$N"
+ append bss_conf "acct_server_port=$acct_port" "$N"
+ [ -n "$acct_secret" ] && \
+ append bss_conf "acct_server_shared_secret=$acct_secret" "$N"
+ }
+
case "$auth_type" in
none)
wps_possible=1
eap)
json_get_vars \
auth_server auth_secret auth_port \
- acct_server acct_secret acct_port \
dae_client dae_secret dae_port \
ownip \
eap_reauth_period dynamic_vlan \
[ -n "$auth_secret" ] || json_get_var auth_secret key
set_default auth_port 1812
- set_default acct_port 1813
set_default dae_port 3799
set_default vlan_naming 1
append bss_conf "auth_server_port=$auth_port" "$N"
append bss_conf "auth_server_shared_secret=$auth_secret" "$N"
- [ -n "$acct_server" ] && {
- append bss_conf "acct_server_addr=$acct_server" "$N"
- append bss_conf "acct_server_port=$acct_port" "$N"
- [ -n "$acct_secret" ] && \
- append bss_conf "acct_server_shared_secret=$acct_secret" "$N"
- }
-
[ -n "$eap_reauth_period" ] && append bss_conf "eap_reauth_period=$eap_reauth_period" "$N"
[ -n "$dae_client" -a -n "$dae_secret" ] && {
[ -n "$wps_possible" -a -n "$config_methods" ] && {
set_default ext_registrar 0
set_default wps_device_type "6-0050F204-1"
- set_default wps_device_name "OpenWrt AP"
- set_default wps_manufacturer "openwrt.org"
+ set_default wps_device_name "Lede AP"
+ set_default wps_manufacturer "www.lede-project.org"
wps_state=2
[ -n "$wps_configured" ] && wps_state=1
_w_modestr="mode=1"
}
+ local country_str=
+ [ -n "$country" ] && {
+ country_str="country=$country"
+ }
+
wpa_supplicant_teardown_interface "$ifname"
cat > "$_config" <<EOF
$ap_scan
+$country_str
EOF
return 0
}
key_mgmt='WPA-EAP'
[ "$ieee80211r" -gt 0 ] && key_mgmt="FT-EAP $key_mgmt"
- json_get_vars eap_type identity ca_cert
+ json_get_vars eap_type identity anonymous_identity ca_cert
[ -n "$ca_cert" ] && append network_data "ca_cert=\"$ca_cert\"" "$N$T"
[ -n "$identity" ] && append network_data "identity=\"$identity\"" "$N$T"
+ [ -n "$anonymous_identity" ] && append network_data "anonymous_identity=\"$anonymous_identity\"" "$N$T"
case "$eap_type" in
tls)
json_get_vars client_cert priv_key priv_key_pwd
append network_data "private_key=\"$priv_key\"" "$N$T"
append network_data "private_key_passwd=\"$priv_key_pwd\"" "$N$T"
;;
- peap|ttls)
- json_get_vars auth password
+ fast|peap|ttls)
+ json_get_vars auth password ca_cert2 client_cert2 priv_key2 priv_key2_pwd
set_default auth MSCHAPV2
- append network_data "phase2=\"$auth\"" "$N$T"
- append network_data "password=\"$password\"" "$N$T"
+
+ if [ "$auth" = "EAP-TLS" ]; then
+ [ -n "$ca_cert2" ] &&
+ append network_data "ca_cert2=\"$ca_cert2\"" "$N$T"
+ append network_data "client_cert2=\"$client_cert2\"" "$N$T"
+ append network_data "private_key2=\"$priv_key2\"" "$N$T"
+ append network_data "private_key2_passwd=\"$priv_key2_pwd\"" "$N$T"
+ else
+ append network_data "password=\"$password\"" "$N$T"
+ fi
+
+ phase2proto="auth="
+ case "$auth" in
+ "auth"*)
+ phase2proto=""
+ ;;
+ "EAP-"*)
+ auth="$(echo $auth | cut -b 5- )"
+ [ "$eap_type" = "ttls" ] &&
+ phase2proto="autheap="
+ ;;
+ esac
+ append network_data "phase2=\"$phase2proto$auth\"" "$N$T"
;;
esac
append network_data "eap=$(echo $eap_type | tr 'a-z' 'A-Z')" "$N$T"