summaryrefslogtreecommitdiffstats
path: root/etc/inc/certs.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-06-24 12:10:51 +0000
committerErmal <eri@pfsense.org>2011-06-24 12:10:51 +0000
commit5ca13f69b79ab1e461e7a689d7d02a8c2c0794eb (patch)
tree6041080ddd7e8b4b654abf1bfd6483a1ab386ece /etc/inc/certs.inc
parent22b380aa6f4b7401b887945262a2e595d03dac26 (diff)
downloadpfsense-5ca13f69b79ab1e461e7a689d7d02a8c2c0794eb.zip
pfsense-5ca13f69b79ab1e461e7a689d7d02a8c2c0794eb.tar.gz
Import error handling to avoid errors.
Diffstat (limited to 'etc/inc/certs.inc')
-rw-r--r--etc/inc/certs.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc
index 6ab448b..3f655b1 100644
--- a/etc/inc/certs.inc
+++ b/etc/inc/certs.inc
@@ -338,7 +338,7 @@ function csr_get_subject($str_crt, $decode = true) {
$components = openssl_csr_get_subject($str_crt);
- if (!is_array($components))
+ if (empty($components) || !is_array($components))
return "unknown";
ksort($components);
@@ -360,7 +360,7 @@ function cert_get_subject($str_crt, $decode = true) {
$inf_crt = openssl_x509_parse($str_crt);
$components = $inf_crt['subject'];
- if (!is_array($components))
+ if (empty($components) || !is_array($components))
return "unknown";
ksort($components);
@@ -410,9 +410,10 @@ function cert_get_issuer($str_crt, $decode = true) {
$inf_crt = openssl_x509_parse($str_crt);
$components = $inf_crt['issuer'];
- ksort($components);
- if (!is_array($components))
+ if (empty($components) || !is_array($components))
return "unknown";
+
+ ksort($components);
foreach ($components as $a => $v) {
if (!strlen($issuer))
$issuer = "{$a}={$v}";
OpenPOWER on IntegriCloud