diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-10-14 10:50:49 -0500 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-10-14 10:50:49 -0500 |
commit | 123d87006016d149d45f0a23be5cdc2c550953d9 (patch) | |
tree | 1ca7029d3d533cc0536026554a2895abc19ad33a | |
parent | a4c1fff29405ef355db2b5f97b411675a04f1fc2 (diff) | |
download | pfsense-123d87006016d149d45f0a23be5cdc2c550953d9.zip pfsense-123d87006016d149d45f0a23be5cdc2c550953d9.tar.gz |
Does not accept non-ascii characters on IPsec PSK. It fiixes #3931
-rw-r--r-- | usr/local/www/system_usermanager.php | 3 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_keys_edit.php | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index 9dfd814..a7fd722 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -210,6 +210,9 @@ if ($_POST['save']) { if (($_POST['passwordfld1']) && ($_POST['passwordfld1'] != $_POST['passwordfld2'])) $input_errors[] = gettext("The passwords do not match."); + if (isset($_POST['ipsecpsk']) && !preg_match('/^[[:ascii:]]*$/', $_POST['ipsecpsk'])) + $input_errors[] = gettext("IPsec Pre-Shared Key contains invalid characters."); + if (isset($id) && $a_user[$id]) $oldusername = $a_user[$id]['name']; else diff --git a/usr/local/www/vpn_ipsec_keys_edit.php b/usr/local/www/vpn_ipsec_keys_edit.php index b1c24aa..c445a6e 100644 --- a/usr/local/www/vpn_ipsec_keys_edit.php +++ b/usr/local/www/vpn_ipsec_keys_edit.php @@ -78,6 +78,9 @@ if ($_POST) { $input_errors[] = gettext("A user with this name already exists. Add the key to the user instead."); unset($userids); + if (isset($_POST['psk']) && !preg_match('/^[[:ascii:]]*$/', $_POST['psk'])) + $input_errors[] = gettext("Pre-Shared Key contains invalid characters."); + if (!$input_errors && !(isset($id) && $a_secret[$id])) { /* make sure there are no dupes */ foreach ($a_secret as $secretent) { |