From: Travis Kemen Date: Wed, 13 Feb 2008 03:40:45 +0000 (+0000) Subject: fix problems with the use of a passphrase, add option to use a key instead of passphrase X-Git-Tag: reboot~27039 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=80f0eec0aad257b5d020eaf8abc35d437dadfe73;p=openwrt%2Fstaging%2Fchunkeey.git fix problems with the use of a passphrase, add option to use a key instead of passphrase SVN-Revision: 10450 --- diff --git a/package/madwifi/files/lib/wifi/madwifi.sh b/package/madwifi/files/lib/wifi/madwifi.sh index 400cb77adc..fef63cbcc2 100755 --- a/package/madwifi/files/lib/wifi/madwifi.sh +++ b/package/madwifi/files/lib/wifi/madwifi.sh @@ -266,26 +266,34 @@ enable_atheros() { fi ;; wds|sta) - case "$enc" in + config_get_bool usepassphrase "$vif" passphrase 1 + case "$enc" in PSK|psk|PSK2|psk2) case "$enc" in PSK|psk) proto='proto=WPA' - passphrase="${key}" + if [ "$usepassphrase" = "1" ]; then + passphrase="psk=\"${key}\"" + else + passphrase="psk=${key}" + fi ;; PSK2|psk2) proto='proto=RSN' - passphrase=`wpa_passphrase ${ssid} "${key}" | grep psk | grep -v \#| cut -d= -f2` + if [ "$usepassphrase" = "1" ]; then + passphrase="psk=\"${key}\"" + else + passphrase="psk=${key}" + fi ;; esac - cat > /var/run/wpa_supplicant-$ifname.conf <