summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/8021x47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/8021x b/src/8021x
index cb49199..6f0edf2 100644
--- a/src/8021x
+++ b/src/8021x
@@ -65,41 +65,40 @@ make_wpa_config_file() {
# Requires already loaded profile
make_wpa_config() {
case $SECURITY in
- wep|wep-old)
- if [[ ${KEY:0:2} == "s:" ]]; then # TODO: does wpa_supplicant handle this as expected?
- echo "ssid=\"$ESSID\" \nkey_mgmt=NONE \nwep_key0=\"${KEY:2}\" \nwep_tx_keyidx=0"
- else
- echo "ssid=\"$ESSID\" \nkey_mgmt=NONE \nwep_key0=$KEY \nwep_tx_keyidx=0"
- fi
-
+ wep|wep-old|wpa|none|none-old)
+ echo "ssid=\"$ESSID\""
if [[ -n "$AP" ]]; then
- echo " bssid=$AP"
+ echo "bssid=$AP"
fi
;;
- none|none-old)
- echo "ssid=\"$ESSID\" \nkey_mgmt=NONE"
+ wpa-configsection)
+ echo "$CONFIGSECTION"
+ ;;
+ *)
+ return 1
+ ;;
+ esac
- if [[ -n "$AP" ]]; then
- echo " bssid=$AP"
+ # Key management
+ case $SECURITY in
+ wep|wep-old)
+ echo "key_mgmt=NONE"
+ echo "wep_tx_idx=0"
+ if [[ ${KEY:0:2} == "s:" ]]; then # TODO: does wpa_supplicant handle this as expected?
+ echo "wep_key0=\"${KEY:2}\""
+ else
+ echo "wep_key0=$KEY"
fi
+ none|none-old)
+ echo "key_mgmt=NONE"
;;
wpa)
if [[ "${#KEY}" -eq 64 ]]; then
- echo "proto=RSN WPA\n ssid=\"$ESSID\" \npsk=$KEY"
+ echo "proto=RSN WPA\npsk=$KEY"
else
- echo "proto=RSN WPA\n ssid=\"$ESSID\" \npsk=\"$KEY\""
- fi
-
- if [[ -n "$AP" ]]; then
- echo " bssid=$AP"
+ echo "proto=RSN WPA\npsk=\"$KEY\""
fi
;;
- wpa-configsection)
- echo "$CONFIGSECTION"
- ;;
- *)
- return 1
- ;;
esac
# Hidden SSID