A WPA(2) pre-shared key can either be specified as a 8 to 63 character passphrase...
authorFlorian Fainelli <florian@openwrt.org>
Tue, 26 Aug 2008 17:19:00 +0000 (17:19 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 26 Aug 2008 17:19:00 +0000 (17:19 +0000)
Signed-off-by: thomas@archlinux.org
SVN-Revision: 12394

package/hostapd/files/hostapd.sh

index 147736bdc6b4fdc59a9d1bb2b5f6f3fde6431c27..49b30cfd57c27b92505d80bbc97837bcb2b9f2d8 100644 (file)
@@ -39,7 +39,11 @@ hostapd_setup_vif() {
        case "$enc" in
                *psk*|*PSK*)
                        config_get psk "$vif" key
-                       append hostapd_cfg "wpa_passphrase=$psk" "$N"
+                       if [ ${#psk} -eq 64 ]; then
+                               append hostapd_cfg "wpa_psk=$psk" "$N"
+                       else
+                               append hostapd_cfg "wpa_passphrase=$psk" "$N"
+                       fi
                ;;
                *wpa*|*WPA*)
                        # required fields? formats?