summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_camanager.php
diff options
context:
space:
mode:
authorEvgeny Yurchenko <ey@tm-k.com>2011-06-23 20:05:35 -0400
committerEvgeny Yurchenko <ey@tm-k.com>2011-06-23 20:05:35 -0400
commit1b6d9fa59cdc3a284497abb0bfa415741c258d10 (patch)
treeb6bb43ade136bc7924db4490998c6e60027cdcff /usr/local/www/system_camanager.php
parent95c8cf48f9bd72da5371aa01a03a070885411dbf (diff)
downloadpfsense-1b6d9fa59cdc3a284497abb0bfa415741c258d10.zip
pfsense-1b6d9fa59cdc3a284497abb0bfa415741c258d10.tar.gz
Internal CA creation error handling added.
Diffstat (limited to 'usr/local/www/system_camanager.php')
-rw-r--r--usr/local/www/system_camanager.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php
index 92a129a..9a18c87 100644
--- a/usr/local/www/system_camanager.php
+++ b/usr/local/www/system_camanager.php
@@ -243,6 +243,7 @@ if ($_POST) {
if (!empty($pconfig['key']))
$ca['prv'] = base64_encode($pconfig['key']);
} else {
+ $old_err_level = error_reporting(0); /* otherwise openssl_ functions throw warings directly to a page screwing menu tab */
if ($pconfig['method'] == "existing")
ca_import($ca, $pconfig['cert'], $pconfig['key'], $pconfig['serial']);
@@ -254,7 +255,12 @@ if ($_POST) {
'organizationName' => $pconfig['dn_organization'],
'emailAddress' => $pconfig['dn_email'],
'commonName' => $pconfig['dn_commonname']);
- ca_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn);
+ if (!ca_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn)){
+ while($ssl_err = openssl_error_string()){
+ $input_errors = array();
+ array_push($input_errors, "openssl library returns: " . $ssl_err);
+ }
+ }
}
else if ($pconfig['method'] == "intermediate") {
$dn = array(
@@ -264,15 +270,14 @@ if ($_POST) {
'organizationName' => $pconfig['dn_organization'],
'emailAddress' => $pconfig['dn_email'],
'commonName' => $pconfig['dn_commonname']);
- $old_err_level = error_reporting(0); /* otherwise openssl_ functions throw warings directly to a page screwing menu tab */
if (!ca_inter_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn, $pconfig['caref'])){
while($ssl_err = openssl_error_string()){
$input_errors = array();
array_push($input_errors, "openssl library returns: " . $ssl_err);
}
}
- error_reporting($old_err_level);
}
+ error_reporting($old_err_level);
}
if (isset($id) && $a_ca[$id])
OpenPOWER on IntegriCloud