diff options
author | vsquared56 <vladv@rvtn.org> | 2014-03-24 02:17:41 -0500 |
---|---|---|
committer | vsquared56 <vladv@rvtn.org> | 2014-03-24 02:17:41 -0500 |
commit | 2a08b81457f00d7502dd781ca623990a9f22f26e (patch) | |
tree | 363b1c47912838683e825e34167cdd4397df0813 /etc/inc | |
parent | 6b5c8143cbd62fc33b767b41243c81a5c8425bd8 (diff) | |
download | pfsense-2a08b81457f00d7502dd781ca623990a9f22f26e.zip pfsense-2a08b81457f00d7502dd781ca623990a9f22f26e.tar.gz |
Return full issuer for DN with multiple attribute values
e.g. CN=Some Root CA,OU=Certificates Department,OU=(c) Copyright SomeCorp,O=SomeCorp,C=US
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/certs.inc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc index 518bc59..a1397b8 100644 --- a/etc/inc/certs.inc +++ b/etc/inc/certs.inc @@ -449,10 +449,16 @@ function cert_get_issuer($str_crt, $decode = true) { ksort($components); foreach ($components as $a => $v) { - if (!strlen($issuer)) - $issuer = "{$a}={$v}"; - else - $issuer = "{$a}={$v}, {$issuer}"; + if (is_array($v)) { + ksort($v); + foreach ($v as $w) { + $aissuer = "{$a}={$w}"; + $issuer = (strlen($issuer)) ? "{$aissuer}, {$issuer}" : $aissuer; + } + } else { + $aissuer = "{$a}={$v}"; + $issuer = (strlen($issuer)) ? "{$aissuer}, {$issuer}" : $aissuer; + } } return $issuer; |