summaryrefslogtreecommitdiff
path: root/package/hostapd/files
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2008-08-26 17:19:00 +0000
committerFlorian Fainelli <florian@openwrt.org>2008-08-26 17:19:00 +0000
commit6b04ad55f9c589bfea33b0817410d05765793aae (patch)
treefde6c57d313d20341cd5965d805b25f29f7a6dde /package/hostapd/files
parent974ad00cf3082f5aa3b85efbfd52b536cd394d42 (diff)
downloadmtk-20170518-6b04ad55f9c589bfea33b0817410d05765793aae.zip
mtk-20170518-6b04ad55f9c589bfea33b0817410d05765793aae.tar.gz
mtk-20170518-6b04ad55f9c589bfea33b0817410d05765793aae.tar.bz2
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 SVN-Revision: 12394
Diffstat (limited to 'package/hostapd/files')
-rw-r--r--package/hostapd/files/hostapd.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh
index 147736b..49b30cf 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?