summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-01-07 21:37:20 +0000
committerErmal <eri@pfsense.org>2011-01-07 21:37:20 +0000
commitb89c34aacfcde984b0395ffc0b0fbf8e3361cb03 (patch)
tree9d365b80d8eceac0281af2fb2856f21b4360478f /etc
parentb2b155434f2b3c87d3138fc98ac712d4e7904db3 (diff)
downloadpfsense-b89c34aacfcde984b0395ffc0b0fbf8e3361cb03.zip
pfsense-b89c34aacfcde984b0395ffc0b0fbf8e3361cb03.tar.gz
Ticket #621. sort the contents of array used for generating subject by keys so whenever we do subject comparison we will not have problem just because of the array keys ordering.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/certs.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/etc/inc/certs.inc b/etc/inc/certs.inc
index e82baba..03371fd 100644
--- a/etc/inc/certs.inc
+++ b/etc/inc/certs.inc
@@ -307,13 +307,15 @@ function cert_get_subject($str_crt, $decode = true) {
if (!is_array($components))
return "unknown";
+ ksort($components);
foreach ($components as $a => $v) {
- if (is_array($v))
+ if (is_array($v)) {
+ ksort($v);
foreach ($v as $w) {
$asubject = "{$a}={$w}";
$subject = (strlen($subject)) ? "{$asubject}, {$subject}" : $asubject;
}
- else {
+ } else {
$asubject = "{$a}={$v}";
$subject = (strlen($subject)) ? "{$asubject}, {$subject}" : $asubject;
}
@@ -561,4 +563,4 @@ function is_crl_internal($crl) {
return !(!empty($crl['text']) && empty($crl['cert']));
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud