Req #67403 [Csd]: Add signatureType to openssl_x509_parse

From: Date: Thu, 05 Mar 2015 17:30:27 +0000
Subject: Req #67403 [Csd]: Add signatureType to openssl_x509_parse
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191194@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67403&edit=1

 ID:                 67403
 Updated by:         rdlowrey@php.net
 Reported by:        mark at zedwood dot com
 Summary:            Add signatureType to openssl_x509_parse
 Status:             Closed
 Type:               Feature/Change Request
 Package:            OpenSSL related
 Operating System:   Ubuntu 14.04
 PHP Version:        5.5.13
 Assigned To:        rdlowrey
 Block user comment: N
 Private report:     N

 New Comment:

5.5, 5.6 and master branches have been updated to add the following keys:

"signatureTypeSN" (short name)
"signatureTypeLN" (long name)
"signatureTypeNID" (nid)


Previous Comments:
------------------------------------------------------------------------
[2015-03-05 17:28:29] rdlowrey@php.net

Automatic comment on behalf of rdlowrey
Revision: http://git.php.net/?p=php-src.git;a=commit;h=94140afa69e334405688d3cb09a47c07aeaef825
Log: Fix bug #67403 (Add signatureType to openssl_x509_parse)

------------------------------------------------------------------------
[2015-03-05 17:28:13] rdlowrey@php.net

Automatic comment on behalf of rdlowrey
Revision: http://git.php.net/?p=php-src.git;a=commit;h=94140afa69e334405688d3cb09a47c07aeaef825
Log: Fix bug #67403 (Add signatureType to openssl_x509_parse)

------------------------------------------------------------------------
[2015-03-05 17:27:49] rdlowrey@php.net

Automatic comment on behalf of rdlowrey
Revision: http://git.php.net/?p=php-src.git;a=commit;h=94140afa69e334405688d3cb09a47c07aeaef825
Log: Fix bug #67403 (Add signatureType to openssl_x509_parse)

------------------------------------------------------------------------
[2014-06-10 15:49:33] mark at zedwood dot com

The problem here isn't how to parse the signature in php... there are many asn1 decoders that
allow this.  This issue is, adding this functionality to php-openssl, as it probably should have
been there already.

------------------------------------------------------------------------
[2014-06-10 13:31:41] zelnaga at gmail dot com

FWIW you can get this info with phpseclib, a pure PHP X.509 decoder:

<?php
include('File/X509.php');

$x509 = new File_X509();
$cert = $x509->loadX509('-----BEGIN CERTIFICATE-----
MIIBBzCBrgIJANZXs2GIGRy3MAoGCCqGSM49BAMDMAwxCjAIBgNVBAMMAXgwHhcN
MTQwNjA5MTczMjQ1WhcNMjQwNjA2MTczMjQ1WjAMMQowCAYDVQQDDAF4MFkwEwYH
KoZIzj0CAQYIKoZIzj0DAQcDQgAEK8KP9tJ1bZxLGKqNP9JpOkaq9paKoMS4/0wm
6u62b0mArY7xmS5/Nlkyi/GK21QpjSk4vRwkN+tYPeAy/8Bd2TAKBggqhkjOPQQD
AwNIADBFAiAjVRQZKlKCBzJxJ7aw8qRrZUhBczX9psneshOhI7g4mQIhAPlTbP67
mq9Qf/YphH6gWZXX50TGC2OTOUXRm60Cajs3
-----END CERTIFICATE-----');

echo $cert['signatureAlgorithm']['algorithm'];
?>

That said "sha256WithRSAEncryption" isn't your signature type. sha384ECDSA is. And
the OID that corresponds to that signature type doesn't seem to be recognized by OpenSSL. At
least not the version I'm using. When I try it with OpenSSL (or phpseclib) I just get the OID:
1.2.840.10045.4.3.3

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


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

    https://bugs.php.net/bug.php?id=67403


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


Thread (6 messages)

« previous php.bugs (#191194) next »