aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/hostapd/files/hostapd.sh
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2018-11-22 20:53:09 +0100
committerDaniel Golle <daniel@makrotopia.org>2018-12-12 09:37:23 +0100
commitf5753aae233fa64b5d4784ade2cc170f7da539a4 (patch)
treefe53918ad7ed179876f1e015e655569fdf0b19c1 /package/network/services/hostapd/files/hostapd.sh
parent5beedcddc3ad2c6f92c24ce2655a84524ca26594 (diff)
downloadupstream-f5753aae233fa64b5d4784ade2cc170f7da539a4.tar.gz
upstream-f5753aae233fa64b5d4784ade2cc170f7da539a4.tar.bz2
upstream-f5753aae233fa64b5d4784ade2cc170f7da539a4.zip
hostapd: add support for WPS pushbutton station
similar to hostapd, also add a ubus interface for wpa_supplicant which will allow handling WPS push-button just as it works for hostapd. In order to have wpa_supplicant running without any network configuration (so you can use it to retrieve credentials via WPS), configure wifi-iface in /etc/config/wireless: config wifi-iface 'default_radio0' option device 'radio0' option network 'wwan' option mode 'sta' option encryption 'wps' This section will automatically be edited if credentials have successfully been acquired via WPS. Size difference (mips_24kc): roughly +4kb for the 'full' variants of wpa_supplicant and wpad which do support WPS. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network/services/hostapd/files/hostapd.sh')
-rw-r--r--package/network/services/hostapd/files/hostapd.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 7f3157cd27..7335e75fd5 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -762,6 +762,9 @@ wpa_supplicant_add_network() {
hostapd_append_wep_key network_data
append network_data "wep_tx_keyidx=$wep_keyidx" "$N$T"
;;
+ wps)
+ key_mgmt='WPS'
+ ;;
psk|sae|psk-sae)
local passphrase
@@ -869,7 +872,10 @@ wpa_supplicant_add_network() {
append network_data "mcast_rate=$mc_rate" "$N$T"
}
- cat >> "$_config" <<EOF
+ if [ "$key_mgnt" = "WPS" ]; then
+ echo "wps_cred_processing=1" >> "$_config"
+ else
+ cat >> "$_config" <<EOF
network={
$scan_ssid
ssid="$ssid"
@@ -877,6 +883,7 @@ network={
$network_data
}
EOF
+ fi
return 0
}