From 3c42f64e6e83d0465e6cbfcdf24931112301f5e9 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 21 Jun 2018 16:38:19 +0100 Subject: [PATCH] Make code in openssl ext tests more consistent Mainly use spaces for indent and fix some other CS issues. Also drop checks for unsupported OpenSSL library versions. --- ext/openssl/tests/001.phpt | 41 ++-- ext/openssl/tests/bug28382.phpt | 3 +- ext/openssl/tests/bug36732.phpt | 21 +- ext/openssl/tests/bug37820.phpt | 8 +- ext/openssl/tests/bug38255.phpt | 6 +- ext/openssl/tests/bug38261.phpt | 6 +- ext/openssl/tests/bug39217.phpt | 6 +- ext/openssl/tests/bug41033.phpt | 1 - ext/openssl/tests/bug46127.phpt | 3 +- ext/openssl/tests/bug48182.phpt | 3 +- ext/openssl/tests/bug54992.phpt | 2 + ext/openssl/tests/bug55259.phpt | 12 +- ext/openssl/tests/bug55646.phpt | 46 ++-- ext/openssl/tests/bug61124.phpt | 15 +- ext/openssl/tests/bug61930.phpt | 4 +- ext/openssl/tests/bug65538_001.phpt | 2 + ext/openssl/tests/bug65538_002.phpt | 12 +- ext/openssl/tests/bug65538_003.phpt | 2 + ext/openssl/tests/bug65698.phpt | 4 +- ext/openssl/tests/bug65729.phpt | 2 + ext/openssl/tests/bug66501.phpt | 2 + ext/openssl/tests/bug67403.phpt | 4 +- ext/openssl/tests/bug68265.phpt | 2 + ext/openssl/tests/bug68879.phpt | 2 + ext/openssl/tests/bug68920.phpt | 2 + ext/openssl/tests/bug69215.phpt | 2 + ext/openssl/tests/bug70438.phpt | 6 +- ext/openssl/tests/bug71917.phpt | 16 +- ext/openssl/tests/bug72333.phpt | 92 ++++---- ext/openssl/tests/bug72336.phpt | 16 +- ext/openssl/tests/bug72362.phpt | 22 +- ext/openssl/tests/bug73072.phpt | 37 ++-- ext/openssl/tests/bug73478.phpt | 10 +- ext/openssl/tests/bug73833.phpt | 22 +- ext/openssl/tests/bug74022_2.phpt | 6 +- ext/openssl/tests/bug74159.phpt | 107 +++++----- ext/openssl/tests/bug74402.phpt | 8 +- ext/openssl/tests/bug74720_1.phpt | 4 +- ext/openssl/tests/bug74798.phpt | 4 +- ext/openssl/tests/bug76296.phpt | 2 +- ext/openssl/tests/capture_peer_cert_001.phpt | 2 + .../tests/check_default_conf_path.phpt | 2 +- ext/openssl/tests/cipher_tests.inc | 202 +++++++++--------- ext/openssl/tests/cve-2013-6420.phpt | 4 +- ext/openssl/tests/cve2013_4073.phpt | 5 +- ext/openssl/tests/ecc.phpt | 24 +-- .../tests/openssl_csr_export_bacis.phpt | 20 +- .../openssl_csr_export_to_file_basic.phpt | 30 +-- .../openssl_csr_get_public_key_basic.phpt | 26 +-- .../tests/openssl_csr_get_subject_basic.phpt | 26 +-- ext/openssl/tests/openssl_csr_sign_basic.phpt | 24 +-- ext/openssl/tests/openssl_decrypt_ccm.phpt | 8 +- ext/openssl/tests/openssl_decrypt_gcm.phpt | 8 +- ext/openssl/tests/openssl_encrypt_ccm.phpt | 14 +- ext/openssl/tests/openssl_encrypt_gcm.phpt | 10 +- .../tests/openssl_error_string_basic.phpt | 54 ++--- .../tests/openssl_peer_fingerprint_basic.phpt | 2 + .../tests/openssl_pkcs7_decrypt_basic.phpt | 14 +- .../tests/openssl_pkcs7_decrypt_error.phpt | 2 +- .../tests/openssl_pkcs7_encrypt_basic.phpt | 12 +- .../tests/openssl_pkcs7_sign_basic.phpt | 6 +- ext/openssl/tests/openssl_pkey_new_basic.phpt | 64 +++--- .../tests/openssl_private_encrypt_basic.phpt | 6 +- .../tests/openssl_public_encrypt_basic.phpt | 6 +- .../openssl_random_pseudo_bytes_basic.phpt | 2 +- .../tests/openssl_spki_export_basic.phpt | 38 ++-- .../openssl_spki_export_challenge_basic.phpt | 40 ++-- ext/openssl/tests/openssl_spki_new_basic.phpt | 36 ++-- .../tests/openssl_spki_verify_basic.phpt | 36 ++-- .../tests/openssl_x509_export_basic.phpt | 2 +- .../openssl_x509_export_to_file_basic.phpt | 2 +- .../tests/openssl_x509_fingerprint_basic.phpt | 4 +- .../tests/openssl_x509_parse_basic.phpt | 4 +- ext/openssl/tests/peer_verification.phpt | 2 + ext/openssl/tests/san_peer_matching.phpt | 2 + ext/openssl/tests/session_meta_capture.phpt | 3 +- ext/openssl/tests/sni_server.phpt | 3 + .../tests/stream_crypto_flags_001.phpt | 2 + .../tests/stream_crypto_flags_002.phpt | 3 +- .../tests/stream_crypto_flags_004.phpt | 2 + .../tests/stream_server_reneg_limit.phpt | 3 +- .../tests/stream_verify_peer_name_001.phpt | 2 + .../tests/stream_verify_peer_name_002.phpt | 2 + .../tests/stream_verify_peer_name_003.phpt | 2 + ext/openssl/tests/streams_crypto_method.phpt | 3 +- ext/openssl/tests/tlsv1.0_wrapper.phpt | 2 + ext/openssl/tests/tlsv1.1_wrapper.phpt | 3 +- ext/openssl/tests/tlsv1.2_wrapper.phpt | 3 +- 88 files changed, 708 insertions(+), 629 deletions(-) diff --git a/ext/openssl/tests/001.phpt b/ext/openssl/tests/001.phpt index 9bcb3d890e..7f5af24ae6 100644 --- a/ext/openssl/tests/001.phpt +++ b/ext/openssl/tests/001.phpt @@ -9,28 +9,33 @@ if (!@openssl_pkey_new()) die("skip cannot create private key"); dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf'); +$conf = array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'); $privkey = openssl_pkey_new($conf); -if ($privkey === false) - die("failed to create private key"); +if ($privkey === false) { + die("failed to create private key"); +} $passphrase = "banana"; -$key_file_name = tempnam(sys_get_temp_dir(), "ssl"); -if ($key_file_name === false) - die("failed to get a temporary filename!"); +$key_file_name = __DIR__ . '/001-tmp.key'; +if ($key_file_name === false) { + die("failed to get a temporary filename!"); +} echo "Export key to file\n"; -openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to export to file $key_file_name"); +if (!openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf)) { + die("failed to export to file $key_file_name"); +} var_dump(is_resource($privkey)); echo "Load key from file - array syntax\n"; $loaded_key = openssl_pkey_get_private(array("file://$key_file_name", $passphrase)); -if ($loaded_key === false) - die("failed to load key using array syntax"); +if ($loaded_key === false) { + die("failed to load key using array syntax"); +} openssl_pkey_free($loaded_key); @@ -38,8 +43,9 @@ echo "Load key using direct syntax\n"; $loaded_key = openssl_pkey_get_private("file://$key_file_name", $passphrase); -if ($loaded_key === false) - die("failed to load key using direct syntax"); +if ($loaded_key === false) { + die("failed to load key using direct syntax"); +} openssl_pkey_free($loaded_key); @@ -48,15 +54,13 @@ echo "Load key manually and use string syntax\n"; $key_content = file_get_contents($key_file_name); $loaded_key = openssl_pkey_get_private($key_content, $passphrase); -if ($loaded_key === false) - die("failed to load key using string syntax"); - +if ($loaded_key === false) { + die("failed to load key using string syntax"); +} openssl_pkey_free($loaded_key); echo "OK!\n"; -@unlink($key_file_name); - ?> --EXPECT-- Creating private key @@ -66,3 +70,8 @@ Load key from file - array syntax Load key using direct syntax Load key manually and use string syntax OK! +--CLEAN-- + \ No newline at end of file diff --git a/ext/openssl/tests/bug28382.phpt b/ext/openssl/tests/bug28382.phpt index 2bedeb2d67..c3888e962b 100644 --- a/ext/openssl/tests/bug28382.phpt +++ b/ext/openssl/tests/bug28382.phpt @@ -2,8 +2,7 @@ Bug #28382 (openssl_x509_parse extensions support) --SKIPIF-- --FILE-- --FILE-- "v3_req", - "x509_extensions" => "usr_cert", - "config" => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf", + "req_extensions" => "v3_req", + "x509_extensions" => "usr_cert", + "config" => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf", ); $dn = array( - "countryName" => "GB", - "stateOrProvinceName" => "Berkshire", - "localityName" => "Newbury", - "organizationName" => "My Company Ltd", - "commonName" => "Demo Cert" + "countryName" => "GB", + "stateOrProvinceName" => "Berkshire", + "localityName" => "Newbury", + "organizationName" => "My Company Ltd", + "commonName" => "Demo Cert" ); $key = openssl_pkey_new(); @@ -29,11 +28,11 @@ $str = ''; openssl_csr_export($csr, $str, false); if (strpos($str, 'Requested Extensions:')) { - echo "Ok\n"; + echo "Ok\n"; } openssl_x509_export($crt, $str, false); if (strpos($str, 'X509v3 extensions:')) { - echo "Ok\n"; + echo "Ok\n"; } ?> --EXPECTF-- diff --git a/ext/openssl/tests/bug37820.phpt b/ext/openssl/tests/bug37820.phpt index 2eef8c5bdc..994f9e412c 100644 --- a/ext/openssl/tests/bug37820.phpt +++ b/ext/openssl/tests/bug37820.phpt @@ -3,7 +3,6 @@ openssl_sign/verify: accept different algos --SKIPIF-- --FILE-- --EXPECTF-- diff --git a/ext/openssl/tests/bug41033.phpt b/ext/openssl/tests/bug41033.phpt index 4e9bea3e3e..f52a4c7d27 100644 --- a/ext/openssl/tests/bug41033.phpt +++ b/ext/openssl/tests/bug41033.phpt @@ -3,7 +3,6 @@ --SKIPIF-- --FILE-- --FILE-- run($clientCode, $serverCode); +?> --EXPECT-- Sending bug 46127 diff --git a/ext/openssl/tests/bug48182.phpt b/ext/openssl/tests/bug48182.phpt index 5211c23d20..d11cddf273 100644 --- a/ext/openssl/tests/bug48182.phpt +++ b/ext/openssl/tests/bug48182.phpt @@ -4,7 +4,7 @@ Bug #48182: ssl handshake fails during asynchronous socket connection --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Running bug48182 Sending bug48182 diff --git a/ext/openssl/tests/bug54992.phpt b/ext/openssl/tests/bug54992.phpt index 878cb4a872..01369dca00 100644 --- a/ext/openssl/tests/bug54992.phpt +++ b/ext/openssl/tests/bug54992.phpt @@ -4,6 +4,7 @@ Bug #54992: Stream not closed and error not returned when SSL CN_match fails --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Warning: stream_socket_client(): Peer certificate CN=`bug54992.local' did not match expected CN=`buga_buga' in %s on line %d diff --git a/ext/openssl/tests/bug55259.phpt b/ext/openssl/tests/bug55259.phpt index b58d28ad73..88e5a17ce4 100644 --- a/ext/openssl/tests/bug55259.phpt +++ b/ext/openssl/tests/bug55259.phpt @@ -6,13 +6,13 @@ Bug #55259 (openssl extension does not get the DH parameters from DH key resourc $phex, 'g' => '2' ); -$dh = openssl_pkey_new(array( 'dh'=> array( 'p' => $phex, 'g' => '2' ))); + 'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' . + '7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' . + '6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab'; +$dh_details = array('p' => $phex, 'g' => '2'); +$dh = openssl_pkey_new(array('dh'=> array('p' => $phex, 'g' => '2'))); var_dump($dh); -$dh = openssl_pkey_new(array( 'dh'=> array( 'p' => hex2bin($phex), 'g' => '2' ))); +$dh = openssl_pkey_new(array('dh'=> array( 'p' => hex2bin($phex), 'g' => '2'))); $details = openssl_pkey_get_details($dh); var_dump(bin2hex($details['dh']['p'])); var_dump($details['dh']['g']); diff --git a/ext/openssl/tests/bug55646.phpt b/ext/openssl/tests/bug55646.phpt index 6c504588c8..a7e4152779 100644 --- a/ext/openssl/tests/bug55646.phpt +++ b/ext/openssl/tests/bug55646.phpt @@ -1,28 +1,43 @@ --TEST-- Bug #55646: textual input in openssl_csr_new() is not expected in UTF-8 --SKIPIF-- - --FILE-- "sha1","x509_extensions" => "v3_ca","req_extensions" => "v3_req","private_key_bits" => 2048,"private_key_type" => OPENSSL_KEYTYPE_RSA,"encrypt_key" => false,); +function stringAsHex($string) { + $unpacked = unpack("H*", $string); + return implode(" ", str_split($unpacked[1],2)); +} + +$config = array( + "digest_alg" => "sha1", + "x509_extensions" => "v3_ca", + "req_extensions" => "v3_req", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_RSA, + "encrypt_key" => false, +); $csr_info = array( - "countryName" => "US", - "stateOrProvinceName" => "Utah", - "localityName" => "Lindon", - "organizationName" => "Chinese", - "organizationalUnitName" => "IT \xe4\xba\x92", - "commonName" => "www.example.com",); + "countryName" => "US", + "stateOrProvinceName" => "Utah", + "localityName" => "Lindon", + "organizationName" => "Chinese", + "organizationalUnitName" => "IT \xe4\xba\x92", + "commonName" => "www.example.com", +); $private = openssl_pkey_new($config); while (openssl_error_string()) {} -$csr_res = openssl_csr_new($csr_info, $private, - ['config' => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf"]); +$csr_res = openssl_csr_new( + $csr_info, + $private, + ['config' => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf"] +); if (!$csr_res) { - while ($e = openssl_error_string()) { $err = $e; } - die("Failed; last error: $err"); + while ($e = openssl_error_string()) { + $err = $e; + } + die("Failed; last error: $err"); } openssl_csr_export($csr_res, $csr); $output = openssl_csr_get_subject($csr); @@ -31,6 +46,7 @@ echo "A: ".$csr_info["organizationalUnitName"]."\n"; echo "B: ".stringAsHex($csr_info["organizationalUnitName"])."\n"; echo "C: ".$output['OU']."\n"; echo "D: ".stringAsHex($output['OU'])."\n"; +?> --EXPECT-- A: IT 互 B: 49 54 20 e4 ba 92 diff --git a/ext/openssl/tests/bug61124.phpt b/ext/openssl/tests/bug61124.phpt index 9b21da5048..1f2b073d3e 100644 --- a/ext/openssl/tests/bug61124.phpt +++ b/ext/openssl/tests/bug61124.phpt @@ -1,12 +1,19 @@ --TEST-- Bug #61124: Segmentation fault with openssl_decrypt --SKIPIF-- - --FILE-- --EXPECTF-- Warning: openssl_decrypt(): IV passed is only 4 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in %s on line %d bool(false) diff --git a/ext/openssl/tests/bug61930.phpt b/ext/openssl/tests/bug61930.phpt index 55dc42fded..6d8742b80d 100644 --- a/ext/openssl/tests/bug61930.phpt +++ b/ext/openssl/tests/bug61930.phpt @@ -12,7 +12,9 @@ $data = <<run($clientCode, $serverCode); +?> --EXPECT-- string(12) "Hello World!" diff --git a/ext/openssl/tests/bug65538_002.phpt b/ext/openssl/tests/bug65538_002.phpt index 21a23a2678..7dddb12564 100644 --- a/ext/openssl/tests/bug65538_002.phpt +++ b/ext/openssl/tests/bug65538_002.phpt @@ -8,12 +8,12 @@ if (getenv("SKIP_ONLINE_TESTS")) die("skip online test"); --FILE-- [ - // We don't get any ca list from php.net but it does not matter as we - // care about the fact that the external stream is not allowed. - // We can't use http://curl.haxx.se/ca/cacert.pem for this test - // as it is redirected to https which means the test would depend - // on system cafile when opening stream. - 'cafile' => 'http://www.php.net', + // We don't get any ca list from php.net but it does not matter as we + // care about the fact that the external stream is not allowed. + // We can't use http://curl.haxx.se/ca/cacert.pem for this test + // as it is redirected to https which means the test would depend + // on system cafile when opening stream. + 'cafile' => 'http://www.php.net', ]]); file_get_contents('https://github.com', false, $clientCtx); ?> diff --git a/ext/openssl/tests/bug65538_003.phpt b/ext/openssl/tests/bug65538_003.phpt index da99779143..042e7d08bc 100644 --- a/ext/openssl/tests/bug65538_003.phpt +++ b/ext/openssl/tests/bug65538_003.phpt @@ -5,6 +5,7 @@ Bug #65538: SSL context "cafile" supports phar wrapper if (!extension_loaded("openssl")) die("skip openssl not loaded"); if (!extension_loaded("phar")) die("skip phar not loaded"); if (!function_exists("proc_open")) die("skip no proc_open"); +?> --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- string(12) "Hello World!" diff --git a/ext/openssl/tests/bug65698.phpt b/ext/openssl/tests/bug65698.phpt index 5b693421fe..ba1efc739c 100644 --- a/ext/openssl/tests/bug65698.phpt +++ b/ext/openssl/tests/bug65698.phpt @@ -1,9 +1,7 @@ --TEST-- Bug #65689 (GeneralizedTime format parsing) --SKIPIF-- - + --FILE-- --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Warning: stream_socket_client(): Peer certificate CN=`*.test.com' did not match expected CN=`foo.test.com.sg' in %s on line %d diff --git a/ext/openssl/tests/bug66501.phpt b/ext/openssl/tests/bug66501.phpt index 99ac4f55de..d6894089a0 100644 --- a/ext/openssl/tests/bug66501.phpt +++ b/ext/openssl/tests/bug66501.phpt @@ -4,6 +4,7 @@ Bug #66501: EC private key support in openssl_sign --FILE-- --EXPECTF-- bool(true) diff --git a/ext/openssl/tests/bug67403.phpt b/ext/openssl/tests/bug67403.phpt index 0a19686af1..76c5c8613c 100644 --- a/ext/openssl/tests/bug67403.phpt +++ b/ext/openssl/tests/bug67403.phpt @@ -1,8 +1,7 @@ --TEST-- Bug #67403: Add signatureType to openssl_x509_parse --SKIPIF-- - --FILE-- --EXPECTF-- string(8) "RSA-SHA1" string(21) "sha1WithRSAEncryption" diff --git a/ext/openssl/tests/bug68265.phpt b/ext/openssl/tests/bug68265.phpt index aff9a9e511..f2c867670a 100644 --- a/ext/openssl/tests/bug68265.phpt +++ b/ext/openssl/tests/bug68265.phpt @@ -4,6 +4,7 @@ Bug #68265: SAN match fails with trailing DNS dot --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/bug68879.phpt b/ext/openssl/tests/bug68879.phpt index 2982d00c36..8cf9044c93 100644 --- a/ext/openssl/tests/bug68879.phpt +++ b/ext/openssl/tests/bug68879.phpt @@ -4,6 +4,7 @@ Bug #68879: Match IP address fields in subjectAltName checks --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/bug68920.phpt b/ext/openssl/tests/bug68920.phpt index 52a103f641..4c6271819b 100644 --- a/ext/openssl/tests/bug68920.phpt +++ b/ext/openssl/tests/bug68920.phpt @@ -4,6 +4,7 @@ Bug #68920: peer_fingerprint input checks should be strict --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Warning: stream_socket_client(): Expected peer fingerprint must be a string or an array in %s on line %d diff --git a/ext/openssl/tests/bug69215.phpt b/ext/openssl/tests/bug69215.phpt index 2e2fe9222b..ab9eec6770 100644 --- a/ext/openssl/tests/bug69215.phpt +++ b/ext/openssl/tests/bug69215.phpt @@ -4,6 +4,7 @@ Bug #69215: Crypto servers should send client CA list --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/bug70438.phpt b/ext/openssl/tests/bug70438.phpt index 937e9f3bd9..e25c37168b 100644 --- a/ext/openssl/tests/bug70438.phpt +++ b/ext/openssl/tests/bug70438.phpt @@ -2,11 +2,9 @@ Request #70438: Add IV parameter for openssl_seal and openssl_open --SKIPIF-- --FILE-- diff --git a/ext/openssl/tests/bug71917.phpt b/ext/openssl/tests/bug71917.phpt index d4415b3e32..c7f91dbb55 100644 --- a/ext/openssl/tests/bug71917.phpt +++ b/ext/openssl/tests/bug71917.phpt @@ -7,12 +7,16 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded"); --FILE-- ['local_cert' => __DIR__ . '/bug54992.pem']]); + $context = stream_context_create(['ssl' => ['local_cert' => __DIR__ . '/bug54992.pem']]); - $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; - $fp = stream_socket_server("ssl://127.0.0.1:10011", $errornum, $errorstr, $flags, $context); - phpt_notify(); - $conn = stream_socket_accept($fp); - $total = 100000; - $result = fread($conn, $total); - stream_set_blocking($conn, false); - usleep(50000); - $read = [$conn]; - while (stream_select($read, $write, $except, 1)) { - $result = fread($conn, 100000); - if (!$result) { - break; - } - $total += strlen($result); - if ($total >= 4000000) { - break; - } - } - phpt_wait(); + $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; + $fp = stream_socket_server("ssl://127.0.0.1:10011", $errornum, $errorstr, $flags, $context); + phpt_notify(); + $conn = stream_socket_accept($fp); + $total = 100000; + $result = fread($conn, $total); + stream_set_blocking($conn, false); + usleep(50000); + $read = [$conn]; + while (stream_select($read, $write, $except, 1)) { + $result = fread($conn, 100000); + if (!$result) { + break; + } + $total += strlen($result); + if ($total >= 4000000) { + break; + } + } + phpt_wait(); CODE; $clientCode = <<<'CODE' - $context = stream_context_create(['ssl' => ['verify_peer' => false, 'peer_name' => 'bug54992.local']]); - - phpt_wait(); - $fp = stream_socket_client("ssl://127.0.0.1:10011", $errornum, $errorstr, 3000, STREAM_CLIENT_CONNECT, $context); - stream_set_blocking($fp, false); - - function blocking_fwrite($fp, $buf) { - $write = [$fp]; - $total = 0; - while (stream_select($read, $write, $except, 1)) { - $result = fwrite($fp, $buf); - if (!$result) { - break; - } - $total += $result; - if ($total >= strlen($buf)) { - return $total; - } - $buf = substr($buf, $total); - } - } - $str1 = str_repeat("a", 4000000); - blocking_fwrite($fp, $str1); - phpt_notify(); - echo "done"; + $context = stream_context_create(['ssl' => ['verify_peer' => false, 'peer_name' => 'bug54992.local']]); + + phpt_wait(); + $fp = stream_socket_client("ssl://127.0.0.1:10011", $errornum, $errorstr, 3000, STREAM_CLIENT_CONNECT, $context); + stream_set_blocking($fp, false); + + function blocking_fwrite($fp, $buf) { + $write = [$fp]; + $total = 0; + while (stream_select($read, $write, $except, 1)) { + $result = fwrite($fp, $buf); + if (!$result) { + break; + } + $total += $result; + if ($total >= strlen($buf)) { + return $total; + } + $buf = substr($buf, $total); + } + } + $str1 = str_repeat("a", 4000000); + blocking_fwrite($fp, $str1); + phpt_notify(); + echo "done"; CODE; include 'ServerClientTestCase.inc'; diff --git a/ext/openssl/tests/bug72336.phpt b/ext/openssl/tests/bug72336.phpt index 893b51838d..1defd21dfc 100644 --- a/ext/openssl/tests/bug72336.phpt +++ b/ext/openssl/tests/bug72336.phpt @@ -5,18 +5,18 @@ Bug #72336 (openssl_pkey_new does not fail for invalid DSA params) --FILE-- array('p' => $p, 'q' => $q, 'g' => $g)))); ?> diff --git a/ext/openssl/tests/bug72362.phpt b/ext/openssl/tests/bug72362.phpt index 40acdbed0c..cd6ec1e838 100644 --- a/ext/openssl/tests/bug72362.phpt +++ b/ext/openssl/tests/bug72362.phpt @@ -6,8 +6,26 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded"); ?> --FILE-- --EXPECT-- string(48) "e3214d1b16e574828c8a3e222202dde81afd1ad2cb165ab3" diff --git a/ext/openssl/tests/bug73072.phpt b/ext/openssl/tests/bug73072.phpt index cc352233e1..8f001829f2 100644 --- a/ext/openssl/tests/bug73072.phpt +++ b/ext/openssl/tests/bug73072.phpt @@ -3,39 +3,40 @@ Bug #73072: Invalid path SNI_server_certs causes segfault --SKIPIF-- --FILE-- [ - 'local_cert' => __DIR__ . '/domain1.pem', - 'SNI_server_certs' => [ - "domain1.com" => __DIR__ . "/sni_server_domain1.pem", - "domain2.com" => __DIR__ . "/not_existing.pem", - ] - ]]); - + $ctx = stream_context_create(['ssl' => [ + 'local_cert' => __DIR__ . '/domain1.pem', + 'SNI_server_certs' => [ + "domain1.com" => __DIR__ . "/sni_server_domain1.pem", + "domain2.com" => __DIR__ . "/not_existing.pem", + ] + ]]); + $server = stream_socket_server('tls://127.0.0.1:64322', $errno, $errstr, $flags, $ctx); - + phpt_notify(); - @stream_socket_accept($server, 3); - // if there is a segfault, this won't be called - fwrite(STDERR, "done\n"); + @stream_socket_accept($server, 3); + // if there is a segfault, this won't be called + fwrite(STDERR, "done\n"); CODE; $clientCode = <<<'CODE' $flags = STREAM_CLIENT_CONNECT; - $ctxArr = [ - 'cafile' => __DIR__ . '/sni_server_ca.pem', - 'capture_peer_cert' => true - ]; + $ctxArr = [ + 'cafile' => __DIR__ . '/sni_server_ca.pem', + 'capture_peer_cert' => true + ]; phpt_wait(); $ctxArr['peer_name'] = 'domain1.com'; - $ctx = stream_context_create(['ssl' => $ctxArr]); - @stream_socket_client("tls://127.0.0.1:64322", $errno, $errstr, 1, $flags, $ctx); + $ctx = stream_context_create(['ssl' => $ctxArr]); + @stream_socket_client("tls://127.0.0.1:64322", $errno, $errstr, 1, $flags, $ctx); CODE; include 'ServerClientTestCase.inc'; diff --git a/ext/openssl/tests/bug73478.phpt b/ext/openssl/tests/bug73478.phpt index 1dfc584164..61f0faa057 100644 --- a/ext/openssl/tests/bug73478.phpt +++ b/ext/openssl/tests/bug73478.phpt @@ -1,15 +1,13 @@ --TEST-- Bug #73478: openssl_pkey_new() generates wrong pub/priv keys with Diffie Hellman --SKIPIF-- - + --FILE-- base64_decode('3Pk6C4g5cuwOGZiaxaLOMQ4dN3F+jZVxu3Yjcxhm5h73Wi4niYsFf5iRwuJ6Y5w/KbYIFFgc07LKOYbSaDcFV31FwuflLcgcehcYduXOp0sUSL/frxiCjv0lGfFOReOCZjSvGUnltTXMgppIO4p2Ij5dSQolfwW9/xby+yLFg6s='), - 'g' => base64_decode('Ag=='), - 'priv_key' => base64_decode('jUdcV++P/m7oUodWiqKqKXZVenHRuj92Ig6Fmzs7QlqVdUc5mNBxmEWjug+ObffanPpOeab/LyXwjNMzevtBz3tW4oROau++9EIMJVVQr8fW9zdYBJcYieC5l4t8nRj5/Uu/Z0G2rWVLBleSi28mqqNEvnUs7uxYxrar69lwQYs=') + 'p' => base64_decode('3Pk6C4g5cuwOGZiaxaLOMQ4dN3F+jZVxu3Yjcxhm5h73Wi4niYsFf5iRwuJ6Y5w/KbYIFFgc07LKOYbSaDcFV31FwuflLcgcehcYduXOp0sUSL/frxiCjv0lGfFOReOCZjSvGUnltTXMgppIO4p2Ij5dSQolfwW9/xby+yLFg6s='), + 'g' => base64_decode('Ag=='), + 'priv_key' => base64_decode('jUdcV++P/m7oUodWiqKqKXZVenHRuj92Ig6Fmzs7QlqVdUc5mNBxmEWjug+ObffanPpOeab/LyXwjNMzevtBz3tW4oROau++9EIMJVVQr8fW9zdYBJcYieC5l4t8nRj5/Uu/Z0G2rWVLBleSi28mqqNEvnUs7uxYxrar69lwQYs=') ]; $opensslKeyResource = openssl_pkey_new(['dh' => $details]); diff --git a/ext/openssl/tests/bug73833.phpt b/ext/openssl/tests/bug73833.phpt index 2ea5f9e411..ad4e0874a8 100644 --- a/ext/openssl/tests/bug73833.phpt +++ b/ext/openssl/tests/bug73833.phpt @@ -10,18 +10,18 @@ $passwords = ["abc\x00defghijkl", "abcdefghikjl"]; $conf = ['config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf']; foreach($passwords as $password) { - $key = openssl_pkey_new($conf); + $key = openssl_pkey_new($conf); - if (openssl_pkey_export($key, $privatePEM, $password, $conf) === false) { - echo "Failed to encrypt.\n"; - } else { - echo "Encrypted!\n"; - } - if (openssl_pkey_get_private($privatePEM, $password) === false) { - echo "Failed to decrypt.\n"; - } else { - echo "Decrypted!\n"; - } + if (openssl_pkey_export($key, $privatePEM, $password, $conf) === false) { + echo "Failed to encrypt.\n"; + } else { + echo "Encrypted!\n"; + } + if (openssl_pkey_get_private($privatePEM, $password) === false) { + echo "Failed to decrypt.\n"; + } else { + echo "Decrypted!\n"; + } } ?> --EXPECT-- diff --git a/ext/openssl/tests/bug74022_2.phpt b/ext/openssl/tests/bug74022_2.phpt index 65d0977674..6a7083f328 100644 --- a/ext/openssl/tests/bug74022_2.phpt +++ b/ext/openssl/tests/bug74022_2.phpt @@ -7,9 +7,9 @@ if (!extension_loaded("openssl")) die("skip"); --FILE-- --FILE-- [ - 'local_cert' => __DIR__ . '/bug54992.pem', - 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, - ]]); + $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; + $serverCtx = stream_context_create(['ssl' => [ + 'local_cert' => __DIR__ . '/bug54992.pem', + 'crypto_method' => STREAM_CRYPTO_METHOD_TLSv1_2_SERVER, + ]]); $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx); - phpt_notify(); + phpt_notify(); $client = stream_socket_accept($server, 1); if (!$client) { - exit(); - } + exit(); + } $data = ''; - while (strlen($data) < 0xfffff) { - $buffer = fread($client, 8192); - if (empty($buffer)) { - exit(); - } - $data .= $buffer; - usleep(100); - } + while (strlen($data) < 0xfffff) { + $buffer = fread($client, 8192); + if (empty($buffer)) { + exit(); + } + $data .= $buffer; + usleep(100); + } fclose($client); CODE; $clientCode = <<<'CODE' function streamRead($stream) : int { - return strlen(fread($stream, 8192)); - } + return strlen(fread($stream, 8192)); + } function streamWrite($stream, $data) : int { - return fwrite($stream, $data); - } + return fwrite($stream, $data); + } function waitForWrite(...$streams) : bool { - $read = null; - $except = null; - while($streams && !($n = stream_select($read, $streams, $except, 1))); - return $n > 0; - } + $read = null; + $except = null; + while($streams && !($n = stream_select($read, $streams, $except, 1))); + return $n > 0; + } function waitForRead(...$streams) : bool { - $write = null; - $except = null; - while ($streams && !($n = stream_select($streams, $write, $except, 1))); - return $n > 0; - } + $write = null; + $except = null; + while ($streams && !($n = stream_select($streams, $write, $except, 1))); + return $n > 0; + } set_error_handler(function ($errno, $errstr) { - exit("$errstr\n"); - }); + exit("$errstr\n"); + }); $serverUri = "tcp://127.0.0.1:10012"; - $clientFlags = STREAM_CLIENT_CONNECT; - $clientCtx = stream_context_create(['ssl' => [ - 'verify_peer' => true, - 'cafile' => __DIR__ . '/bug54992-ca.pem', - 'peer_name' => 'bug54992.local', - ]]); + $clientFlags = STREAM_CLIENT_CONNECT; + $clientCtx = stream_context_create(['ssl' => [ + 'verify_peer' => true, + 'cafile' => __DIR__ . '/bug54992-ca.pem', + 'peer_name' => 'bug54992.local', + ]]); phpt_wait(); $fp = stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx); stream_set_blocking($fp, false); - while (0 === ($n = stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT))); + while (0 === ($n = stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT))); $data = str_repeat("a", 0xfffff); - $written = 0; - $total = $written; - while(!empty($data)) { - $written = streamWrite($fp, $data); - $total += $written; - $data = substr($data, $written); - waitForWrite($fp); - } - printf("Written %d bytes\n", $total); + $written = 0; + $total = $written; + while(!empty($data)) { + $written = streamWrite($fp, $data); + $total += $written; + $data = substr($data, $written); + waitForWrite($fp); + } + printf("Written %d bytes\n", $total); while(waitForRead($fp)) { - streamRead($fp); - if (feof($fp)) { - break; - } - } + streamRead($fp); + if (feof($fp)) { + break; + } + } exit("DONE\n"); CODE; diff --git a/ext/openssl/tests/bug74402.phpt b/ext/openssl/tests/bug74402.phpt index 8cd98362df..352d66dbcd 100644 --- a/ext/openssl/tests/bug74402.phpt +++ b/ext/openssl/tests/bug74402.phpt @@ -2,12 +2,8 @@ Bug #74402 (segfault on random_bytes, bin3hex, openssl_seal) --SKIPIF-- --FILE-- + --FILE-- + --FILE-- --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- string(%d) "bug54992.local" diff --git a/ext/openssl/tests/check_default_conf_path.phpt b/ext/openssl/tests/check_default_conf_path.phpt index 16aaa4bc1d..71b1b6a5df 100644 --- a/ext/openssl/tests/check_default_conf_path.phpt +++ b/ext/openssl/tests/check_default_conf_path.phpt @@ -17,7 +17,7 @@ ob_end_clean(); preg_match(",Openssl default config .* (.*),", $info, $m); if (isset($m[1])) { - var_dump(str_replace('/', '\\', strtolower($m[1]))); + var_dump(str_replace('/', '\\', strtolower($m[1]))); } ?> --EXPECT-- diff --git a/ext/openssl/tests/cipher_tests.inc b/ext/openssl/tests/cipher_tests.inc index b9e84af8f8..b1e46b411e 100644 --- a/ext/openssl/tests/cipher_tests.inc +++ b/ext/openssl/tests/cipher_tests.inc @@ -1,111 +1,111 @@ array( - array( - 'key' => '1bde3251d41a8b5ea013c195ae128b21' . - '8b3e0306376357077ef1c1c78548b92e', - 'iv' => '5b8e40746f6b98e00f1d13ff41', - 'aad' => 'c17a32514eb6103f3249e076d4c871dc' . - '97e04b286699e54491dc18f6d734d4c0', - 'tag' => '2024931d73bca480c24a24ece6b6c2bf', - 'pt' => '53bd72a97089e312422bf72e242377b3' . - 'c6ee3e2075389b999c4ef7f28bd2b80a', - 'ct' => '9a5fcccdb4cf04e7293d2775cc76a488' . - 'f042382d949b43b7d6bb2b9864786726', - ), - ), - 'aes-128-gcm' => array( - array( - 'key' => '00000000000000000000000000000000', - 'iv' => '000000000000000000000000', - 'tag' => '58e2fccefa7e3061367f1d57a4e7455a', - 'pt' => '', - 'ct' => '', - ), - array( - 'key' => '00000000000000000000000000000000', - 'iv' => '000000000000000000000000', - 'tag' => 'ab6e47d42cec13bdf53a67b21257bddf', - 'pt' => '00000000000000000000000000000000', - 'ct' => '0388dace60b6a392f328c2b971b2fe78', - ), - array( - 'key' => 'feffe9928665731c6d6a8f9467308308', - 'iv' => 'cafebabefacedbaddecaf888', - 'tag' => '4d5c2af327cd64a62cf35abd2ba6fab4', - 'pt' => 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b391aafd255', - 'ct' => '42831ec2217774244b7221b784d0d49c' . - 'e3aa212f2c02a4e035c17e2329aca12e' . - '21d514b25466931c7d8f6a5aac84aa05' . - '1ba30b396a0aac973d58e091473f5985', - ), - array( - 'key' => 'feffe9928665731c6d6a8f9467308308', - 'iv' => 'cafebabefacedbaddecaf888', - 'aad' => 'feedfacedeadbeeffeedfacedeadbeefabaddad2', - 'tag' => '5bc94fbc3221a5db94fae95ae7121a47', - 'pt' => 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b39', - 'ct' => '42831ec2217774244b7221b784d0d49c' . - 'e3aa212f2c02a4e035c17e2329aca12e' . - '21d514b25466931c7d8f6a5aac84aa05' . - '1ba30b396a0aac973d58e091', - ), - array( - 'key' => 'feffe9928665731c6d6a8f9467308308', - 'iv' => 'cafebabefacedbad', - 'aad' => 'feedfacedeadbeeffeedfacedeadbeefabaddad2', - 'tag' => '3612d2e79e3b0785561be14aaca2fccb', - 'pt' => 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b39', - 'ct' => '61353b4c2806934a777ff51fa22a4755' . - '699b2a714fcdc6f83766e5f97b6c7423' . - '73806900e49f24b22b097544d4896b42' . - '4989b5e1ebac0f07c23f4598' - ), - array( - 'key' => 'feffe9928665731c6d6a8f9467308308', - 'iv' => '9313225df88406e555909c5aff5269aa' . - '6a7a9538534f7da1e4c303d2a318a728' . - 'c3c0c95156809539fcf0e2429a6b5254' . - '16aedbf5a0de6a57a637b39b', - 'aad' => 'feedfacedeadbeeffeedfacedeadbeefabaddad2', - 'tag' => '619cc5aefffe0bfa462af43c1699d050', - 'pt' => 'd9313225f88406e5a55909c5aff5269a' . - '86a7a9531534f7da2e4c303d8a318a72' . - '1c3c0c95956809532fcf0e2449a6b525' . - 'b16aedf5aa0de657ba637b39', - 'ct' => '8ce24998625615b603a033aca13fb894' . - 'be9112a5c3a211a8ba262a3cca7e2ca7' . - '01e4a9a4fba43c90ccdcb281d48c7c6f' . - 'd62875d2aca417034c34aee5', - ), - ) + 'aes-256-ccm' => array( + array( + 'key' => '1bde3251d41a8b5ea013c195ae128b21' . + '8b3e0306376357077ef1c1c78548b92e', + 'iv' => '5b8e40746f6b98e00f1d13ff41', + 'aad' => 'c17a32514eb6103f3249e076d4c871dc' . + '97e04b286699e54491dc18f6d734d4c0', + 'tag' => '2024931d73bca480c24a24ece6b6c2bf', + 'pt' => '53bd72a97089e312422bf72e242377b3' . + 'c6ee3e2075389b999c4ef7f28bd2b80a', + 'ct' => '9a5fcccdb4cf04e7293d2775cc76a488' . + 'f042382d949b43b7d6bb2b9864786726', + ), + ), + 'aes-128-gcm' => array( + array( + 'key' => '00000000000000000000000000000000', + 'iv' => '000000000000000000000000', + 'tag' => '58e2fccefa7e3061367f1d57a4e7455a', + 'pt' => '', + 'ct' => '', + ), + array( + 'key' => '00000000000000000000000000000000', + 'iv' => '000000000000000000000000', + 'tag' => 'ab6e47d42cec13bdf53a67b21257bddf', + 'pt' => '00000000000000000000000000000000', + 'ct' => '0388dace60b6a392f328c2b971b2fe78', + ), + array( + 'key' => 'feffe9928665731c6d6a8f9467308308', + 'iv' => 'cafebabefacedbaddecaf888', + 'tag' => '4d5c2af327cd64a62cf35abd2ba6fab4', + 'pt' => 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b391aafd255', + 'ct' => '42831ec2217774244b7221b784d0d49c' . + 'e3aa212f2c02a4e035c17e2329aca12e' . + '21d514b25466931c7d8f6a5aac84aa05' . + '1ba30b396a0aac973d58e091473f5985', + ), + array( + 'key' => 'feffe9928665731c6d6a8f9467308308', + 'iv' => 'cafebabefacedbaddecaf888', + 'aad' => 'feedfacedeadbeeffeedfacedeadbeefabaddad2', + 'tag' => '5bc94fbc3221a5db94fae95ae7121a47', + 'pt' => 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b39', + 'ct' => '42831ec2217774244b7221b784d0d49c' . + 'e3aa212f2c02a4e035c17e2329aca12e' . + '21d514b25466931c7d8f6a5aac84aa05' . + '1ba30b396a0aac973d58e091', + ), + array( + 'key' => 'feffe9928665731c6d6a8f9467308308', + 'iv' => 'cafebabefacedbad', + 'aad' => 'feedfacedeadbeeffeedfacedeadbeefabaddad2', + 'tag' => '3612d2e79e3b0785561be14aaca2fccb', + 'pt' => 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b39', + 'ct' => '61353b4c2806934a777ff51fa22a4755' . + '699b2a714fcdc6f83766e5f97b6c7423' . + '73806900e49f24b22b097544d4896b42' . + '4989b5e1ebac0f07c23f4598' + ), + array( + 'key' => 'feffe9928665731c6d6a8f9467308308', + 'iv' => '9313225df88406e555909c5aff5269aa' . + '6a7a9538534f7da1e4c303d2a318a728' . + 'c3c0c95156809539fcf0e2429a6b5254' . + '16aedbf5a0de6a57a637b39b', + 'aad' => 'feedfacedeadbeeffeedfacedeadbeefabaddad2', + 'tag' => '619cc5aefffe0bfa462af43c1699d050', + 'pt' => 'd9313225f88406e5a55909c5aff5269a' . + '86a7a9531534f7da2e4c303d8a318a72' . + '1c3c0c95956809532fcf0e2449a6b525' . + 'b16aedf5aa0de657ba637b39', + 'ct' => '8ce24998625615b603a033aca13fb894' . + 'be9112a5c3a211a8ba262a3cca7e2ca7' . + '01e4a9a4fba43c90ccdcb281d48c7c6f' . + 'd62875d2aca417034c34aee5', + ), + ) ); function openssl_get_cipher_tests($method) { - global $php_openssl_cipher_tests; + global $php_openssl_cipher_tests; - $tests = array(); + $tests = array(); - foreach ($php_openssl_cipher_tests[$method] as $instance) { - $test = array(); - foreach ($instance as $field_name => $field_value) { - $test[$field_name] = pack("H*", $field_value); - } - if (!isset($test['aad'])) { - $test['aad'] = ""; - } - $tests[] = $test; - } + foreach ($php_openssl_cipher_tests[$method] as $instance) { + $test = array(); + foreach ($instance as $field_name => $field_value) { + $test[$field_name] = pack("H*", $field_value); + } + if (!isset($test['aad'])) { + $test['aad'] = ""; + } + $tests[] = $test; + } - return $tests; + return $tests; } diff --git a/ext/openssl/tests/cve-2013-6420.phpt b/ext/openssl/tests/cve-2013-6420.phpt index ccead0aab6..4a4b28ca74 100644 --- a/ext/openssl/tests/cve-2013-6420.phpt +++ b/ext/openssl/tests/cve-2013-6420.phpt @@ -1,9 +1,7 @@ --TEST-- CVE-2013-6420 --SKIPIF-- - + --FILE-- --FILE-- --EXPECTF-- array ( 'basicConstraints' => 'CA:FALSE', diff --git a/ext/openssl/tests/ecc.phpt b/ext/openssl/tests/ecc.phpt index e4c1d20805..45dcf56713 100644 --- a/ext/openssl/tests/ecc.phpt +++ b/ext/openssl/tests/ecc.phpt @@ -5,16 +5,16 @@ openssl_*() with OPENSSL_KEYTYPE_EC --FILE-- "secp384r1", - "private_key_type" => OPENSSL_KEYTYPE_EC, + "curve_name" => "secp384r1", + "private_key_type" => OPENSSL_KEYTYPE_EC, ); echo "Testing openssl_pkey_new\n"; $key1 = openssl_pkey_new($args); var_dump($key1); $argsFailed = array( - "curve_name" => "invalid_cuve_name", - "private_key_type" => OPENSSL_KEYTYPE_EC, + "curve_name" => "invalid_cuve_name", + "private_key_type" => OPENSSL_KEYTYPE_EC, ); $keyFailed = openssl_pkey_new($argsFailed); @@ -34,11 +34,11 @@ $d2 = openssl_pkey_get_details($key2); var_dump($d1 === $d2); $dn = array( - "countryName" => "BR", - "stateOrProvinceName" => "Rio Grande do Sul", - "localityName" => "Porto Alegre", - "commonName" => "Henrique do N. Angelo", - "emailAddress" => "hnangelo@php.net" + "countryName" => "BR", + "stateOrProvinceName" => "Rio Grande do Sul", + "localityName" => "Porto Alegre", + "commonName" => "Henrique do N. Angelo", + "emailAddress" => "hnangelo@php.net" ); // openssl_csr_new creates a new public key pair if the key argument is null @@ -74,9 +74,9 @@ $curve_names = openssl_get_curve_names(); var_dump(is_array($curve_names)); foreach ($curve_names as $curve_name) { - if ("secp384r1" === $curve_name) { - echo "Found secp384r1 in curve names\n"; - } + if ("secp384r1" === $curve_name) { + echo "Found secp384r1 in curve names\n"; + } } ?> --EXPECTF-- diff --git a/ext/openssl/tests/openssl_csr_export_bacis.phpt b/ext/openssl/tests/openssl_csr_export_bacis.phpt index d3f8842e71..228a173764 100644 --- a/ext/openssl/tests/openssl_csr_export_bacis.phpt +++ b/ext/openssl/tests/openssl_csr_export_bacis.phpt @@ -9,19 +9,19 @@ $config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'; $config_arg = array('config' => $config); $dn = array( - "countryName" => "BR", - "stateOrProvinceName" => "Rio Grande do Sul", - "localityName" => "Porto Alegre", - "commonName" => "Henrique do N. Angelo", - "emailAddress" => "hnangelo@php.net" + "countryName" => "BR", + "stateOrProvinceName" => "Rio Grande do Sul", + "localityName" => "Porto Alegre", + "commonName" => "Henrique do N. Angelo", + "emailAddress" => "hnangelo@php.net" ); $args = array( - "digest_alg" => "sha1", - "private_key_bits" => 2048, - "private_key_type" => OPENSSL_KEYTYPE_DSA, - "encrypt_key" => true, - "config" => $config, + "digest_alg" => "sha1", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_DSA, + "encrypt_key" => true, + "config" => $config, ); $privkey = openssl_pkey_new($config_arg); diff --git a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt index 1576302ae3..ccbd00f49a 100644 --- a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt @@ -8,28 +8,28 @@ $csrfile = dirname(__FILE__) . "/openssl_csr_export_to_file_csr.tmp"; $wrong = "wrong"; $config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'; $phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' . - 'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' . - '7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' . - '6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab'; + 'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' . + '7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' . + '6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab'; $dh_details = array('p' => $phex, 'g' => '2'); $dh = openssl_pkey_new(array( - 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) + 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) ); $dn = array( - "countryName" => "BR", - "stateOrProvinceName" => "Rio Grande do Sul", - "localityName" => "Porto Alegre", - "commonName" => "Henrique do N. Angelo", - "emailAddress" => "hnangelo@php.net" + "countryName" => "BR", + "stateOrProvinceName" => "Rio Grande do Sul", + "localityName" => "Porto Alegre", + "commonName" => "Henrique do N. Angelo", + "emailAddress" => "hnangelo@php.net" ); $args = array( - "digest_alg" => "sha1", - "private_key_bits" => 2048, - "private_key_type" => OPENSSL_KEYTYPE_DSA, - "encrypt_key" => true, - "config" => $config, + "digest_alg" => "sha1", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_DSA, + "encrypt_key" => true, + "config" => $config, ); $privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; @@ -45,7 +45,7 @@ var_dump(openssl_csr_export_to_file($csr, $csrfile, false)); --EXPECTF-- diff --git a/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt b/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt index e8a9b7a0ce..1958350dfb 100644 --- a/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt +++ b/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt @@ -8,28 +8,28 @@ if (!extension_loaded("openssl")) die("skip"); $phex, 'g' => '2'); $dh = openssl_pkey_new(array( 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) ); $dn = array( - "countryName" => "BR", - "stateOrProvinceName" => "Rio Grande do Sul", - "localityName" => "Porto Alegre", - "commonName" => "Henrique do N. Angelo", - "emailAddress" => "hnangelo@php.net" + "countryName" => "BR", + "stateOrProvinceName" => "Rio Grande do Sul", + "localityName" => "Porto Alegre", + "commonName" => "Henrique do N. Angelo", + "emailAddress" => "hnangelo@php.net" ); $args = array( - "digest_alg" => "sha1", - "private_key_bits" => 2048, - "private_key_type" => OPENSSL_KEYTYPE_DSA, - "encrypt_key" => true, - "config" => $config, + "digest_alg" => "sha1", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_DSA, + "encrypt_key" => true, + "config" => $config, ); $privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; diff --git a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt index 6fe41f80e8..441ed3339b 100644 --- a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt +++ b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt @@ -8,28 +8,28 @@ if (!extension_loaded("openssl")) die("skip"); $phex, 'g' => '2'); $dh = openssl_pkey_new(array( 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) ); $dn = array( - "countryName" => "BR", - "stateOrProvinceName" => "Rio Grande do Sul", - "localityName" => "Porto Alegre", - "commonName" => "Henrique do N. Angelo", - "emailAddress" => "hnangelo@php.net" + "countryName" => "BR", + "stateOrProvinceName" => "Rio Grande do Sul", + "localityName" => "Porto Alegre", + "commonName" => "Henrique do N. Angelo", + "emailAddress" => "hnangelo@php.net" ); $args = array( - "digest_alg" => "sha1", - "private_key_bits" => 2048, - "private_key_type" => OPENSSL_KEYTYPE_DSA, - "encrypt_key" => true, - "config" => $config, + "digest_alg" => "sha1", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_DSA, + "encrypt_key" => true, + "config" => $config, ); $privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key'; diff --git a/ext/openssl/tests/openssl_csr_sign_basic.phpt b/ext/openssl/tests/openssl_csr_sign_basic.phpt index 572bb36695..377a3f1f1e 100644 --- a/ext/openssl/tests/openssl_csr_sign_basic.phpt +++ b/ext/openssl/tests/openssl_csr_sign_basic.phpt @@ -12,20 +12,20 @@ $config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'; $config_arg = array('config' => $config); $dn = array( - "countryName" => "BR", - "stateOrProvinceName" => "Rio Grande do Sul", - "localityName" => "Porto Alegre", - "commonName" => "Henrique do N. Angelo", - "emailAddress" => "hnangelo@php.net" - ); + "countryName" => "BR", + "stateOrProvinceName" => "Rio Grande do Sul", + "localityName" => "Porto Alegre", + "commonName" => "Henrique do N. Angelo", + "emailAddress" => "hnangelo@php.net" +); $args = array( - "digest_alg" => "sha1", - "private_key_bits" => 2048, - "private_key_type" => OPENSSL_KEYTYPE_DSA, - "encrypt_key" => true, - "config" => $config - ); + "digest_alg" => "sha1", + "private_key_bits" => 2048, + "private_key_type" => OPENSSL_KEYTYPE_DSA, + "encrypt_key" => true, + "config" => $config +); $privkey = openssl_pkey_new($config_arg); $csr = openssl_csr_new($dn, $privkey, $args); diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt index beb3074938..87b6d4b264 100644 --- a/ext/openssl/tests/openssl_decrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt @@ -14,10 +14,10 @@ $method = 'aes-256-ccm'; $tests = openssl_get_cipher_tests($method); foreach ($tests as $idx => $test) { - echo "TEST $idx\n"; - $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $test['tag'], $test['aad']); - var_dump($test['pt'] === $pt); + echo "TEST $idx\n"; + $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, + $test['iv'], $test['tag'], $test['aad']); + var_dump($test['pt'] === $pt); } // no IV diff --git a/ext/openssl/tests/openssl_decrypt_gcm.phpt b/ext/openssl/tests/openssl_decrypt_gcm.phpt index 11802e9d8e..5c243a8fad 100644 --- a/ext/openssl/tests/openssl_decrypt_gcm.phpt +++ b/ext/openssl/tests/openssl_decrypt_gcm.phpt @@ -14,10 +14,10 @@ $method = 'aes-128-gcm'; $tests = openssl_get_cipher_tests($method); foreach ($tests as $idx => $test) { - echo "TEST $idx\n"; - $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $test['tag'], $test['aad']); - var_dump($test['pt'] === $pt); + echo "TEST $idx\n"; + $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, + $test['iv'], $test['tag'], $test['aad']); + var_dump($test['pt'] === $pt); } // no IV diff --git a/ext/openssl/tests/openssl_encrypt_ccm.phpt b/ext/openssl/tests/openssl_encrypt_ccm.phpt index 945e81dfd7..c8610bc96b 100644 --- a/ext/openssl/tests/openssl_encrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_encrypt_ccm.phpt @@ -3,9 +3,9 @@ openssl_encrypt() with CCM cipher algorithm tests --SKIPIF-- --FILE-- $test) { - echo "TEST $idx\n"; - $ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $tag, $test['aad'], strlen($test['tag'])); - var_dump($test['ct'] === $ct); - var_dump($test['tag'] === $tag); + echo "TEST $idx\n"; + $ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA, + $test['iv'], $tag, $test['aad'], strlen($test['tag'])); + var_dump($test['ct'] === $ct); + var_dump($test['tag'] === $tag); } // Empty IV error diff --git a/ext/openssl/tests/openssl_encrypt_gcm.phpt b/ext/openssl/tests/openssl_encrypt_gcm.phpt index 60b48cd091..e2be510980 100644 --- a/ext/openssl/tests/openssl_encrypt_gcm.phpt +++ b/ext/openssl/tests/openssl_encrypt_gcm.phpt @@ -14,11 +14,11 @@ $method = 'aes-128-gcm'; $tests = openssl_get_cipher_tests($method); foreach ($tests as $idx => $test) { - echo "TEST $idx\n"; - $ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $tag, $test['aad'], strlen($test['tag'])); - var_dump($test['ct'] === $ct); - var_dump($test['tag'] === $tag); + echo "TEST $idx\n"; + $ct = openssl_encrypt($test['pt'], $method, $test['key'], OPENSSL_RAW_DATA, + $test['iv'], $tag, $test['aad'], strlen($test['tag'])); + var_dump($test['ct'] === $ct); + var_dump($test['tag'] === $tag); } // Empty IV error diff --git a/ext/openssl/tests/openssl_error_string_basic.phpt b/ext/openssl/tests/openssl_error_string_basic.phpt index 7817fbafb2..0f1acd7dc5 100644 --- a/ext/openssl/tests/openssl_error_string_basic.phpt +++ b/ext/openssl/tests/openssl_error_string_basic.phpt @@ -6,35 +6,35 @@ openssl_error_string() tests 14) { - $error_code = substr($error_string, 6, 8); - if (isset($expected_errors[$error_code])) { - $expected_errors[$error_code] = true; - } - } - } + $expected_errors = array_fill_keys($expected_error_codes, false); + while (($error_string = openssl_error_string()) !== false) { + if (strlen($error_string) > 14) { + $error_code = substr($error_string, 6, 8); + if (isset($expected_errors[$error_code])) { + $expected_errors[$error_code] = true; + } + } + } - $fail = false; - foreach ($expected_errors as $error_code => $error_code_found) { - if (!$error_code_found) { - $fail = true; - echo "$name: no error code $error_code\n"; - } - } + $fail = false; + foreach ($expected_errors as $error_code => $error_code_found) { + if (!$error_code_found) { + $fail = true; + echo "$name: no error code $error_code\n"; + } + } - if (!$fail) { - echo "$name: ok\n"; - } + if (!$fail) { + echo "$name: ok\n"; + } } // helper for debugging errors function dump_openssl_errors($name) { - echo "\n$name\n"; - while (($error_string = openssl_error_string()) !== false) { - var_dump($error_string); - } + echo "\n$name\n"; + while (($error_string = openssl_error_string()) !== false) { + var_dump($error_string); + } } // common output file @@ -71,10 +71,10 @@ for ($i = 0; $i < 20; $i++) { } $error_queue_size = 0; while (($enc_error_new = openssl_error_string()) !== false) { - if ($enc_error_new !== $enc_error) { - echo "The new encoding error doesn't match the expected one\n"; - } - ++$error_queue_size; + if ($enc_error_new !== $enc_error) { + echo "The new encoding error doesn't match the expected one\n"; + } + ++$error_queue_size; } var_dump($error_queue_size); echo "\n"; diff --git a/ext/openssl/tests/openssl_peer_fingerprint_basic.phpt b/ext/openssl/tests/openssl_peer_fingerprint_basic.phpt index 743233579a..430de54dfd 100644 --- a/ext/openssl/tests/openssl_peer_fingerprint_basic.phpt +++ b/ext/openssl/tests/openssl_peer_fingerprint_basic.phpt @@ -4,6 +4,7 @@ Testing peer fingerprint on connection --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Warning: stream_socket_client(): peer_fingerprint match failure in %s on line %d diff --git a/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt b/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt index cf6c0df8ac..623126fc59 100644 --- a/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt @@ -8,11 +8,11 @@ $infile = dirname(__FILE__) . "/cert.crt"; $privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key"; $encrypted = tempnam(sys_get_temp_dir(), "ssl"); if ($encrypted === false) - die("failed to get a temporary filename!"); + die("failed to get a temporary filename!"); $outfile = tempnam(sys_get_temp_dir(), "ssl"); if ($outfile === false) { - unlink($outfile); - die("failed to get a temporary filename!"); + unlink($outfile); + die("failed to get a temporary filename!"); } $single_cert = "file://" . dirname(__FILE__) . "/cert.crt"; @@ -33,12 +33,12 @@ var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $empty, $privkey)); var_dump(openssl_pkcs7_decrypt($encrypted, $outfile, $single_cert, $empty)); if (file_exists($encrypted)) { - echo "true\n"; - unlink($encrypted); + echo "true\n"; + unlink($encrypted); } if (file_exists($outfile)) { - echo "true\n"; - unlink($outfile); + echo "true\n"; + unlink($outfile); } ?> --EXPECTF-- diff --git a/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt b/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt index e8ba264550..d4105db75a 100644 --- a/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt +++ b/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt @@ -6,7 +6,7 @@ openssl_pkcs7_decrypt() and invalid parameters --EXPECTF-- diff --git a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt index d6ce799848..0e29901c7e 100644 --- a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt @@ -7,7 +7,7 @@ openssl_pkcs7_sign() tests $infile = dirname(__FILE__) . "/cert.crt"; $outfile = tempnam(sys_get_temp_dir(), "ssl"); if ($outfile === false) { - die("failed to get a temporary filename!"); + die("failed to get a temporary filename!"); } $privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key"; @@ -32,8 +32,8 @@ var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $privkey, $empty)); var_dump(openssl_pkcs7_sign($infile, $outfile, $single_cert, $wrong, $headers)); if (file_exists($outfile)) { - echo "true\n"; - unlink($outfile); + echo "true\n"; + unlink($outfile); } ?> --EXPECTF-- diff --git a/ext/openssl/tests/openssl_pkey_new_basic.phpt b/ext/openssl/tests/openssl_pkey_new_basic.phpt index b73b1f580c..41e67b2a04 100644 --- a/ext/openssl/tests/openssl_pkey_new_basic.phpt +++ b/ext/openssl/tests/openssl_pkey_new_basic.phpt @@ -10,30 +10,30 @@ function openssl_pkey_test_cmp($expected, $bin_key) { // RSA $nhex = "BBF82F090682CE9C2338AC2B9DA871F7368D07EED41043A440D6B6F07454F51F" . - "B8DFBAAF035C02AB61EA48CEEB6FCD4876ED520D60E1EC4619719D8A5B8B807F" . - "AFB8E0A3DFC737723EE6B4B7D93A2584EE6A649D060953748834B2454598394E" . - "E0AAB12D7B61A51F527A9A41F6C1687FE2537298CA2A8F5946F8E5FD091DBDCB"; + "B8DFBAAF035C02AB61EA48CEEB6FCD4876ED520D60E1EC4619719D8A5B8B807F" . + "AFB8E0A3DFC737723EE6B4B7D93A2584EE6A649D060953748834B2454598394E" . + "E0AAB12D7B61A51F527A9A41F6C1687FE2537298CA2A8F5946F8E5FD091DBDCB"; $ehex = "11"; $dhex = "A5DAFC5341FAF289C4B988DB30C1CDF83F31251E0668B42784813801579641B2" . - "9410B3C7998D6BC465745E5C392669D6870DA2C082A939E37FDCB82EC93EDAC9" . - "7FF3AD5950ACCFBC111C76F1A9529444E56AAF68C56C092CD38DC3BEF5D20A93" . - "9926ED4F74A13EDDFBE1A1CECC4894AF9428C2B7B8883FE4463A4BC85B1CB3C1"; + "9410B3C7998D6BC465745E5C392669D6870DA2C082A939E37FDCB82EC93EDAC9" . + "7FF3AD5950ACCFBC111C76F1A9529444E56AAF68C56C092CD38DC3BEF5D20A93" . + "9926ED4F74A13EDDFBE1A1CECC4894AF9428C2B7B8883FE4463A4BC85B1CB3C1"; $phex = "EECFAE81B1B9B3C908810B10A1B5600199EB9F44AEF4FDA493B81A9E3D84F632" . - "124EF0236E5D1E3B7E28FAE7AA040A2D5B252176459D1F397541BA2A58FB6599"; + "124EF0236E5D1E3B7E28FAE7AA040A2D5B252176459D1F397541BA2A58FB6599"; $qhex = "C97FB1F027F453F6341233EAAAD1D9353F6C42D08866B1D05A0F2035028B9D86" . - "9840B41666B42E92EA0DA3B43204B5CFCE3352524D0416A5A441E700AF461503"; + "9840B41666B42E92EA0DA3B43204B5CFCE3352524D0416A5A441E700AF461503"; $rsa= openssl_pkey_new(array( - 'rsa' => array( - 'n' => hex2bin($nhex), - 'e' => hex2bin($ehex), - 'd' => hex2bin($dhex), - 'p' => hex2bin($phex), - 'q' => hex2bin($qhex), - ) + 'rsa' => array( + 'n' => hex2bin($nhex), + 'e' => hex2bin($ehex), + 'd' => hex2bin($dhex), + 'p' => hex2bin($phex), + 'q' => hex2bin($qhex), + ) )); $details = openssl_pkey_get_details($rsa); $rsa_details = $details['rsa']; @@ -45,24 +45,24 @@ openssl_pkey_test_cmp($qhex, $rsa_details['q']); // DSA $phex = '00f8000ae45b2dacb47dd977d58b719d097bdf07cb2c17660ad898518c08' . - '1a61659a16daadfaa406a0a994c743df5eda07e36bd0adcad921b77432ff' . - '24ccc31e782d647e66768122b578857e9293df78387dc8b44af2a4a3f305' . - '1f236b1000a3e31da489c6681b0031f7ec37c2e1091bdb698e7660f135b6' . - '996def90090303b7ad'; + '1a61659a16daadfaa406a0a994c743df5eda07e36bd0adcad921b77432ff' . + '24ccc31e782d647e66768122b578857e9293df78387dc8b44af2a4a3f305' . + '1f236b1000a3e31da489c6681b0031f7ec37c2e1091bdb698e7660f135b6' . + '996def90090303b7ad'; $qhex = '009b3734fc9f7a4a9d6437ec314e0a78c2889af64b'; $ghex = '00b320300a0bc55b8f0ec6edc218e2185250f38fbb8291db8a89227f6e41' . - '00d47d6ccb9c7d42fc43280ecc2ed386e81ff65bc5d6a2ae78db7372f5dc' . - 'f780f4558e7ed3dd0c96a1b40727ac56c5165aed700a3b63997893a1fb21' . - '4e882221f0dd9604820dc34e2725dd6901c93e0ca56f6d76d495c332edc5' . - 'b81747c4c447a941f3'; + '00d47d6ccb9c7d42fc43280ecc2ed386e81ff65bc5d6a2ae78db7372f5dc' . + 'f780f4558e7ed3dd0c96a1b40727ac56c5165aed700a3b63997893a1fb21' . + '4e882221f0dd9604820dc34e2725dd6901c93e0ca56f6d76d495c332edc5' . + 'b81747c4c447a941f3'; $dsa = openssl_pkey_new(array( - 'dsa' => array( - 'p' => hex2bin($phex), - 'q' => hex2bin($qhex), - 'g' => hex2bin($ghex) - ) + 'dsa' => array( + 'p' => hex2bin($phex), + 'q' => hex2bin($qhex), + 'g' => hex2bin($ghex) + ) )); $details = openssl_pkey_get_details($dsa); $dsa_details = $details['dsa']; @@ -74,13 +74,13 @@ var_dump(strlen($dsa_details['pub_key'])); // DH $phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' . - 'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' . - '7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' . - '6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab'; + 'f75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d268370557' . + '7d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e382' . + '6634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab'; $dh_details = array('p' => $phex, 'g' => '2'); $dh = openssl_pkey_new(array( - 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) + 'dh'=> array('p' => hex2bin($phex), 'g' => '2')) ); $details = openssl_pkey_get_details($dh); $dh_details = $details['dh']; diff --git a/ext/openssl/tests/openssl_private_encrypt_basic.phpt b/ext/openssl/tests/openssl_private_encrypt_basic.phpt index a2a5152158..968537c3c3 100644 --- a/ext/openssl/tests/openssl_private_encrypt_basic.phpt +++ b/ext/openssl/tests/openssl_private_encrypt_basic.phpt @@ -10,9 +10,9 @@ $pubkey = "file://" . dirname(__FILE__) . "/public.key"; $wrong = "wrong"; class test { - function __toString() { - return "test"; - } + function __toString() { + return "test"; + } } $obj = new test; diff --git a/ext/openssl/tests/openssl_public_encrypt_basic.phpt b/ext/openssl/tests/openssl_public_encrypt_basic.phpt index a3c4c57539..e9d47c26b0 100644 --- a/ext/openssl/tests/openssl_public_encrypt_basic.phpt +++ b/ext/openssl/tests/openssl_public_encrypt_basic.phpt @@ -10,9 +10,9 @@ $pubkey = "file://" . dirname(__FILE__) . "/public.key"; $wrong = "wrong"; class test { - function __toString() { - return "test"; - } + function __toString() { + return "test"; + } } $obj = new test; diff --git a/ext/openssl/tests/openssl_random_pseudo_bytes_basic.phpt b/ext/openssl/tests/openssl_random_pseudo_bytes_basic.phpt index ac5a3079a1..68c11dde2c 100644 --- a/ext/openssl/tests/openssl_random_pseudo_bytes_basic.phpt +++ b/ext/openssl/tests/openssl_random_pseudo_bytes_basic.phpt @@ -5,7 +5,7 @@ openssl_random_pseudo_bytes() tests --FILE-- diff --git a/ext/openssl/tests/openssl_spki_export_basic.phpt b/ext/openssl/tests/openssl_spki_export_basic.phpt index 1e3bd1fd39..8871c1016d 100644 --- a/ext/openssl/tests/openssl_spki_export_basic.phpt +++ b/ext/openssl/tests/openssl_spki_export_basic.phpt @@ -12,39 +12,39 @@ if (!@openssl_pkey_new()) die("skip cannot create private key"); $key_sizes = array(1024, 2048, 4096); $pkeys = array(); foreach ($key_sizes as $key_size) { - $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; - $pkeys[] = openssl_pkey_get_private($key_file); + $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; + $pkeys[] = openssl_pkey_get_private($key_file); } /* array of available hashings to test */ $algo = array( - OPENSSL_ALGO_MD4, - OPENSSL_ALGO_MD5, - OPENSSL_ALGO_SHA1, - OPENSSL_ALGO_SHA224, - OPENSSL_ALGO_SHA256, - OPENSSL_ALGO_SHA384, - OPENSSL_ALGO_SHA512, - OPENSSL_ALGO_RMD160 + OPENSSL_ALGO_MD4, + OPENSSL_ALGO_MD5, + OPENSSL_ALGO_SHA1, + OPENSSL_ALGO_SHA224, + OPENSSL_ALGO_SHA256, + OPENSSL_ALGO_SHA384, + OPENSSL_ALGO_SHA512, + OPENSSL_ALGO_RMD160 ); /* loop over key sizes for test */ foreach ($pkeys as $pkey) { - /* loop to create and verify results */ - foreach ($algo as $value) { - $spkac = openssl_spki_new($pkey, _uuid(), $value); - echo openssl_spki_export(preg_replace('/SPKAC=/', '', $spkac)); - } + /* loop to create and verify results */ + foreach ($algo as $value) { + $spkac = openssl_spki_new($pkey, _uuid(), $value); + echo openssl_spki_export(preg_replace('/SPKAC=/', '', $spkac)); + } } /* generate a random challenge */ function _uuid() { - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, + mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff)); } diff --git a/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt b/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt index 07a69d3b45..2b947221bb 100644 --- a/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt +++ b/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt @@ -14,40 +14,40 @@ if (!@openssl_pkey_new()) die("skip cannot create private key"); $key_sizes = array(1024, 2048, 4096); $pkeys = array(); foreach ($key_sizes as $key_size) { - $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; - $pkeys[] = openssl_pkey_get_private($key_file); + $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; + $pkeys[] = openssl_pkey_get_private($key_file); } /* array of available hashings to test */ $algo = array( - OPENSSL_ALGO_MD4, - OPENSSL_ALGO_MD5, - OPENSSL_ALGO_SHA1, - OPENSSL_ALGO_SHA224, - OPENSSL_ALGO_SHA256, - OPENSSL_ALGO_SHA384, - OPENSSL_ALGO_SHA512, - OPENSSL_ALGO_RMD160 + OPENSSL_ALGO_MD4, + OPENSSL_ALGO_MD5, + OPENSSL_ALGO_SHA1, + OPENSSL_ALGO_SHA224, + OPENSSL_ALGO_SHA256, + OPENSSL_ALGO_SHA384, + OPENSSL_ALGO_SHA512, + OPENSSL_ALGO_RMD160 ); /* loop over key sizes for test */ foreach ($pkeys as $pkey) { - /* loop to create and verify results */ - foreach ($algo as $value) { - $spkac = openssl_spki_new($pkey, _uuid(), $value); - var_dump(openssl_spki_export_challenge(preg_replace('/SPKAC=/', '', $spkac))); - var_dump(openssl_spki_export_challenge($spkac . 'Make it fail')); - } + /* loop to create and verify results */ + foreach ($algo as $value) { + $spkac = openssl_spki_new($pkey, _uuid(), $value); + var_dump(openssl_spki_export_challenge(preg_replace('/SPKAC=/', '', $spkac))); + var_dump(openssl_spki_export_challenge($spkac . 'Make it fail')); + } } /* generate a random challenge */ function _uuid() { - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, + mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff)); } diff --git a/ext/openssl/tests/openssl_spki_new_basic.phpt b/ext/openssl/tests/openssl_spki_new_basic.phpt index b31d6f9184..7f9e023618 100644 --- a/ext/openssl/tests/openssl_spki_new_basic.phpt +++ b/ext/openssl/tests/openssl_spki_new_basic.phpt @@ -11,38 +11,38 @@ if (!extension_loaded("openssl")) die("skip"); $key_sizes = array(1024, 2048, 4096); $pkeys = array(); foreach ($key_sizes as $key_size) { - $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; - $pkeys[] = openssl_pkey_get_private($key_file); + $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; + $pkeys[] = openssl_pkey_get_private($key_file); } /* array of available hashings to test */ $algo = array( - OPENSSL_ALGO_MD4, - OPENSSL_ALGO_MD5, - OPENSSL_ALGO_SHA1, - OPENSSL_ALGO_SHA224, - OPENSSL_ALGO_SHA256, - OPENSSL_ALGO_SHA384, - OPENSSL_ALGO_SHA512, - OPENSSL_ALGO_RMD160 + OPENSSL_ALGO_MD4, + OPENSSL_ALGO_MD5, + OPENSSL_ALGO_SHA1, + OPENSSL_ALGO_SHA224, + OPENSSL_ALGO_SHA256, + OPENSSL_ALGO_SHA384, + OPENSSL_ALGO_SHA512, + OPENSSL_ALGO_RMD160 ); /* loop over key sizes for test */ foreach ($pkeys as $pkey) { - /* loop to create and verify results */ - foreach ($algo as $value) { - var_dump(openssl_spki_new($pkey, _uuid(), $value)); - } + /* loop to create and verify results */ + foreach ($algo as $value) { + var_dump(openssl_spki_new($pkey, _uuid(), $value)); + } } /* generate a random challenge */ function _uuid() { - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, + mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff)); } ?> diff --git a/ext/openssl/tests/openssl_spki_verify_basic.phpt b/ext/openssl/tests/openssl_spki_verify_basic.phpt index 7b56a37e13..4abfc1798c 100644 --- a/ext/openssl/tests/openssl_spki_verify_basic.phpt +++ b/ext/openssl/tests/openssl_spki_verify_basic.phpt @@ -13,38 +13,38 @@ if (!extension_loaded("openssl")) die("skip"); $key_sizes = array(1024, 2048, 4096); $pkeys = array(); foreach ($key_sizes as $key_size) { - $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; - $pkeys[] = openssl_pkey_get_private($key_file); + $key_file = "file://" . dirname(__FILE__) . "/private_rsa_" . $key_size . ".key"; + $pkeys[] = openssl_pkey_get_private($key_file); } /* array of available hashings to test */ $algo = array( - OPENSSL_ALGO_SHA1, - OPENSSL_ALGO_SHA224, - OPENSSL_ALGO_SHA256, - OPENSSL_ALGO_SHA384, - OPENSSL_ALGO_SHA512, - OPENSSL_ALGO_RMD160 + OPENSSL_ALGO_SHA1, + OPENSSL_ALGO_SHA224, + OPENSSL_ALGO_SHA256, + OPENSSL_ALGO_SHA384, + OPENSSL_ALGO_SHA512, + OPENSSL_ALGO_RMD160 ); /* loop over key sizes for test */ foreach ($pkeys as $pkey) { - /* loop to create and verify results */ - foreach ($algo as $value) { - $spkac = openssl_spki_new($pkey, _uuid(), $value); - var_dump(openssl_spki_verify(preg_replace('/SPKAC=/', '', $spkac))); - var_dump(openssl_spki_verify($spkac . 'Make it fail')); - } + /* loop to create and verify results */ + foreach ($algo as $value) { + $spkac = openssl_spki_new($pkey, _uuid(), $value); + var_dump(openssl_spki_verify(preg_replace('/SPKAC=/', '', $spkac))); + var_dump(openssl_spki_verify($spkac . 'Make it fail')); + } } /* generate a random challenge */ function _uuid() { - return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, - mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), - mt_rand(0, 0xffff), mt_rand(0, 0xffff)); + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0x0fff) | 0x4000, + mt_rand(0, 0x3fff) | 0x8000, mt_rand(0, 0xffff), + mt_rand(0, 0xffff), mt_rand(0, 0xffff)); } diff --git a/ext/openssl/tests/openssl_x509_export_basic.phpt b/ext/openssl/tests/openssl_x509_export_basic.phpt index 4177bd7798..94cb4fa48c 100644 --- a/ext/openssl/tests/openssl_x509_export_basic.phpt +++ b/ext/openssl/tests/openssl_x509_export_basic.phpt @@ -19,7 +19,7 @@ var_dump(openssl_x509_export($d, $output4)); // read cert from a resource var_dump(openssl_x509_export($e, $output5)); // read an array, fails if (PHP_EOL !== "\n") { - $a = str_replace(PHP_EOL, "\n", $a); + $a = str_replace(PHP_EOL, "\n", $a); } var_dump(strcmp($output, $a)); diff --git a/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt b/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt index 68ba93230d..04e6d9e565 100644 --- a/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt @@ -25,7 +25,7 @@ var_dump($exists = file_exists($outfilename)); --EXPECTF-- diff --git a/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt b/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt index add65cb3e3..f47255ac1b 100644 --- a/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt +++ b/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt @@ -1,9 +1,7 @@ --TEST-- openssl_x509_fingerprint() tests --SKIPIF-- - + --FILE-- + --FILE-- --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- bool(false) bool(false) diff --git a/ext/openssl/tests/san_peer_matching.phpt b/ext/openssl/tests/san_peer_matching.phpt index 0e1f30cb64..f048c4e0f1 100644 --- a/ext/openssl/tests/san_peer_matching.phpt +++ b/ext/openssl/tests/san_peer_matching.phpt @@ -4,6 +4,7 @@ Peer verification matches SAN names --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/session_meta_capture.phpt b/ext/openssl/tests/session_meta_capture.phpt index a09d7e8780..caa3a87075 100644 --- a/ext/openssl/tests/session_meta_capture.phpt +++ b/ext/openssl/tests/session_meta_capture.phpt @@ -4,7 +4,7 @@ Capture SSL session meta array in stream context --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- string(5) "TLSv1" string(7) "TLSv1.1" diff --git a/ext/openssl/tests/sni_server.phpt b/ext/openssl/tests/sni_server.phpt index d55c5d69a1..76ea4f7325 100644 --- a/ext/openssl/tests/sni_server.phpt +++ b/ext/openssl/tests/sni_server.phpt @@ -3,6 +3,8 @@ sni_server --SKIPIF-- --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- string(%d) "cs.php.net" string(%d) "uk.php.net" diff --git a/ext/openssl/tests/stream_crypto_flags_001.phpt b/ext/openssl/tests/stream_crypto_flags_001.phpt index 1ba930936f..d65220c128 100644 --- a/ext/openssl/tests/stream_crypto_flags_001.phpt +++ b/ext/openssl/tests/stream_crypto_flags_001.phpt @@ -4,6 +4,7 @@ Basic bitwise stream crypto context flag assignment --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) resource(%d) of type (stream) diff --git a/ext/openssl/tests/stream_crypto_flags_002.phpt b/ext/openssl/tests/stream_crypto_flags_002.phpt index e57f2b7069..379736dd81 100644 --- a/ext/openssl/tests/stream_crypto_flags_002.phpt +++ b/ext/openssl/tests/stream_crypto_flags_002.phpt @@ -4,7 +4,7 @@ TLSv1.1 and TLSv1.2 bitwise stream crypto flag assignment --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) resource(%d) of type (stream) diff --git a/ext/openssl/tests/stream_crypto_flags_004.phpt b/ext/openssl/tests/stream_crypto_flags_004.phpt index e51a2bab3e..8ebeb9a304 100644 --- a/ext/openssl/tests/stream_crypto_flags_004.phpt +++ b/ext/openssl/tests/stream_crypto_flags_004.phpt @@ -4,6 +4,7 @@ Specific protocol method specification --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) bool(false) diff --git a/ext/openssl/tests/stream_server_reneg_limit.phpt b/ext/openssl/tests/stream_server_reneg_limit.phpt index d355505e54..f0353351a2 100644 --- a/ext/openssl/tests/stream_server_reneg_limit.phpt +++ b/ext/openssl/tests/stream_server_reneg_limit.phpt @@ -7,7 +7,7 @@ if (!function_exists("proc_open")) die("skip no proc_open"); exec('openssl help', $out, $code); if ($code > 0) die("skip couldn't locate openssl binary"); if(substr(PHP_OS, 0, 3) == 'WIN') { - die('skip not suitable for Windows'); + die('skip not suitable for Windows'); } ?> --FILE-- @@ -85,5 +85,6 @@ CODE; include 'ServerClientTestCase.inc'; ServerClientTestCase::getInstance()->run($serverCode, $clientCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/stream_verify_peer_name_001.phpt b/ext/openssl/tests/stream_verify_peer_name_001.phpt index 4aecf8c744..e39994b12f 100644 --- a/ext/openssl/tests/stream_verify_peer_name_001.phpt +++ b/ext/openssl/tests/stream_verify_peer_name_001.phpt @@ -4,6 +4,7 @@ Verify host name by default in client transfers --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/stream_verify_peer_name_002.phpt b/ext/openssl/tests/stream_verify_peer_name_002.phpt index cfee8b1c07..01081bf5a0 100644 --- a/ext/openssl/tests/stream_verify_peer_name_002.phpt +++ b/ext/openssl/tests/stream_verify_peer_name_002.phpt @@ -4,6 +4,7 @@ Allow host name mismatch when "verify_host" disabled --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) diff --git a/ext/openssl/tests/stream_verify_peer_name_003.phpt b/ext/openssl/tests/stream_verify_peer_name_003.phpt index e4e083f7f6..3865453262 100644 --- a/ext/openssl/tests/stream_verify_peer_name_003.phpt +++ b/ext/openssl/tests/stream_verify_peer_name_003.phpt @@ -4,6 +4,7 @@ Host name mismatch triggers error --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Warning: stream_socket_client(): Peer certificate CN=`bug54992.local' did not match expected CN=`127.0.0.1' in %s on line %d diff --git a/ext/openssl/tests/streams_crypto_method.phpt b/ext/openssl/tests/streams_crypto_method.phpt index f8ec86498d..19d08f38a3 100644 --- a/ext/openssl/tests/streams_crypto_method.phpt +++ b/ext/openssl/tests/streams_crypto_method.phpt @@ -4,7 +4,7 @@ Specific crypto method for ssl:// transports. --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- Hello World! diff --git a/ext/openssl/tests/tlsv1.0_wrapper.phpt b/ext/openssl/tests/tlsv1.0_wrapper.phpt index c0477dfe32..952a288305 100644 --- a/ext/openssl/tests/tlsv1.0_wrapper.phpt +++ b/ext/openssl/tests/tlsv1.0_wrapper.phpt @@ -4,6 +4,7 @@ tlsv1.0 stream wrapper --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) bool(false) diff --git a/ext/openssl/tests/tlsv1.1_wrapper.phpt b/ext/openssl/tests/tlsv1.1_wrapper.phpt index a5dba299ec..eedf54fea7 100644 --- a/ext/openssl/tests/tlsv1.1_wrapper.phpt +++ b/ext/openssl/tests/tlsv1.1_wrapper.phpt @@ -4,7 +4,7 @@ tlsv1.1 stream wrapper --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) bool(false) diff --git a/ext/openssl/tests/tlsv1.2_wrapper.phpt b/ext/openssl/tests/tlsv1.2_wrapper.phpt index 42980cf661..3d7b3ba26c 100644 --- a/ext/openssl/tests/tlsv1.2_wrapper.phpt +++ b/ext/openssl/tests/tlsv1.2_wrapper.phpt @@ -4,7 +4,7 @@ tlsv1.2 stream wrapper --FILE-- run($clientCode, $serverCode); +?> --EXPECTF-- resource(%d) of type (stream) bool(false) -- 2.40.0