#18613 [NoF->Asn]: Multiple OU in x509 certificate problem
| From: | sniper@php.net | Date: | Wed, 05 May 2004 20:23:56 +0000 |
| Subject: | #18613 [NoF->Asn]: Multiple OU in x509 certificate problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59263@lists.php.net to get a copy of this message | ||
ID: 18613
Updated by: sniper@php.net
Reported By: agoralski at certum dot pl
-Status: No Feedback
+Status: Assigned
Bug Type: OpenSSL related
Operating System: Linux 2.4.18-grsec
PHP Version: 4.3.4
-Assigned To:
+Assigned To: wez
New Comment:
Wez, iirc, you're the maintainer of ext/openssl nowadays..?
(if I'm wrong, reassign to the correct person :)
Previous Comments:
------------------------------------------------------------------------
[2004-04-12 19:18:14] allins at nosc dot mil
confirmed, still exists in 4/12 stable snapshot.
------------------------------------------------------------------------
[2004-04-12 17:57:08] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
------------------------------------------------------------------------
[2004-04-07 09:05:19] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
And if the bug still exists and you have some patch, PLEASE provide it
as 'diff -u' here..
------------------------------------------------------------------------
[2004-04-07 03:05:57] agoralski at certum dot pl
Multiple OUs are visible in "name" after openssl_x509_parse so here's a
quick & dirty workaround:
function get_ous($data) {
if (strlen(strstr($data,'/OU='))>0) {
$parts=explode('=', $data);
for ($i=0, $j=count($parts); $i<$j; $i++) {
if ($i>0) {
if (substr($parts[$i-1], strrpos($parts[$i-1],
'/')+1)=='OU') {
$ret[]=substr($parts[$i], 0, strrpos($parts[$i],
'/'));
}
}
}
return $ret;
} else {
return false;
}
}
$cert=openssl_x509_parse($crt);
$ous=get_ous($cert['name']);
if (is_array($ous)) {
//your code here
}
------------------------------------------------------------------------
[2004-04-06 12:50:59] allins at nosc dot mil
confirmed also exists in php 4.3.4 on fedora linux
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/18613
--
Edit this bug report at http://bugs.php.net/?id=18613&edit=1