summaryrefslogtreecommitdiffstats
path: root/lib/network/connection
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-31 10:02:54 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-31 10:02:54 +0000
commita8a9701e07ec238970657eb6a15984892f7c86f4 (patch)
tree3be776dc23b6261bbeafc176d453897dfd17e5fb /lib/network/connection
parente80554c3d3a5867300526ee7316339a2a50a1a5f (diff)
downloaddrakx-net-a8a9701e07ec238970657eb6a15984892f7c86f4.tar
drakx-net-a8a9701e07ec238970657eb6a15984892f7c86f4.tar.gz
drakx-net-a8a9701e07ec238970657eb6a15984892f7c86f4.tar.bz2
drakx-net-a8a9701e07ec238970657eb6a15984892f7c86f4.tar.xz
drakx-net-a8a9701e07ec238970657eb6a15984892f7c86f4.zip
ensure that WEP keys are not longer than maximum key length for wpa_supplicant (#28107)
Diffstat (limited to 'lib/network/connection')
-rw-r--r--lib/network/connection/wireless.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/network/connection/wireless.pm b/lib/network/connection/wireless.pm
index 1412000..24482d1 100644
--- a/lib/network/connection/wireless.pm
+++ b/lib/network/connection/wireless.pm
@@ -524,6 +524,13 @@ sub check_network_access_settings {
$self->{network_access}{error}{field} = \$self->{access}{network}{key};
return 0;
}
+ if (member($self->{access}{network}{encryption}, qw(open restricted)) &&
+ !convert_wep_key_for_wpa_supplicant($self->{access}{network}{key}, $self->{access}{network}{force_ascii_key})) {
+ $self->{network_access}{error}{message} = N("The WEP key should have at most %d ASCII characters or %d hexadecimal characters.",
+ $wpa_supplicant_max_wep_key_len, $wpa_supplicant_max_wep_key_len * 2);
+ $self->{network_access}{error}{field} = \$self->{access}{network}{key};
+ return 0;
+ }
if ($self->{ifcfg}{WIRELESS_FREQ} && $self->{ifcfg}{WIRELESS_FREQ} !~ /[0-9.]*[kGM]/) {
$self->{network_access}{error}{message} = N("Freq should have the suffix k, M or G (for example, \"2.46G\" for 2.46 GHz frequency), or add enough '0' (zeroes).");