Revision 9aa8f6a8
Added by Jim Pingle almost 7 years ago
src/usr/local/www/system_crlmanager.php | ||
---|---|---|
32 | 32 |
require_once("pfsense-utils.inc"); |
33 | 33 |
require_once("vpn.inc"); |
34 | 34 |
|
35 |
$max_lifetime = crl_get_max_lifetime(); |
|
36 |
$default_lifetime = 3650; |
|
37 |
if ($max_lifetime < $default_lifetime) { |
|
38 |
$default_lifetime = $max_lifetime; |
|
39 |
} |
|
40 |
|
|
35 | 41 |
global $openssl_crl_status; |
36 | 42 |
|
37 | 43 |
$crl_methods = array( |
... | ... | |
101 | 107 |
if ($act == "new") { |
102 | 108 |
$pconfig['method'] = $_REQUEST['method']; |
103 | 109 |
$pconfig['caref'] = $_REQUEST['caref']; |
104 |
$pconfig['lifetime'] = "9999";
|
|
110 |
$pconfig['lifetime'] = $default_lifetime;
|
|
105 | 111 |
$pconfig['serial'] = "0"; |
106 | 112 |
} |
107 | 113 |
|
... | ... | |
210 | 216 |
if (preg_match("/[\?\>\<\&\/\\\"\']/", $pconfig['descr'])) { |
211 | 217 |
array_push($input_errors, "The field 'Descriptive Name' contains invalid characters."); |
212 | 218 |
} |
219 |
if ($pconfig['lifetime'] > $max_lifetime) { |
|
220 |
$input_errors[] = gettext("Lifetime is longer than the maximum allowed value. Use a shorter lifetime."); |
|
221 |
} |
|
213 | 222 |
|
214 | 223 |
/* save modifications */ |
215 | 224 |
if (!$input_errors) { |
... | ... | |
234 | 243 |
|
235 | 244 |
if ($pconfig['method'] == "internal") { |
236 | 245 |
$crl['serial'] = empty($pconfig['serial']) ? 9999 : $pconfig['serial']; |
237 |
$crl['lifetime'] = empty($pconfig['lifetime']) ? 9999 : $pconfig['lifetime'];
|
|
246 |
$crl['lifetime'] = empty($pconfig['lifetime']) ? $default_lifetime : $pconfig['lifetime'];
|
|
238 | 247 |
$crl['cert'] = array(); |
239 | 248 |
} |
240 | 249 |
|
... | ... | |
388 | 397 |
'Lifetime (Days)', |
389 | 398 |
'number', |
390 | 399 |
$pconfig['lifetime'], |
391 |
['max' => '9999']
|
|
400 |
['max' => $max_lifetime]
|
|
392 | 401 |
)); |
393 | 402 |
|
394 | 403 |
$section->addInput(new Form_Input( |
Also available in: Unified diff
Prevent CRL from using too large a lifetime on ARM. Fixes #9098