diff options
author | Ermal <eri@pfsense.org> | 2011-01-07 21:37:20 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-01-07 21:37:20 +0000 |
commit | b89c34aacfcde984b0395ffc0b0fbf8e3361cb03 (patch) | |
tree | 9d365b80d8eceac0281af2fb2856f21b4360478f | |
parent | b2b155434f2b3c87d3138fc98ac712d4e7904db3 (diff) | |
download | pfsense-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.
-rw-r--r-- | etc/inc/certs.inc | 8 |
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 +?> |