mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-08-09 15:33:58 +08:00
Add PHP Extension for GmSSL
View http://gmssl.org/docs/php-api.html for more info.
This commit is contained in:
19
php/ext/openssl/tests/cve2013_4073.phpt
Normal file
19
php/ext/openssl/tests/cve2013_4073.phpt
Normal file
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
CVE 2013-4073: Null-byte certificate handling
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded("openssl")) die("skip");
|
||||
--FILE--
|
||||
<?php
|
||||
$cert = file_get_contents(__DIR__ . '/cve2013_4073.pem');
|
||||
$info = openssl_x509_parse($cert);
|
||||
var_export($info['extensions']);
|
||||
|
||||
--EXPECTF--
|
||||
array (
|
||||
'basicConstraints' => 'CA:FALSE',
|
||||
'subjectKeyIdentifier' => '88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C',
|
||||
'keyUsage' => 'Digital Signature, Non Repudiation, Key Encipherment',
|
||||
'subjectAltName' => 'DNS:altnull.python.org' . "\0" . 'example.com, email:null@python.org' . "\0" . 'user@example.org, URI:http://null.python.org' . "\0" . 'http://example.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
|
||||
',
|
||||
)
|
||||
Reference in New Issue
Block a user