summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-31 09:22:49 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-31 09:22:49 +0000
commit1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07 (patch)
treefa2ced9ca341759ee8b1da805a4a82bb4c8d837e /lib
parentd5b8af9b3318a727196d53e3b59b2dd98fe1b456 (diff)
downloaddrakx-net-1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07.tar
drakx-net-1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07.tar.gz
drakx-net-1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07.tar.bz2
drakx-net-1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07.tar.xz
drakx-net-1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07.zip
do not convert ASCII PSK passphrases that do not have between 8 and 63 characters
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection/wireless.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/network/connection/wireless.pm b/lib/network/connection/wireless.pm
index 4dd80a3..2ba046a 100644
--- a/lib/network/connection/wireless.pm
+++ b/lib/network/connection/wireless.pm
@@ -694,7 +694,12 @@ sub get_wep_key_from_iwconfig {
sub convert_psk_key_for_wpa_supplicant {
my ($key) = @_;
- length($key) == 64 && get_hex_key($key) || qq("$key");
+ my $l = length($key);
+ $l == 64 ?
+ get_hex_key($key) :
+ $l >= 8 && $l <= 63 ?
+ qq("$key") :
+ undef;
}
#- FIXME: to be improved (quotes, comments)