aboutsummaryrefslogtreecommitdiffstats
path: root/package/wpa_supplicant
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-01-13 19:31:47 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-01-13 19:31:47 +0000
commitbc55f884d7483fabebd541e80bccdf58c1d00078 (patch)
tree9b2e248d51d6807b2042a0c4493b353f6b5d3281 /package/wpa_supplicant
parent5073e6db1e2e3696cdb39ae99b3154b47a1fcdcf (diff)
downloadupstream-bc55f884d7483fabebd541e80bccdf58c1d00078.tar.gz
upstream-bc55f884d7483fabebd541e80bccdf58c1d00078.tar.bz2
upstream-bc55f884d7483fabebd541e80bccdf58c1d00078.zip
[package] wpa_supplicant: add WEP key handling to conform with documented behaviour in mac80211.sh (#6493)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19119 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/wpa_supplicant')
-rw-r--r--package/wpa_supplicant/files/wpa_supplicant.sh37
1 files changed, 32 insertions, 5 deletions
diff --git a/package/wpa_supplicant/files/wpa_supplicant.sh b/package/wpa_supplicant/files/wpa_supplicant.sh
index 1d1367a17f..40e8ff55b2 100644
--- a/package/wpa_supplicant/files/wpa_supplicant.sh
+++ b/package/wpa_supplicant/files/wpa_supplicant.sh
@@ -12,12 +12,33 @@ wpa_supplicant_setup_vif() {
}
case "$enc" in
+ *wep*)
+ key_mgmt='NONE'
+ config_get key "$vif" key
+ key="${key:-1}"
+ case "$key" in
+ [1234])
+ for idx in 1 2 3 4; do
+ local zidx
+ zidx=$(($idx - 1))
+ config_get ckey "$vif" "key${idx}"
+ if [ -n "$ckey" ] && \
+ append "wep_key${zidx}" "wep_key${zidx}=$(prepare_key_wep "$ckey")"
+ done
+ wep_tx_keyidx="wep_tx_keyidx=$((key - 1))"
+ ;;
+ *)
+ wep_key0="wep_key0=$(prepare_key_wep "$key")"
+ wep_tx_keyidx="wep_tx_keyidx=0"
+ ;;
+ esac
+ ;;
*psk*)
key_mgmt='WPA-PSK'
config_get_bool usepassphrase "$vif" passphrase 1
case "$enc" in
*psk2*)
- proto='RSN'
+ proto='proto=RSN'
if [ "$usepassphrase" = "1" ]; then
passphrase="psk=\"${key}\""
else
@@ -25,7 +46,7 @@ wpa_supplicant_setup_vif() {
fi
;;
*psk*)
- proto='WPA'
+ proto='proto=WPA'
if [ "$usepassphrase" = "1" ]; then
passphrase="psk=\"${key}\""
else
@@ -35,7 +56,7 @@ wpa_supplicant_setup_vif() {
esac
;;
*wpa*|*8021x*)
- proto='WPA2'
+ proto='proto=WPA2'
key_mgmt='WPA-EAP'
config_get ca_cert "$vif" ca_cert
ca_cert=${ca_cert:+"ca_cert=\"$ca_cert\""}
@@ -72,7 +93,7 @@ network={
ssid="$ssid"
$bssid
key_mgmt=$key_mgmt
- proto=$proto
+ $proto
$passphrase
$pairwise
$group
@@ -83,7 +104,13 @@ network={
$phase2
$identity
$password
+ $wep_key0
+ $wep_key1
+ $wep_key2
+ $wep_key3
+ $wep_tx_keyidx
}
EOF
- [ -z "$proto" ] || wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
+ [ -z "$proto" -a "$key_mgmt" != "NONE" ] ||
+ wpa_supplicant ${bridge:+ -b $bridge} -B -P "/var/run/wifi-${ifname}.pid" -D ${driver:-wext} -i "$ifname" -c /var/run/wpa_supplicant-$ifname.conf
}