summaryrefslogtreecommitdiffstats
path: root/perl-install/network/tools.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-24 17:32:10 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-24 17:32:10 +0000
commit0c79fff50fec0ee6b462b4654cc845f718da7a2f (patch)
tree31d60979bf6f5c3073bb0da92935413b35ae43b0 /perl-install/network/tools.pm
parent4ae35537d7361c603756b81ccce5c4ac5072f73e (diff)
downloaddrakx-0c79fff50fec0ee6b462b4654cc845f718da7a2f.tar
drakx-0c79fff50fec0ee6b462b4654cc845f718da7a2f.tar.gz
drakx-0c79fff50fec0ee6b462b4654cc845f718da7a2f.tar.bz2
drakx-0c79fff50fec0ee6b462b4654cc845f718da7a2f.tar.xz
drakx-0c79fff50fec0ee6b462b4654cc845f718da7a2f.zip
minimal WPA support
Diffstat (limited to 'perl-install/network/tools.pm')
-rw-r--r--perl-install/network/tools.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm
index 411e37267..052b0d430 100644
--- a/perl-install/network/tools.pm
+++ b/perl-install/network/tools.pm
@@ -203,7 +203,7 @@ sub is_dynamic_host {
sub convert_wep_key_for_iwconfig {
#- 5 or 13 characters, consider the key as ASCII and prepend "s:"
- #- else consider the key as hexadecimal, do not strip dashes
+ #- else consider the key as hexadecimal, do not strip dashes
#- always quote the key as string
my ($key) = @_;
member(length($key), (5, 13)) ? "s:$key" : $key;
@@ -217,6 +217,15 @@ sub get_wep_key_from_iwconfig {
$key;
}
+sub convert_key_for_wpa_supplicant {
+ my ($key) = @_;
+ if ($key =~ /^([[:xdigit:]]{4}[\:-])+[[:xdigit:]]{2,}$/) {
+ $key =~ s/[\:-]//g;
+ return lc($key);
+ } else {
+ return qq("$key");
+ }
+}
#- returns interface whose IP address matchs given IP address, according to its network mask
sub find_matching_interface {