ID:               28671
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jgrillon at capgemini dot fr
-Status:           No Feedback
+Status:           Closed
 Bug Type:         OpenSSL related
 Operating System: Linux 2.1
 PHP Version:      4.3.7
-Assigned To:      wez
+Assigned To:      pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

It has been a long time, but better later than never (also no feedback
does not help to catch such bugs).

Fixed in HEAD, will MFH for 5.2.1.


Previous Comments:
------------------------------------------------------------------------

[2005-05-25 01:00:03] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2005-05-17 12:20:21] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2004-06-08 09:51:07] [EMAIL PROTECTED]

Assigning to the maintainer, wez.

------------------------------------------------------------------------

[2004-06-07 14:35:44] jgrillon at capgemini dot fr

Description:
------------
I'm always getting "-1" as serialNumber for my certificate.

I can't see why the serial number is stored into a long in openssl.c :
add_assoc_long(return_value, "serialNumber",           
ASN1_INTEGER_get(X509_get_serialNumber(cert)));

I guess the serial number is too big for a long...
Can't we store it as string ?
add_assoc_asn1_string(return_value, "serialNumberAsString",            
X509_get_serialNumber(cert));

Thanks.

Here is the certificate I used :
-----BEGIN CERTIFICATE-----
MIIC3DCCAkWgAwIBAgIQeqhtj1pzHCrTTq2AldV0ejANBgkqhkiG9w0BAQQFADAy
MRcwFQYDVQQKEw5FLUFDSEFUIE1JTkRFRjEXMBUGA1UEAxMORS1BQ0hBVCBNSU5E
RUYwHhcNMDQwMTA1MDAwMDAwWhcNMDYwMTA0MjM1OTU5WjCB5DEOMAwGA1UEBxQF
UEFSSVMxCzAJBgNVBAYTAkZSMRcwFQYDVQQKFA5FLUFDSEFUIE1JTkRFRjEtMCsG
A1UECxQkRW50LiAtIENhcCBHZW1pbmkgRXJuc3QgWW91bmcgRnJhbmNlMR8wHQYD
VQQLFBZTSVJFTiAtIDMyODc4MTc4NjAwMDUzMTQwMgYDVQQDEytDR0VZIEZyYW5j
ZSAtIENhcCBHZW1pbmkgRXJuc3QgWW91bmcgRnJhbmNlMSYwJAYJKoZIhvcNAQkB
FhdkZ2FlbWEtbWNvQGNhcGdlbWluaS5mcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEApFgcuVTuUe0z+iGTaPw7yVxhZsPq6aIqGHsCvU9fqUcymbmg9l4oTfAk
gR5bvDo+JTQb1/OPlQCKqyVa7wn6lPs97dMOZMobjCRcvw7z0jVphortA1NS8FRH
6LsWELZ13uC57IIakpW726Vz3tST9qHHbQoWbX/n8NjHcwL4zUECAwEAAaNAMD4w
CQYDVR0TBAIwADALBgNVHQ8EBAMCBaAwEQYJYIZIAYb4QgEBBAQDAgeAMBEGCmCG
SAGG+EUBBgkEAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAWdmEu8TkFdgqA/xN6llo9
zZR3EUH0X5HstxJRYgofcQyfumJHhgvaNB8vkDhZ3iJORVVxcJ27W36TAJ6b4jcr
yWjO/nc42XdgknS8r9NIV7VKzmjY7Ip2+9N6JOAWFkjGrnF1G69nrerIJavJTzrb
PYlQnzJO6SHAoi5j6WsKPw==
-----END CERTIFICATE-----


Reproduce code:
---------------
 $fp = fopen("xxx.cer", "r");
 $cert = fread($fp, 8192);
 $r = @openssl_x509_read($cert);
 print_r(openssl_x509_parse($r));

Expected result:
----------------
Something like

[...]
 [serialNumber] => 7a a8 6d 8f 5a 73 1c 2a d3 4e ad 80 95 d5 74 7a
[...]


Actual result:
--------------
[...]
 [serialNumber] => -1
[...]


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28671&edit=1

Reply via email to