Skip to content

Commit

Permalink
system: play whac-a-mole with the serial number #1581
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Jan 5, 2018
1 parent b2f4cfa commit 945b866
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/www/system_camanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,15 @@ function ca_inter_create(&$ca, $keylen, $lifetime, $dn, $caref, $digest_alg = 's
$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']);
}
Expand Down Expand Up @@ -347,9 +346,9 @@ function ca_inter_create(&$ca, $keylen, $lifetime, $dn, $caref, $digest_alg = 's

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 */
Expand Down

0 comments on commit 945b866

Please sign in to comment.