summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)