From 945b866df8a6ecb68d0c42b85c7a7f4a1447612f Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 5 Jan 2018 08:57:05 +0100 Subject: [PATCH] system: play whac-a-mole with the serial number #1581 --- src/www/system_camanager.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/www/system_camanager.php b/src/www/system_camanager.php index fd628245c..4b659452e 100644 --- a/src/www/system_camanager.php +++ b/src/www/system_camanager.php @@ -159,16 +159,15 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['dn_email'] = null; $pconfig['dn_commonname'] = null; - if ($act == "edit") { if (!isset($id)) { header(url_safe('Location: /system_camanager.php')); exit; } - $pconfig['descr'] = $a_ca[$id]['descr']; - $pconfig['refid'] = $a_ca[$id]['refid']; - $pconfig['cert'] = base64_decode($a_ca[$id]['crt']); - $pconfig['serial'] = $a_ca[$id]['serial']; + $pconfig['descr'] = $a_ca[$id]['descr']; + $pconfig['refid'] = $a_ca[$id]['refid']; + $pconfig['cert'] = base64_decode($a_ca[$id]['crt']); + $pconfig['serial'] = $a_ca[$id]['serial'] + 1; if (!empty($a_ca[$id]['prv'])) { $pconfig['key'] = base64_decode($a_ca[$id]['prv']); } @@ -347,9 +346,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (isset($id)) { // edit existing - $ca['crt'] = base64_encode($pconfig['cert']); + $ca['crt'] = base64_encode($pconfig['cert']); if (!empty($pconfig['key'])) { - $ca['prv'] = base64_encode($pconfig['key']); + $ca['prv'] = base64_encode($pconfig['key']); } } else { $old_err_level = error_reporting(0); /* otherwise openssl_ functions throw warnings directly to a page screwing menu tab */