summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorRenato Botelho <renato.botelho@bluepex.com>2010-07-08 17:03:39 -0300
committerRenato Botelho <renato.botelho@bluepex.com>2010-07-08 17:03:39 -0300
commita08a7fc170cbcaf6f875f28f6f9ec60192f42d0c (patch)
treec345b8e1ce9ed6254328531aee747df80485af32 /usr/local
parenta2418a8008da1486074f40722c52f449fa99fd99 (diff)
parentdab2e7699e8735fc8055b793847a27977950e7ca (diff)
downloadpfsense-a08a7fc170cbcaf6f875f28f6f9ec60192f42d0c.zip
pfsense-a08a7fc170cbcaf6f875f28f6f9ec60192f42d0c.tar.gz
Merge remote branch 'mainline/master'
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/system_camanager.php33
-rwxr-xr-xusr/local/www/wizard.php12
2 files changed, 38 insertions, 7 deletions
diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php
index 0ca9494..7aae43e 100644
--- a/usr/local/www/system_camanager.php
+++ b/usr/local/www/system_camanager.php
@@ -110,6 +110,24 @@ if ($act == "exp") {
exit;
}
+if ($act == "expkey") {
+
+ if (!$a_ca[$id]) {
+ pfSenseHeader("system_camanager.php");
+ exit;
+ }
+
+ $exp_name = urlencode("{$a_ca[$id]['name']}.key");
+ $exp_data = base64_decode($a_ca[$id]['prv']);
+ $exp_size = strlen($exp_data);
+
+ header("Content-Type: application/octet-stream");
+ header("Content-Disposition: attachment; filename={$exp_name}");
+ header("Content-Length: $exp_size");
+ echo $exp_data;
+ exit;
+}
+
if ($_POST) {
unset($input_errors);
@@ -157,7 +175,7 @@ if ($_POST) {
$ca['name'] = $pconfig['name'];
if ($pconfig['method'] == "existing")
- ca_import($ca, $pconfig['cert']);
+ ca_import($ca, $pconfig['cert'], $pconfig['key']);
if ($pconfig['method'] == "internal")
{
@@ -275,6 +293,14 @@ function method_change() {
<?=gettext("Paste a certificate in X.509 PEM format here.");?></td>
</td>
</tr>
+ <tr>
+ <td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate Private Key");?><br/><?=gettext("(optional)");?></td>
+ <td width="78%" class="vtable">
+ <textarea name="key" id="key" cols="65" rows="7" class="formfld_cert"><?=$pconfig['key'];?></textarea>
+ <br>
+ <?=gettext("Paste the private key for the above certificate here. This is optional in most cases, but required if you need to generate a Certificate Revocation List (CRL).");?></td>
+ </td>
+ </tr>
</table>
<table width="100%" border="0" cellpadding="6" cellspacing="0" id="internal">
@@ -457,6 +483,11 @@ function method_change() {
<a href="system_camanager.php?act=exp&id=<?=$i;?>")">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export ca");?>" alt="<?=gettext("export ca");?>" width="17" height="17" border="0" />
</a>
+ <?php if ($ca['prv']): ?>
+ <a href="system_camanager.php?act=expkey&id=<?=$i;?>")">
+ <img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export ca private key");?>" alt="<?=gettext("export ca private key");?>" width="17" height="17" border="0" />
+ </a>
+ <?php endif; ?>
<a href="system_camanager.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate Authority and all associated certificates?");?>')">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete ca");?>" alt="<?=gettext("delete ca"); ?>" width="17" height="17" border="0" />
</a>
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index 5ba3ff8..800bf30 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -36,6 +36,7 @@
##|-PRIV
+require("globals.inc");
require("guiconfig.inc");
require("functions.inc");
require("filter.inc");
@@ -47,6 +48,8 @@ function gentitle_pkg($pgname) {
return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname;
}
+global $g;
+
$stepid = htmlspecialchars($_GET['stepid']);
if (isset($_POST['stepid']))
$stepid = htmlspecialchars($_POST['stepid']);
@@ -75,9 +78,9 @@ if (!is_array($pkg)) {
die;
}
-$title = $pkg['step'][$stepid]['title'];
-$description = $pkg['step'][$stepid]['description'];
-$totalsteps = $pkg['totalsteps'];
+$title = preg_replace("/pfSense/i", $g['product_name'], $pkg['step'][$stepid]['title']);
+$description = preg_replace("/pfSense/i", $g['product_name'], $pkg['step'][$stepid]['description']);
+$totalsteps = $pkg['totalsteps'];
if ($pkg['includefile'])
require_once($pkg['includefile']);
@@ -119,9 +122,6 @@ if ($_POST) {
$stepid = $totalsteps;
}
-$title = $pkg['step'][$stepid]['title'];
-$description = $pkg['step'][$stepid]['description'];
-
function update_config_field($field, $updatetext, $unset, $arraynum, $field_type) {
global $config;
$field_split = split("->",$field);
OpenPOWER on IntegriCloud