Annotation of embedaddon/php/ext/openssl/tests/bug64802.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Bug #64802: openssl_x509_parse fails to parse subject properly in some cases
3: --SKIPIF--
4: <?php
5: if (!extension_loaded("openssl")) die("skip");
1.1.1.2 ! misho 6: if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
1.1 misho 7: ?>
8: --FILE--
9: <?php
10: $cert = file_get_contents(__DIR__.'/bug64802.pem');
11: $r = openssl_x509_parse($cert,$use_short_names=true);
12: sort($r['subject']);
13: var_dump( $r['subject'] );
14: ?>
15: --EXPECTF--
16: array(11) {
17: [0]=>
18: string(14) "1550 Bryant st"
19: [1]=>
20: string(5) "94103"
21: [2]=>
22: string(7) "4586007"
23: [3]=>
24: string(2) "CA"
25: [4]=>
26: string(26) "COMODO EV Multi-Domain SSL"
27: [5]=>
28: string(20) "Private Organization"
29: [6]=>
30: string(10) "Rdio, Inc."
31: [7]=>
32: string(13) "San Francisco"
33: [8]=>
34: string(2) "US"
35: [9]=>
36: array(2) {
37: [0]=>
38: string(2) "US"
39: [1]=>
40: string(8) "Delaware"
41: }
42: [10]=>
43: array(6) {
44: [0]=>
45: string(9) "www.rd.io"
46: [1]=>
47: string(8) "rdio.com"
48: [2]=>
49: string(5) "rd.io"
50: [3]=>
51: string(12) "api.rdio.com"
52: [4]=>
53: string(9) "api.rd.io"
54: [5]=>
55: string(12) "www.rdio.com"
56: }
57: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>