aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/user.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2014-10-25 19:39:50 +0200
committerAndreas Fischer <bantu@phpbb.com>2014-10-25 19:39:50 +0200
commit103c929ff0daf69d61d9c5cad1d1981e4e9f6c4e (patch)
tree6a2f785684c3549c2faa20fb2f71d256d21f3c03 /phpBB/phpbb/user.php
parent08f365236acb48f9017b6e978a9b9c50ab5ed960 (diff)
parent6217a519202b7394cbad9982282ab7208f1f5ed4 (diff)
downloadforums-103c929ff0daf69d61d9c5cad1d1981e4e9f6c4e.tar
forums-103c929ff0daf69d61d9c5cad1d1981e4e9f6c4e.tar.gz
forums-103c929ff0daf69d61d9c5cad1d1981e4e9f6c4e.tar.bz2
forums-103c929ff0daf69d61d9c5cad1d1981e4e9f6c4e.tar.xz
forums-103c929ff0daf69d61d9c5cad1d1981e4e9f6c4e.zip
Merge branch 'prep-release-3.1.0' into develop-ascraeus
* prep-release-3.1.0: [ticket/13208] Add security issues to the final changelog [prep-release-3.1.0] Prepare Changelog [prep-release-3.1.0] Update version to 3.1.0
Diffstat (limited to 'phpBB/phpbb/user.php')
0 files changed, 0 insertions, 0 deletions
td>
authorOlivier Blin <oblin@mandriva.org>2005-09-15 04:02:23 +0000
committerOlivier Blin <oblin@mandriva.org>2005-09-15 04:02:23 +0000
commit972007c22ac6fdb2790a6125ebc881e91a332fc4 (patch)
tree96d81a997e6bac353a6616f174e2f73364fb85d0 /perl-install
parenta655e543314efbad3a1bd70e193b43f0ecb81300 (diff)
downloaddrakx-972007c22ac6fdb2790a6125ebc881e91a332fc4.tar
drakx-972007c22ac6fdb2790a6125ebc881e91a332fc4.tar.gz
drakx-972007c22ac6fdb2790a6125ebc881e91a332fc4.tar.bz2
drakx-972007c22ac6fdb2790a6125ebc881e91a332fc4.tar.xz
drakx-972007c22ac6fdb2790a6125ebc881e91a332fc4.zip
better handling of ASCII WEP keys (partial fix for #18558)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/wireless.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/perl-install/network/wireless.pm b/perl-install/network/wireless.pm
index d86482844..513c8a95e 100644
--- a/perl-install/network/wireless.pm
+++ b/perl-install/network/wireless.pm
@@ -22,12 +22,20 @@ sub is_wpa_supplicant_blacklisted {
is_old_rt2x00($module);
}
+sub get_hex_key {
+ my ($key) = @_;
+ if ($key =~ /^([[:xdigit:]]{4}[\:-]?)+[[:xdigit:]]{2,}$/) {
+ $key =~ s/[\:-]//g;
+ return lc($key);
+ }
+}
+
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
#- always quote the key as string
my ($real_key, $restricted) = @_;
- my $key = member(length($real_key), (5, 13)) ? "s:$real_key" : $real_key;
+ my $key = get_hex_key($real_key) || "s:$real_key";
$restricted ? "restricted $key" : "open $key";
}
@@ -35,19 +43,14 @@ sub get_wep_key_from_iwconfig {
#- strip "s:" if the key is 5 or 13 characters (ASCII)
#- else the key as hexadecimal, do not modify
my ($key) = @_;
- $key =~ s/^s:// if member(length($key), (7,15));
my ($mode, $real_key) = $key =~ /^(?:(open|restricted)\s+)?(.*)$/;
+ $real_key =~ s/^s://;
($real_key, $mode eq 'restricted');
}
sub convert_key_for_wpa_supplicant {
my ($key) = @_;
- if ($key =~ /^([[:xdigit:]]{4}[\:-]?)+[[:xdigit:]]{2,}$/) {
- $key =~ s/[\:-]//g;
- return lc($key);
- } else {
- return qq("$key");
- }
+ get_hex_key($key) || qq("$key");
}
sub wlan_ng_needed {