diff options
author | Nigel Graham <nigel@maven-group.org> | 2009-05-26 06:23:58 +0200 |
---|---|---|
committer | Nigel Graham <nigel@maven-group.org> | 2009-05-26 06:23:58 +0200 |
commit | 801247db0d1ac947b2f6a4f4de14686c8f0b459a (patch) | |
tree | 2998839cf3cfd1e06f55c1c953a6c22fc4ea5707 | |
parent | faa7e333cc1ffece3c6db7aa83a3ec30acec0e62 (diff) | |
download | pfsense-801247db0d1ac947b2f6a4f4de14686c8f0b459a.zip pfsense-801247db0d1ac947b2f6a4f4de14686c8f0b459a.tar.gz |
Fixed a problem in ca_chain that caused a segmentation fault.
-rw-r--r-- | etc/inc/certs.inc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc index 40c0922..0e2341c 100644 --- a/etc/inc/certs.inc +++ b/etc/inc/certs.inc @@ -69,16 +69,16 @@ function & lookup_cert($refid) { function ca_chain_array(& $cert) {
if($cert['caref']) {
$chain = array();
- $cert =& lookup_ca($cert['caref']);
- $chain[] = $cert;
+ $crt =& lookup_ca($cert['caref']);
+ $chain[] = $crt;
while ($cert) {
- $caref = $cert['caref'];
+ $caref = $crt['caref'];
if($caref)
- $cert =& lookup_ca($caref);
+ $crt =& lookup_ca($caref);
else
- $cert = false;
- if($cert)
- $chain[] = $cert;
+ $crt = false;
+ if($crt)
+ $chain[] = $crt;
}
return $chain;
}
@@ -88,7 +88,7 @@ function ca_chain_array(& $cert) { function ca_chain(& $cert) {
if($cert['caref']) {
$ca = "";
- $cas = ca_chain($cert);
+ $cas = ca_chain_array($cert);
if (is_array($cas))
foreach ($cas as & $ca_cert)
{
@@ -97,7 +97,7 @@ function ca_chain(& $cert) { }
return $ca;
}
- return false;
+ return "";
}
function ca_import(& $ca, $str) {
|