summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-08-27 21:21:21 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-08-27 21:21:21 +0000
commitbcf5313216cf8d44116ff47f8f89d911b719e235 (patch)
tree3aae02d4e30d4dd356ecdec176a4302c48f36a8e /usr
parent2bdf4a03a87316bb0aec3283e662bddb56b74e88 (diff)
downloadpfsense-bcf5313216cf8d44116ff47f8f89d911b719e235.zip
pfsense-bcf5313216cf8d44116ff47f8f89d911b719e235.tar.gz
Ensure that hex keys begin with 0x.
Add if necessary.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/interfaces_wlan.inc14
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/local/www/interfaces_wlan.inc b/usr/local/www/interfaces_wlan.inc
index cd2cdd8..09ad676 100755
--- a/usr/local/www/interfaces_wlan.inc
+++ b/usr/local/www/interfaces_wlan.inc
@@ -79,13 +79,23 @@ function wireless_config_post() {
/* 64 bit */
if(strlen($_POST['key' . $i]) == 5)
continue;
- if(strlen($_POST['key' . $i]) == 10)
+ if(strlen($_POST['key' . $i]) == 10) {
+ /* hex key */
+ if(stristr($_POST['key' . $i], "0x") == false) {
+ $_POST['key' . $i] = "0x" . $_POST['key' . $i];
+ }
continue;
+ }
/* 128 bit */
if(strlen($_POST['key' . $i]) == 13)
continue;
- if(strlen($_POST['key' . $i]) == 26)
+ if(strlen($_POST['key' . $i]) == 26) {
+ /* hex key */
+ if(stristr($_POST['key' . $i], "0x") == false) {
+ $_POST['key' . $i] = "0x" . $_POST['key' . $i];
+ }
continue;
+ }
if(strlen($_POST['key' . $i]) == 28)
continue;
$input_errors[] = "Invalid wep key size. Sizes should be 40 (64) bit keys or 104 (128) bit.";
OpenPOWER on IntegriCloud