summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-12-05 15:09:20 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-12-05 15:09:20 +0000
commit37758a2672fc8e4322f2bbc067dcb54d4d61d8ce (patch)
treeefc49125903e10bb6203010f709a9f8f90080e6b
parent6da667f886bef06d2da669c66d86b292550096df (diff)
downloadmtk-20170518-37758a2672fc8e4322f2bbc067dcb54d4d61d8ce.zip
mtk-20170518-37758a2672fc8e4322f2bbc067dcb54d4d61d8ce.tar.gz
mtk-20170518-37758a2672fc8e4322f2bbc067dcb54d4d61d8ce.tar.bz2
wpa_supplicant: relax parsing of encryption mode, drop support for uppercase modes
SVN-Revision: 18663
-rw-r--r--package/wpa_supplicant/files/wpa_supplicant.sh24
1 files changed, 15 insertions, 9 deletions
diff --git a/package/wpa_supplicant/files/wpa_supplicant.sh b/package/wpa_supplicant/files/wpa_supplicant.sh
index 5053d1e..1d1367a 100644
--- a/package/wpa_supplicant/files/wpa_supplicant.sh
+++ b/package/wpa_supplicant/files/wpa_supplicant.sh
@@ -1,25 +1,31 @@
wpa_supplicant_setup_vif() {
local vif="$1"
local driver="$2"
-
+ local key="$key"
+
# wpa_supplicant should use wext for mac80211 cards
[ "$driver" = "mac80211" ] && driver='wext'
+ # make sure we have the psk
+ [ -n "$key" ] || {
+ config_get key "$vif" key
+ }
+
case "$enc" in
- PSK|psk|psk2|PSK2)
+ *psk*)
key_mgmt='WPA-PSK'
config_get_bool usepassphrase "$vif" passphrase 1
case "$enc" in
- psk|PSK)
- proto='WPA'
+ *psk2*)
+ proto='RSN'
if [ "$usepassphrase" = "1" ]; then
passphrase="psk=\"${key}\""
else
passphrase="psk=${key}"
fi
;;
- psk2|PSK2)
- proto='RSN'
+ *psk*)
+ proto='WPA'
if [ "$usepassphrase" = "1" ]; then
passphrase="psk=\"${key}\""
else
@@ -28,13 +34,13 @@ wpa_supplicant_setup_vif() {
;;
esac
;;
- WPA|wpa|WPA2|wpa2|8021x|8021X)
+ *wpa*|*8021x*)
proto='WPA2'
key_mgmt='WPA-EAP'
config_get ca_cert "$vif" ca_cert
ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
case "$eap_type" in
- tls|TLS)
+ tls)
pairwise='pairwise=CCMP'
group='group=CCMP'
config_get priv_key "$vif" priv_key
@@ -42,7 +48,7 @@ wpa_supplicant_setup_vif() {
priv_key="private_key=\"$priv_key\""
priv_key_pwd="private_key_passwd=\"$priv_key_pwd\""
;;
- peap|PEAP|ttls|TTLS)
+ peap|ttls)
config_get auth "$vif" auth
config_get identity "$vif" identity
config_get password "$vif" password