summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr/local/www/system_usermanager.php3
-rw-r--r--usr/local/www/vpn_ipsec_keys_edit.php3
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) {
OpenPOWER on IntegriCloud