Rename 'name' to 'descr' for CA, Certificates, and CRLs, to gain CDATA protection and standardize field names. Ticket #320.

This commit is contained in:
jim-p 2010-10-19 14:19:44 -04:00
parent 6751b3e786
commit f2a86ca96f
15 changed files with 83 additions and 76 deletions

View File

@ -72,7 +72,7 @@ function & lookup_cert_by_name($name) {
global $config;
if (is_array($config['cert']))
foreach ($config['cert'] as & $cert)
if ($cert['name'] == $name)
if ($cert['descr'] == $name)
return $cert;
}
@ -453,7 +453,7 @@ function crl_create(& $crl, $caref, $name, $serial=0, $lifetime=9999) {
$ca =& lookup_ca($caref);
if (!$ca)
return false;
$crl['name'] = $name;
$crl['descr'] = $name;
$crl['caref'] = $caref;
$crl['serial'] = $serial;
$crl['lifetime'] = $lifetime;
@ -502,7 +502,7 @@ function cert_unrevoke($cert, & $crl) {
if (!is_crl_internal($crl))
return false;
foreach ($crl['cert'] as $id => $rcert) {
if (($rcert['refid'] == $cert['refid']) || ($rcert['name'] == $cert['name'])) {
if (($rcert['refid'] == $cert['refid']) || ($rcert['descr'] == $cert['descr'])) {
unset($crl['cert'][$id]);
crl_update($crl);
return true;
@ -521,7 +521,7 @@ function is_cert_revoked($cert, $crlref = "") {
if (!is_array($crl['cert']))
return false;
foreach ($crl['cert'] as $rcert) {
if (($rcert['refid'] == $cert['refid']) || ($rcert['name'] == $cert['name']))
if (($rcert['refid'] == $cert['refid']) || ($rcert['descr'] == $cert['descr']))
return true;
}
} else {
@ -529,7 +529,7 @@ function is_cert_revoked($cert, $crlref = "") {
if (!is_array($crl['cert']))
continue;
foreach ($crl['cert'] as $rcert) {
if (($rcert['refid'] == $cert['refid']) || ($rcert['name'] == $cert['name']))
if (($rcert['refid'] == $cert['refid']) || ($rcert['descr'] == $cert['descr']))
return true;
}
}

View File

@ -89,7 +89,7 @@ $g = array(
"disablehelpmenu" => false,
"disablehelpicon" => false,
"debug" => false,
"latest_config" => "7.4",
"latest_config" => "7.5",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "105",
"minimum_ram_warning_text" => "128 MB",

View File

@ -692,7 +692,7 @@ function system_webgui_start() {
echo "Creating SSL Certificate... ";
$cert = array();
$cert['refid'] = uniqid();
$cert['name'] = "webConfigurator default";
$cert['descr'] = "webConfigurator default";
mwexec("/usr/bin/openssl genrsa 1024 > {$g['tmp_path']}/ssl.key");
mwexec("/usr/bin/openssl req -new -x509 -nodes -sha1 -days 2000 -key {$g['tmp_path']}/ssl.key > {$g['tmp_path']}/ssl.crt");
$crt = file_get_contents("{$g['tmp_path']}/ssl.crt");

View File

@ -1307,7 +1307,7 @@ function upgrade_051_to_052() {
/* create ca entry */
$ca = array();
$ca['refid'] = uniqid();
$ca['name'] = "OpenVPN Server CA #{$index}";
$ca['descr'] = "OpenVPN Server CA #{$index}";
$ca['crt'] = $server['ca_cert'];
$ca['crl'] = $server['crl'];
$config['ca'][] = $ca;
@ -1320,7 +1320,7 @@ function upgrade_051_to_052() {
/* create cert entry */
$cert = array();
$cert['refid'] = uniqid();
$cert['name'] = "OpenVPN Server Certificate #{$index}";
$cert['descr'] = "OpenVPN Server Certificate #{$index}";
$cert['crt'] = $server['server_cert'];
$cert['prv'] = $server['server_key'];
$config['cert'][] = $cert;
@ -1437,7 +1437,7 @@ function upgrade_051_to_052() {
/* create ca entry */
$ca = array();
$ca['refid'] = uniqid();
$ca['name'] = "OpenVPN Client CA #{$index}";
$ca['descr'] = "OpenVPN Client CA #{$index}";
$ca['crt'] = $client['ca_cert'];
$ca['crl'] = $client['crl'];
$config['ca'][] = $ca;
@ -1450,7 +1450,7 @@ function upgrade_051_to_052() {
/* create cert entry */
$cert = array();
$cert['refid'] = uniqid();
$cert['name'] = "OpenVPN Client Certificate #{$index}";
$cert['descr'] = "OpenVPN Client Certificate #{$index}";
$cert['crt'] = $client['client_cert'];
$cert['prv'] = $client['client_key'];
$config['cert'][] = $cert;
@ -1615,7 +1615,7 @@ function upgrade_052_to_053() {
/* create cert entry */
$cert = array();
$cert['refid'] = uniqid();
$cert['name'] = "webConfigurator SSL Certificate";
$cert['descr'] = "webConfigurator SSL Certificate";
$cert['crt'] = $config['system']['webgui']['certificate'];
$cert['prv'] = $config['system']['webgui']['private-key'];
$config['cert'][] = $cert;
@ -1841,7 +1841,7 @@ function upgrade_055_to_056() {
$ca['crt'] = $cacert['cert'][0];
else
$ca['crt'] = $cacert['cert'];
$ca['name'] = $cacert['ident'];
$ca['descr'] = $cacert['ident'];
$config['ca'][] = $ca;
}
unset($config['ipsec']['cacert']);
@ -1852,7 +1852,7 @@ function upgrade_055_to_056() {
foreach($config['ipsec']['phase1'] as & $ph1ent) {
$cert = array();
$cert['refid'] = uniqid();
$cert['name'] = "IPsec Peer {$ph1ent['remote-gateway']} Certificate";
$cert['descr'] = "IPsec Peer {$ph1ent['remote-gateway']} Certificate";
if (is_array($ph1ent['cert']))
$cert['crt'] = $ph1ent['cert'][0];
else
@ -2161,7 +2161,7 @@ function upgrade_068_to_069() {
continue;
$rids = array();
foreach ($user['cert'] as $id => $cert) {
if (!isset($cert['name']))
if (!isset($cert['descr']))
continue;
$tcert = $cert;
// Make sure each cert gets a refid
@ -2242,4 +2242,11 @@ function upgrade_073_to_074() {
global $config;
rename_field($config['system']['user'], 'fullname', 'descr');
}
function upgrade_074_to_075() {
global $config;
rename_field($config['ca'], 'name', 'descr');
rename_field($config['cert'], 'name', 'descr');
rename_field($config['crl'], 'name', 'descr');
}
?>

View File

@ -206,18 +206,18 @@ function vpn_ipsec_configure($ipchg = false)
if (is_array($config['ca']) && count($config['ca'])) {
foreach ($config['ca'] as $ca) {
if (!isset($ca['crt'])) {
log_error("Error: Invalid certificate info for {$ca['name']}");
log_error("Error: Invalid certificate info for {$ca['descr']}");
continue;
}
$cert = base64_decode($ca['crt']);
$x509cert = openssl_x509_parse(openssl_x509_read($cert));
if (!is_array($x509cert) || !isset($x509cert['hash'])) {
log_error("Error: Invalid certificate hash info for {$ca['name']}");
log_error("Error: Invalid certificate hash info for {$ca['descr']}");
continue;
}
$fname = $g['varetc_path']."/".$x509cert['hash'].".0";
if (!file_put_contents($fname, $cert)) {
log_error("Error: Cannot write IPsec CA file for {$ca['name']}");
log_error("Error: Cannot write IPsec CA file for {$ca['descr']}");
continue;
}
}

View File

@ -286,7 +286,7 @@ function prot_change() {
if ($pconfig['ssl-certref'] == $cert['refid'])
$selected = "selected";
?>
<option value="<?=$cert['refid'];?>"<?=$selected;?>><?=$cert['name'];?></option>
<option value="<?=$cert['refid'];?>"<?=$selected;?>><?=$cert['descr'];?></option>
<?php endforeach; ?>
</select>
</td>

View File

@ -78,7 +78,7 @@ if ($act == "del") {
if ($a_cert[$index]['caref'] == $a_ca[$id]['refid'])
unset($a_cert[$index]);
$name = $a_ca[$id]['name'];
$name = $a_ca[$id]['descr'];
unset($a_ca[$id]);
write_config();
$savemsg = sprintf(gettext("Certificate Authority %s successfully deleted"), $name) . "<br/>";
@ -98,7 +98,7 @@ if ($act == "exp") {
exit;
}
$exp_name = urlencode("{$a_ca[$id]['name']}.crt");
$exp_name = urlencode("{$a_ca[$id]['descr']}.crt");
$exp_data = base64_decode($a_ca[$id]['crt']);
$exp_size = strlen($exp_data);
@ -116,7 +116,7 @@ if ($act == "expkey") {
exit;
}
$exp_name = urlencode("{$a_ca[$id]['name']}.key");
$exp_name = urlencode("{$a_ca[$id]['descr']}.key");
$exp_data = base64_decode($a_ca[$id]['prv']);
$exp_size = strlen($exp_data);
@ -171,7 +171,7 @@ if ($_POST) {
if (isset($id) && $a_ca[$id])
$ca = $a_ca[$id];
$ca['name'] = $pconfig['name'];
$ca['descr'] = $pconfig['descr'];
if ($pconfig['method'] == "existing")
ca_import($ca, $pconfig['cert'], $pconfig['key']);
@ -255,7 +255,7 @@ function method_change() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
<td width="78%" class="vtable">
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"/>
<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
</td>
</tr>
<?php if (!isset($id)): ?>
@ -430,7 +430,7 @@ function method_change() {
<?php
$i = 0;
foreach($a_ca as $ca):
$name = htmlspecialchars($ca['name']);
$name = htmlspecialchars($ca['descr']);
$subj = cert_get_subject($ca['crt']);
$issuer = cert_get_issuer($ca['crt']);
if($subj == $issuer)
@ -443,7 +443,7 @@ function method_change() {
$issuer_ca = lookup_ca($ca['caref']);
if ($issuer_ca)
$issuer_name = $issuer_ca['name'];
$issuer_name = $issuer_ca['descr'];
// TODO : Need gray certificate icon

View File

@ -90,7 +90,7 @@ if ($act == "del") {
exit;
}
$name = $a_cert[$id]['name'];
$name = $a_cert[$id]['descr'];
unset($a_cert[$id]);
write_config();
$savemsg = sprintf(gettext("Certificate %s successfully deleted"), $name) . "<br/>";
@ -109,7 +109,7 @@ if ($act == "exp") {
exit;
}
$exp_name = urlencode("{$a_cert[$id]['name']}.crt");
$exp_name = urlencode("{$a_cert[$id]['descr']}.crt");
$exp_data = base64_decode($a_cert[$id]['crt']);
$exp_size = strlen($exp_data);
@ -127,7 +127,7 @@ if ($act == "key") {
exit;
}
$exp_name = urlencode("{$a_cert[$id]['name']}.key");
$exp_name = urlencode("{$a_cert[$id]['descr']}.key");
$exp_data = base64_decode($a_cert[$id]['prv']);
$exp_size = strlen($exp_data);
@ -145,7 +145,7 @@ if ($act == "csr") {
exit;
}
$pconfig['name'] = $a_cert[$id]['name'];
$pconfig['descr'] = $a_cert[$id]['descr'];
$pconfig['csr'] = base64_decode($a_cert[$id]['csr']);
}
@ -222,7 +222,7 @@ if ($_POST) {
if (isset($id) && $a_cert[$id])
$cert = $a_cert[$id];
$cert['name'] = $pconfig['name'];
$cert['descr'] = $pconfig['descr'];
if ($pconfig['method'] == "import")
cert_import($cert, $pconfig['cert'], $pconfig['key']);
@ -296,7 +296,7 @@ if ($_POST) {
$cert = $a_cert[$id];
$cert['name'] = $pconfig['name'];
$cert['descr'] = $pconfig['descr'];
csr_complete($cert, $pconfig['cert']);
@ -436,12 +436,12 @@ function internalca_change() {
<?php endif; ?>
<tr id="descriptivename">
<?php
if ($a_user && empty($pconfig['name']))
$pconfig['name'] = $a_user[$userid]['name'];
if ($a_user && empty($pconfig['descr']))
$pconfig['descr'] = $a_user[$userid]['name'];
?>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
<td width="78%" class="vtable">
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"/>
<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
</td>
</tr>
</table>
@ -504,7 +504,7 @@ function internalca_change() {
if ($pconfig['caref'] == $ca['refid'])
$selected = "selected";
?>
<option value="<?=$ca['refid'];?>"<?=$selected;?>><?=$ca['name'];?></option>
<option value="<?=$ca['refid'];?>"<?=$selected;?>><?=$ca['descr'];?></option>
<?php endforeach; ?>
</select>
</td>
@ -709,13 +709,13 @@ function internalca_change() {
continue;
$ca = lookup_ca($cert['caref']);
if ($ca)
$caname = " (CA: {$ca['name']})";
$caname = " (CA: {$ca['descr']})";
if ($pconfig['certref'] == $cert['refid'])
$selected = "selected";
if (cert_in_use($cert['refid']))
$inuse = " *In Use";
?>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['name'] . $caname . $inuse;?></option>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'] . $caname . $inuse;?></option>
<?php endforeach; ?>
</select>
</td>
@ -742,7 +742,7 @@ function internalca_change() {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
<td width="78%" class="vtable">
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"/>
<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
</td>
</tr>
<tr>
@ -794,7 +794,7 @@ function internalca_change() {
<?php
$i = 0;
foreach($a_cert as $cert):
$name = htmlspecialchars($cert['name']);
$name = htmlspecialchars($cert['descr']);
if ($cert['crt']) {
$subj = cert_get_subject($cert['crt']);
@ -813,7 +813,7 @@ function internalca_change() {
$ca = lookup_ca($cert['caref']);
if ($ca)
$caname = $ca['name'];
$caname = $ca['descr'];
if($cert['prv'])
$certimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";

View File

@ -78,7 +78,7 @@ if ($act == "del") {
if (crl_in_use($a_crl[$id]['refid'])) {
$savemsg = sprintf(gettext("Certificate Revocation List %s is in use and cannot be deleted"), $name) . "<br/>";
} else {
$name = $a_crl[$id]['name'];
$name = $a_crl[$id]['descr'];
unset($a_crl[$id]);
write_config();
$savemsg = sprintf(gettext("Certificate Revocation List %s successfully deleted"), $name) . "<br/>";
@ -99,7 +99,7 @@ if ($act == "exp") {
exit;
}
$exp_name = urlencode("{$a_crl[$id]['name']}.crl");
$exp_name = urlencode("{$a_crl[$id]['descr']}.crl");
$exp_data = base64_decode($a_crl[$id]['text']);
$exp_size = strlen($exp_data);
@ -147,7 +147,7 @@ if ($_POST) {
if (isset($id) && $a_crl[$id])
$crl = $a_crl[$id];
$crl['name'] = $pconfig['name'];
$crl['descr'] = $pconfig['descr'];
$crl['caref'] = $pconfig['caref'];
if ($pconfig['method'] == "existing") {
@ -244,7 +244,7 @@ NOTE: This page is still a work in progress and is not yet fully functional.
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
<td width="78%" class="vtable">
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"/>
<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
</td>
</tr>
<tr>
@ -257,7 +257,7 @@ NOTE: This page is still a work in progress and is not yet fully functional.
if ($pconfig['caref'] == $ca['refid'])
$selected = "selected";
?>
<option value="<?=$ca['refid'];?>"<?=$selected;?>><?=$ca['name'];?></option>
<option value="<?=$ca['refid'];?>"<?=$selected;?>><?=$ca['descr'];?></option>
<?php endforeach; ?>
</select>
</td>
@ -341,7 +341,7 @@ NOTE: This page is still a work in progress and is not yet fully functional.
$i = 0;
foreach($a_ca as $ca):
$name = htmlspecialchars($ca['name']);
$name = htmlspecialchars($ca['descr']);
if($ca['prv']) {
$caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
@ -364,7 +364,7 @@ NOTE: This page is still a work in progress and is not yet fully functional.
</td>
<td class="list">
<a href="system_crlmanager.php?act=new&caref=<?php echo $ca['refid']; ?>">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("Add or Import CRL for ") . $ca['name'];?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" />
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("Add or Import CRL for ") . $ca['descr'];?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" />
</a>
</td>
</tr>
@ -377,17 +377,17 @@ NOTE: This page is still a work in progress and is not yet fully functional.
$inuse = crl_in_use($tmpcrl['refid']);
?>
<tr>
<td class="listlr"><?php echo $tmpcrl['name']; ?></td>
<td class="listlr"><?php echo $tmpcrl['descr']; ?></td>
<td class="listr"><?php echo ($internal) ? "YES" : "NO"; ?></td>
<td class="listr"><?php echo ($internal) ? count($tmpcrl['cert']) : "Unknown (imported)"; ?></td>
<td class="listr"><?php echo ($inuse) ? "YES" : "NO"; ?></td>
<td valign="middle" nowrap class="list">
<a href="system_crlmanager.php?act=exp&id=<?=$i;?>")">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("Export CRL") . " " . htmlspecialchars($tmpcrl['name']);?>" alt="<?=gettext("Export CRL") . " " . htmlspecialchars($tmpcrl['name']);?>" width="17" height="17" border="0" />
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("Export CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" alt="<?=gettext("Export CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" width="17" height="17" border="0" />
</a>
<?php if (!$inuse): ?>
<a href="system_crlmanager.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate Revocation List?") . ' (' . htmlspecialchars($tmpcrl['name']) . ')';?>')">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("Delete CRL") . " " . htmlspecialchars($tmpcrl['name']);?>" alt="<?=gettext("Delete CRL") . " " . htmlspecialchars($tmpcrl['name']); ?>" width="17" height="17" border="0" />
<a href="system_crlmanager.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate Revocation List?") . ' (' . htmlspecialchars($tmpcrl['descr']) . ')';?>')">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("Delete CRL") . " " . htmlspecialchars($tmpcrl['descr']);?>" alt="<?=gettext("Delete CRL") . " " . htmlspecialchars($tmpcrl['descr']); ?>" width="17" height="17" border="0" />
</a>
<?php endif; ?>
</td>

View File

@ -102,7 +102,7 @@ if (isAllowedPage("system_usermanager")) {
$cert =& lookup_cert($a_user[$id]['cert'][$_GET['certid']]);
$exp_name = urlencode("{$a_user[$id]['name']}-{$cert['name']}.crt");
$exp_name = urlencode("{$a_user[$id]['name']}-{$cert['descr']}.crt");
$exp_data = base64_decode($cert['crt']);
$exp_size = strlen($exp_data);
@ -122,7 +122,7 @@ if (isAllowedPage("system_usermanager")) {
$cert =& lookup_cert($a_user[$id]['cert'][$_GET['certid']]);
$exp_name = urlencode("{$a_user[$id]['name']}-{$cert['name']}.key");
$exp_name = urlencode("{$a_user[$id]['name']}-{$cert['descr']}.key");
$exp_data = base64_decode($cert['prv']);
$exp_size = strlen($exp_data);
@ -141,7 +141,7 @@ if (isAllowedPage("system_usermanager")) {
}
$certdeleted = lookup_cert($a_user[$id]['cert'][$_GET['certid']]);
$certdeleted = $certdeleted['name'];
$certdeleted = $certdeleted['descr'];
unset($a_user[$id]['cert'][$_GET['certid']]);
write_config();
$_GET['act'] = "edit";
@ -302,7 +302,7 @@ if (isAllowedPage("system_usermanager")) {
$cert['refid'] = uniqid();
$userent['cert'] = array();
$cert['name'] = $_POST['name'];
$cert['descr'] = $_POST['name'];
$subject = cert_get_subject_array($ca['crt']);
@ -644,10 +644,10 @@ function sshkeyClicked(obj) {
?>
<tr>
<td class="listlr">
<?=htmlspecialchars($cert['name']);?>
<?=htmlspecialchars($cert['descr']);?>
</td>
<td class="listr">
<?=htmlspecialchars($ca['name']);?>
<?=htmlspecialchars($ca['descr']);?>
</td>
<td valign="middle" nowrap class="list">
<a href="system_usermanager.php?act=expckey&id=<?=$id;?>&certid=<?=$i;?>">
@ -703,7 +703,7 @@ function sshkeyClicked(obj) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
<td width="78%" class="vtable">
<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"/>
<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/>
</td>
</tr>
<tr>
@ -715,7 +715,7 @@ function sshkeyClicked(obj) {
if (!$ca['prv'])
continue;
?>
<option value="<?=$ca['refid'];?>"><?=$ca['name'];?></option>
<option value="<?=$ca['refid'];?>"><?=$ca['descr'];?></option>
<?php endforeach; ?>
</select>
</td>

View File

@ -719,7 +719,7 @@ function dpdchkbox_change() {
if ($pconfig['certref'] == $cert['refid'])
$selected = "selected";
?>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['name'];?></option>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'];?></option>
<?php endforeach; ?>
</select>
<br>
@ -738,7 +738,7 @@ function dpdchkbox_change() {
if ($pconfig['caref'] == $ca['refid'])
$selected = "selected";
?>
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['name'];?></option>
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option>
<?php endforeach; ?>
</select>
<br>

View File

@ -615,7 +615,7 @@ function autotls_change() {
if ($pconfig['caref'] == $ca['refid'])
$selected = "selected";
?>
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['name'];?></option>
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option>
<?php endforeach; ?>
</select>
</td>
@ -630,7 +630,7 @@ function autotls_change() {
if ($pconfig['certref'] == $cert['refid'])
$selected = "selected";
?>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['name'];?></option>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'];?></option>
<?php endforeach; ?>
</select>
</td>

View File

@ -721,7 +721,7 @@ function netbios_change() {
if ($pconfig['caref'] == $ca['refid'])
$selected = "selected";
?>
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['name'];?></option>
<option value="<?=$ca['refid'];?>" <?=$selected;?>><?=$ca['descr'];?></option>
<?php endforeach; ?>
</select>
</td>
@ -739,7 +739,7 @@ function netbios_change() {
if ($pconfig['crlref'] == $crl['refid'])
$selected = "selected";
?>
<option value="<?=$crl['refid'];?>" <?=$selected;?>><?=$crl['name'];?></option>
<option value="<?=$crl['refid'];?>" <?=$selected;?>><?=$crl['descr'];?></option>
<?php endforeach; ?>
</select>
</td>
@ -751,12 +751,12 @@ function netbios_change() {
<?php
foreach ($config['cert'] as $cert):
$selected = "";
if (strstr($cert['name'], "webConfigurator"))
if (strstr($cert['descr'], "webConfigurator"))
continue;
if ($pconfig['certref'] == $cert['refid'])
$selected = "selected";
?>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['name'];?></option>
<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'];?></option>
<?php endforeach; ?>
</select>
</td>

View File

@ -518,7 +518,7 @@ function showchange() {
echo "<option value='" . $field['add_to_certca_selection'] . "'" . $SELECTED . ">" . $field['add_to_certca_selection'] . "</option>\n";
}
foreach($config['ca'] as $ca) {
$name = htmlspecialchars($ca['name']);
$name = htmlspecialchars($ca['descr']);
$SELECTED = "";
if ($value == $name) $SELECTED = " SELECTED";
$to_echo = "<option value='" . $ca['refid'] . "'" . $SELECTED . ">" . $name . "</option>\n";
@ -556,9 +556,9 @@ function showchange() {
echo "<option value='" . $field['add_to_cert_selection'] . "'" . $SELECTED . ">" . $field['add_to_cert_selection'] . "</option>\n";
}
foreach($config['cert'] as $ca) {
if (stristr($ca['name'], "webconf"))
if (stristr($ca['descr'], "webconf"))
continue;
$name = htmlspecialchars($ca['name']);
$name = htmlspecialchars($ca['descr']);
$SELECTED = "";
if ($value == $name) $SELECTED = " SELECTED";
$to_echo = "<option value='" . $ca['refid'] . "'" . $SELECTED . ">" . $name . "</option>\n";

View File

@ -187,7 +187,7 @@ function step7_submitphpaction() {
$cacns = array();
if (is_array($config['ca'])) {
foreach($config['ca'] as $ca) {
$canames[] = $ca['name'];
$canames[] = $ca['descr'];
$cainfo = cert_get_subject_hash($ca['crt']);
$cacns[] = $cainfo["CN"];
}
@ -214,7 +214,7 @@ function step8_stepbeforeformdisplay() {
global $stepid, $config;
if (count($config['cert']) < 1 ||
(count($config['cert']) == 1 && stristr($config['cert'][0]['name'], "webconf"))) {
(count($config['cert']) == 1 && stristr($config['cert'][0]['descr'], "webconf"))) {
$stepid++;
}
}
@ -273,7 +273,7 @@ function step9_submitphpaction() {
$certcns = array();
if (is_array($config['cert'])) {
foreach($config['cert'] as $cert) {
$certnames[] = $cert['name'];
$certnames[] = $cert['descr'];
$certinfo = cert_get_subject_hash($cert['crt']);
$certcns[] = $certinfo["CN"];
}
@ -440,7 +440,7 @@ function step12_submitphpaction() {
if (isset($pconfig['step6']['uselist']) && !empty($pconfig['step6']['certca'])) {
$ca = array();
$ca['refid'] = uniqid();
$ca['name'] = $pconfig['step6']['certca'];
$ca['descr'] = $pconfig['step6']['certca'];
$dn = array(
'countryName' => $pconfig['step6']['country'],
'stateOrProvinceName' => $pconfig['step6']['state'],
@ -467,7 +467,7 @@ function step12_submitphpaction() {
if (isset($pconfig['step9']['uselist'])) {
$cert = array();
$cert['refid'] = uniqid();
$cert['name'] = $pconfig['step9']['certname'];
$cert['descr'] = $pconfig['step9']['certname'];
$dn = array(
'countryName' => $pconfig['step9']['country'],
'stateOrProvinceName' => $pconfig['step9']['state'],