summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhamnur <hamnur@protonmail.com>2017-07-14 12:29:41 +0200
committerRenato Botelho <renato@netgate.com>2017-07-31 16:33:47 -0300
commit8f03bc04813a8c0fe9c8cb37d765fabe9182d560 (patch)
tree17e67561cbafd530b1b48df4c7d5f336d80454dd
parentf7c409fe15c7762b6b810ac1023d1f1a44d8ff18 (diff)
downloadpfsense-8f03bc04813a8c0fe9c8cb37d765fabe9182d560.zip
pfsense-8f03bc04813a8c0fe9c8cb37d765fabe9182d560.tar.gz
Check if margintime is numeric and smaller than P1 lifetime
(cherry picked from commit af729f53f3c838f91dffb6368b656ddece527e05)
-rw-r--r--src/usr/local/www/vpn_ipsec_phase1.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/usr/local/www/vpn_ipsec_phase1.php b/src/usr/local/www/vpn_ipsec_phase1.php
index cf609fd..41861b0 100644
--- a/src/usr/local/www/vpn_ipsec_phase1.php
+++ b/src/usr/local/www/vpn_ipsec_phase1.php
@@ -271,8 +271,12 @@ if ($_POST) {
$input_errors[] = gettext("The P1 lifetime must be an integer.");
}
- if (($pconfig['margintime'] && !is_numericint($pconfig['margintime']))) {
- $input_errors[] = gettext("The margintime must be an integer.");
+ if ($pconfig['rekey_enable']) {
+ if(!is_numericint($pconfig['margintime'])){
+ $input_errors[] = gettext("The margintime must be an integer.");
+ } else if(intval($pconfig['margintime']) >= intval($pconfig['lifetime'])){
+ $input_errors[] = gettext("The margintime must be smaller than the P1 lifetime.");
+ }
}
if ($pconfig['remotegw']) {
OpenPOWER on IntegriCloud