Bug #77411 [Opn]: openssl_x509_parse serialNumber not always integer with OpenSSL version 1.1
| From: | cmb@php.net | Date: | Tue, 19 Jan 2021 14:22:20 +0000 |
| Subject: | Bug #77411 [Opn]: openssl_x509_parse serialNumber not always integer with OpenSSL version 1.1 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231643@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77411&edit=1
ID: 77411
Updated by: cmb@php.net
Reported by: korikulum at net dot hr
Summary: openssl_x509_parse serialNumber not always integer
with OpenSSL version 1.1
Status: Open
Type: Bug
Package: OpenSSL related
Operating System: Ubuntu 14.04
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Given that the docs[1] state:
| The structure of the returned data is (deliberately) not yet
| documented, as it is still subject to change.
I wouldn't call that a bug, and it might be best to drop the
"serialNumber" altogether.
[1] <https://www.php.net/manual/en/function.openssl-x509-parse.php>
Previous Comments:
------------------------------------------------------------------------
[2019-01-05 00:29:01] korikulum at net dot hr
Description:
------------
With OpenSSL version 1.0 "openssl_x509_parse" would always return "serialNumber"
as a string representation of an integer value, while "serialNumberHex" would be a string
representation of a hexadecimal number.
This changes when using OpenSSL version 1.1. With OpenSSL version 1.1 the value of
"serialNumber" is sometimes (not always) returned as a string representation of a
hexadecimal number instead of an integer.
This is due to the following changes in OpenSSL: https://github.com/openssl/openssl/commit/10a3195fcf7d04ba519651cf12e945a8fe470a3c
Expected result:
----------------
["serialNumber"]=>
string(39) "269913321572441498538983276629377170905"
["serialNumberHex"]=>
string(32) "CB0F6A32FD527F6C0001000056603DD9"
Actual result:
--------------
["serialNumber"]=>
string(34) "0xCB0F6A32FD527F6C0001000056603DD9"
["serialNumberHex"]=>
string(32) "CB0F6A32FD527F6C0001000056603DD9"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77411&edit=1