From 1acf0bfe3e054f81ae4d79cbfc3a5bab1d82de07 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 31 Mar 2008 09:22:49 +0000 Subject: do not convert ASCII PSK passphrases that do not have between 8 and 63 characters --- lib/network/connection/wireless.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/network') 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) -- cgit v1.2.1