From: florian Date: Tue, 26 Aug 2008 17:19:00 +0000 (+0000) Subject: A WPA(2) pre-shared key can either be specified as a 8 to 63 character passphrase... X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=commitdiff_plain;h=833c6d36230d7123654e7bbd890f8547b4d98cd9 A WPA(2) pre-shared key can either be specified as a 8 to 63 character passphrase which is hashed to a 256 bit key together with the SSID, or a 64 character hex key. Currently, the latter option is supported by the broadcom wifi type, but no by hostapd. The attached patch allows using a 64 character hex key. (#3935) Signed-off-by: thomas@archlinux.org git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12394 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh index 147736bdc..49b30cfd5 100644 --- a/package/hostapd/files/hostapd.sh +++ b/package/hostapd/files/hostapd.sh @@ -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?