summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/bug64802.phpt
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2013-10-27 20:38:12 +0100
committerOndřej Surý <ondrej@sury.org>2013-10-27 20:38:12 +0100
commit749e5ad39dbac3f4f62be438367f8cdf90056815 (patch)
treead0677df3bf44a6761380686e400ffd878585288 /ext/openssl/tests/bug64802.phpt
parent4ed39205864f58ba7c368e4ae1362d8214469fd9 (diff)
downloadphp-upstream/5.4.21.tar.gz
New upstream version 5.4.21upstream/5.4.21
Diffstat (limited to 'ext/openssl/tests/bug64802.phpt')
-rw-r--r--ext/openssl/tests/bug64802.phpt56
1 files changed, 56 insertions, 0 deletions
diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt
new file mode 100644
index 000000000..9a5970149
--- /dev/null
+++ b/ext/openssl/tests/bug64802.phpt
@@ -0,0 +1,56 @@
+--TEST--
+Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+?>
+--FILE--
+<?php
+$cert = file_get_contents(__DIR__.'/bug64802.pem');
+$r = openssl_x509_parse($cert,$use_short_names=true);
+sort($r['subject']);
+var_dump( $r['subject'] );
+?>
+--EXPECTF--
+array(11) {
+ [0]=>
+ string(14) "1550 Bryant st"
+ [1]=>
+ string(5) "94103"
+ [2]=>
+ string(7) "4586007"
+ [3]=>
+ string(2) "CA"
+ [4]=>
+ string(26) "COMODO EV Multi-Domain SSL"
+ [5]=>
+ string(20) "Private Organization"
+ [6]=>
+ string(10) "Rdio, Inc."
+ [7]=>
+ string(13) "San Francisco"
+ [8]=>
+ string(2) "US"
+ [9]=>
+ array(2) {
+ [0]=>
+ string(2) "US"
+ [1]=>
+ string(8) "Delaware"
+ }
+ [10]=>
+ array(6) {
+ [0]=>
+ string(9) "www.rd.io"
+ [1]=>
+ string(8) "rdio.com"
+ [2]=>
+ string(5) "rd.io"
+ [3]=>
+ string(12) "api.rdio.com"
+ [4]=>
+ string(9) "api.rd.io"
+ [5]=>
+ string(12) "www.rdio.com"
+ }
+}