diff options
author | John Crispin <blogic@openwrt.org> | 2014-10-20 11:19:21 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-10-20 11:19:21 +0000 |
commit | f16cd1a9e59edc40d6eaa738fd4bd4d1b4a16b65 (patch) | |
tree | 02b435b51f4e43fddf6cd335233784f915690068 /package/network/services | |
parent | cbc5f498cdffbf7ba47549b4cebd9ce7838c59c6 (diff) | |
download | upstream-f16cd1a9e59edc40d6eaa738fd4bd4d1b4a16b65.tar.gz upstream-f16cd1a9e59edc40d6eaa738fd4bd4d1b4a16b65.tar.bz2 upstream-f16cd1a9e59edc40d6eaa738fd4bd4d1b4a16b65.zip |
hostapd: Add wpa_psk_file option to netifd.sh
The wpa_psk_file option offers the possibility to use a different WPA-PSK key for each client. The directive points to a file with the following syntax:
mac_address wpa_passphrase_or_hex_key
Example:
00:11:22:33:44:55 passphrase_for_client_1
00:11:22:33:44:67 passphrase_for_client_2
00:11:22:33:44:89 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
So it is possible to specify both ASCII passphrases and raw 64-chars hex keys.
Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43001 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services')
-rw-r--r-- | package/network/services/hostapd/files/netifd.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh index 5dfb43d0f1..b1036be7a0 100644 --- a/package/network/services/hostapd/files/netifd.sh +++ b/package/network/services/hostapd/files/netifd.sh @@ -134,6 +134,8 @@ hostapd_common_add_bss_config() { config_add_string 'key1:wepkey' 'key2:wepkey' 'key3:wepkey' 'key4:wepkey' 'password:wpakey' + config_add_string wpa_psk_file + config_add_boolean wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin @@ -202,7 +204,7 @@ hostapd_set_bss_options() { wps_not_configured=1 ;; psk) - json_get_vars key + json_get_vars key wpa_psk_file if [ ${#key} -lt 8 ]; then wireless_setup_vif_failed INVALID_WPA_PSK return 1 @@ -211,6 +213,10 @@ hostapd_set_bss_options() { else append bss_conf "wpa_passphrase=$key" "$N" fi + [ -n "$wpa_psk_file" ] && { + [ -e "$wpa_psk_file" ] || touch "$wpa_psk_file" + append bss_conf "wpa_psk_file=$wpa_psk_file" "$N" + } wps_possible=1 ;; eap) |