summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-10-19 14:19:44 -0400
committerjim-p <jimp@pfsense.org>2010-10-19 14:19:44 -0400
commitf2a86ca96fb8e49d978679dab4cfad6ce2f0d9f4 (patch)
tree5d64e957ba798bc7818f31a3dc7b1593de59a7f0
parent6751b3e7863196ab865f8fb76a2ad6e9f8556788 (diff)
downloadpfsense-f2a86ca96fb8e49d978679dab4cfad6ce2f0d9f4.zip
pfsense-f2a86ca96fb8e49d978679dab4cfad6ce2f0d9f4.tar.gz
Rename 'name' to 'descr' for CA, Certificates, and CRLs, to gain CDATA protection and standardize field names. Ticket #320.
-rw-r--r--etc/inc/certs.inc10
-rw-r--r--etc/inc/globals.inc2
-rw-r--r--etc/inc/system.inc2
-rw-r--r--etc/inc/upgrade_config.inc23
-rw-r--r--etc/inc/vpn.inc6
-rw-r--r--usr/local/www/system_advanced_admin.php2
-rw-r--r--usr/local/www/system_camanager.php14
-rw-r--r--usr/local/www/system_certmanager.php30
-rw-r--r--usr/local/www/system_crlmanager.php22
-rw-r--r--usr/local/www/system_usermanager.php16
-rw-r--r--usr/local/www/vpn_ipsec_phase1.php4
-rw-r--r--usr/local/www/vpn_openvpn_client.php4
-rw-r--r--usr/local/www/vpn_openvpn_server.php8
-rwxr-xr-xusr/local/www/wizard.php6
-rw-r--r--usr/local/www/wizards/openvpn_wizard.inc10
15 files changed, 83 insertions, 76 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc
index 0a9e342..ef55a3e 100644
--- a/etc/inc/certs.inc
+++ b/etc/inc/certs.inc
@@ -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;
}
}
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index b11e17b..5196dac 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -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",
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 8f375f5..ba9ad05 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -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");
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index ca4ec2a..1a8c5a1 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -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');
+}
?>
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 8670bde..b346ce6 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -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;
}
}
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php
index c3ea1a0..f34d1c7 100644
--- a/usr/local/www/system_advanced_admin.php
+++ b/usr/local/www/system_advanced_admin.php
@@ -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>
diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php
index 815802f..b60fc51 100644
--- a/usr/local/www/system_camanager.php
+++ b/usr/local/www/system_camanager.php
@@ -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
diff --git a/usr/local/www/system_certmanager.php b/usr/local/www/system_certmanager.php
index 9a5038e..d2789d9 100644
--- a/usr/local/www/system_certmanager.php
+++ b/usr/local/www/system_certmanager.php
@@ -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";
diff --git a/usr/local/www/system_crlmanager.php b/usr/local/www/system_crlmanager.php
index f1e30f1..e381849 100644
--- a/usr/local/www/system_crlmanager.php
+++ b/usr/local/www/system_crlmanager.php
@@ -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>
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php
index a80ba00..706ffde 100644
--- a/usr/local/www/system_usermanager.php
+++ b/usr/local/www/system_usermanager.php
@@ -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>
diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php
index 25c6f4f..c2ba332 100644
--- a/usr/local/www/vpn_ipsec_phase1.php
+++ b/usr/local/www/vpn_ipsec_phase1.php
@@ -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>
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index d957f86..f0db930 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -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>
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index 216827f..c6e4825 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -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>
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index 3ccf662..9a4a8fe 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -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";
diff --git a/usr/local/www/wizards/openvpn_wizard.inc b/usr/local/www/wizards/openvpn_wizard.inc
index fc7d0c4..518aad2 100644
--- a/usr/local/www/wizards/openvpn_wizard.inc
+++ b/usr/local/www/wizards/openvpn_wizard.inc
@@ -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'],
OpenPOWER on IntegriCloud