Skip to content

Commit 0a530d7

Browse files
committed
Adjust some tests for whitespace differences in OpenSSL 3
A trailing newline is no longer present in OpenSSL 3.
1 parent 3ea57cf commit 0a530d7

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

ext/openssl/tests/bug28382.phpt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ openssl
77
$cert = file_get_contents(__DIR__ . "/bug28382cert.txt");
88
$ext = openssl_x509_parse($cert);
99
var_dump($ext['extensions']);
10-
/* openssl 1.0 prepends the string "Full Name:" to the crlDistributionPoints array key.
11-
For now, as this is the one difference only between 0.9.x and 1.x, it's handled with
12-
placeholders to not to duplicate the test. When more diffs come, a duplication would
13-
be probably a better solution.
14-
*/
10+
/*
11+
* The reason for %A at the end of crlDistributionPoints and authorityKeyIdentifier is that
12+
* OpenSSL 3.0 removes new lines which were present in previous versions.
13+
*/
1514
?>
1615
--EXPECTF--
1716
array(11) {
@@ -22,18 +21,16 @@ array(11) {
2221
["nsCertType"]=>
2322
string(30) "SSL Client, SSL Server, S/MIME"
2423
["crlDistributionPoints"]=>
25-
string(%d) "%AURI:http://mobile.blue-software.ro:90/ca/crl.shtml
26-
"
24+
string(%d) "%AURI:http://mobile.blue-software.ro:90/ca/crl.shtml%A"
2725
["nsCaPolicyUrl"]=>
2826
string(38) "http://mobile.blue-software.ro:90/pub/"
2927
["subjectAltName"]=>
3028
string(28) "email:[email protected]"
3129
["subjectKeyIdentifier"]=>
3230
string(59) "B0:A7:FF:F9:41:15:DE:23:39:BD:DD:31:0F:97:A0:B2:A2:74:E0:FC"
3331
["authorityKeyIdentifier"]=>
34-
string(115) "DirName:/C=RO/ST=Romania/L=Craiova/O=Sergiu/OU=Sergiu SRL/CN=Sergiu CA/[email protected]
35-
serial:00
36-
"
32+
string(%d) "DirName:/C=RO/ST=Romania/L=Craiova/O=Sergiu/OU=Sergiu SRL/CN=Sergiu CA/[email protected]
33+
serial:00%A"
3734
["keyUsage"]=>
3835
string(71) "Digital Signature, Non Repudiation, Key Encipherment, Data Encipherment"
3936
["nsBaseUrl"]=>

ext/openssl/tests/cve2013_4073.phpt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ $info = openssl_x509_parse($cert);
99
var_export($info['extensions']);
1010

1111
?>
12-
--EXPECT--
12+
--EXPECTF--
1313
array (
1414
'basicConstraints' => 'CA:FALSE',
1515
'subjectKeyIdentifier' => '88:5A:55:C0:52:FF:61:CD:52:A3:35:0F:EA:5A:9C:24:38:22:F7:5C',
1616
'keyUsage' => 'Digital Signature, Non Repudiation, Key Encipherment',
17-
'subjectAltName' => 'DNS:altnull.python.org' . "\0" . 'example.com, email:[email protected]' . "\0" . '[email protected], 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
18-
',
17+
'subjectAltName' => 'DNS:altnull.python.org' . "\0" . 'example.com, email:[email protected]' . "\0" . '[email protected], 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%A',
1918
)

ext/openssl/tests/openssl_x509_parse_basic.phpt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,9 @@ array(16) {
153153
["subjectKeyIdentifier"]=>
154154
string(59) "DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D"
155155
["authorityKeyIdentifier"]=>
156-
string(202) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
156+
string(%d) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
157157
DirName:/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/[email protected]
158-
serial:AE:C5:56:CC:72:37:50:A2
159-
"
158+
serial:AE:C5:56:CC:72:37:50:A2%A"
160159
["basicConstraints"]=>
161160
string(7) "CA:TRUE"
162161
}
@@ -301,10 +300,9 @@ array(16) {
301300
["subjectKeyIdentifier"]=>
302301
string(59) "DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D"
303302
["authorityKeyIdentifier"]=>
304-
string(202) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
303+
string(%d) "keyid:DB:7E:40:72:BD:5C:35:85:EC:29:29:81:12:E8:62:68:6A:B7:3F:7D
305304
DirName:/C=BR/ST=Rio Grande do Sul/L=Porto Alegre/CN=Henrique do N. Angelo/[email protected]
306-
serial:AE:C5:56:CC:72:37:50:A2
307-
"
305+
serial:AE:C5:56:CC:72:37:50:A2%A"
308306
["basicConstraints"]=>
309307
string(7) "CA:TRUE"
310308
}

0 commit comments

Comments
 (0)