Commit 1ce3d94c authored by Franco Fichtner's avatar Franco Fichtner

inc: apply random style fixes

(cherry picked from commit d01b7296)
parent 739ce7e9
...@@ -42,7 +42,8 @@ $openssl_crl_status = array( ...@@ -42,7 +42,8 @@ $openssl_crl_status = array(
OCSP_REVOKED_STATUS_CERTIFICATEHOLD => "Certificate Hold" OCSP_REVOKED_STATUS_CERTIFICATEHOLD => "Certificate Hold"
); );
function & lookup_ca($refid) { function &lookup_ca($refid)
{
global $config; global $config;
$false = false; $false = false;
...@@ -53,10 +54,12 @@ function & lookup_ca($refid) { ...@@ -53,10 +54,12 @@ function & lookup_ca($refid) {
} }
} }
} }
return $false; return $false;
} }
function & lookup_ca_by_subject($subject) { function &lookup_ca_by_subject($subject)
{
global $config; global $config;
$false = false; $false = false;
...@@ -68,10 +71,12 @@ function & lookup_ca_by_subject($subject) { ...@@ -68,10 +71,12 @@ function & lookup_ca_by_subject($subject) {
} }
} }
} }
return $false; return $false;
} }
function & lookup_cert($refid) { function &lookup_cert($refid)
{
global $config; global $config;
$false = false; $false = false;
...@@ -86,20 +91,24 @@ function & lookup_cert($refid) { ...@@ -86,20 +91,24 @@ function & lookup_cert($refid) {
return $false; return $false;
} }
function & lookup_crl($refid) { function &lookup_crl($refid)
global $config; {
$false = false; global $config;
if (is_array($config['crl'])) { $false = false;
foreach ($config['crl'] as & $crl) {
if ($crl['refid'] == $refid) { if (is_array($config['crl'])) {
return $crl; foreach ($config['crl'] as & $crl) {
} if ($crl['refid'] == $refid) {
} return $crl;
} }
return $false; }
}
return $false;
} }
function ca_chain_array(& $cert) { function ca_chain_array(&$cert)
{
if($cert['caref']) { if($cert['caref']) {
$chain = array(); $chain = array();
$crt = lookup_ca($cert['caref']); $crt = lookup_ca($cert['caref']);
...@@ -277,8 +286,6 @@ function cert_create(&$cert, $caref, $keylen, $lifetime, $dn, $digest_alg = 'sha ...@@ -277,8 +286,6 @@ function cert_create(&$cert, $caref, $keylen, $lifetime, $dn, $digest_alg = 'sha
return true; return true;
} }
function csr_get_subject($str_crt, $decode = true) function csr_get_subject($str_crt, $decode = true)
{ {
if ($decode) { if ($decode) {
...@@ -378,7 +385,7 @@ function cert_get_issuer($str_crt, $decode = true) ...@@ -378,7 +385,7 @@ function cert_get_issuer($str_crt, $decode = true)
} }
return $issuer; return $issuer;
} }
/* this function works on x509 (crt), rsa key (prv), and req(csr) */ /* this function works on x509 (crt), rsa key (prv), and req(csr) */
function cert_get_modulus($str_crt, $decode = true, $type = 'crt') function cert_get_modulus($str_crt, $decode = true, $type = 'crt')
......
...@@ -76,7 +76,7 @@ function alias_make_table($config) ...@@ -76,7 +76,7 @@ function alias_make_table($config)
} }
} }
} }
} }
/** /**
* parse config into array and return * parse config into array and return
...@@ -300,7 +300,6 @@ function set_device_perms() { ...@@ -300,7 +300,6 @@ function set_device_perms() {
} }
} }
function make_config_revision_entry($desc = '') function make_config_revision_entry($desc = '')
{ {
global $config; global $config;
......
...@@ -336,5 +336,3 @@ function handle_ajax($nentries, $tail = 50) ...@@ -336,5 +336,3 @@ function handle_ajax($nentries, $tail = 50)
exit; exit;
} }
} }
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment