diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
commit | f8d795820e780a6322e054c26c581570613c14f0 (patch) | |
tree | 99d3ae01ce564752807341c5743863b4c92513f8 /ext/openssl | |
parent | d2cb200e10ada6fa44c54a29292bb4665728fff0 (diff) | |
download | php-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz |
Reindent phpt files
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/tests/bug28382.phpt | 6 | ||||
-rw-r--r-- | ext/openssl/tests/bug55646.phpt | 2 | ||||
-rw-r--r-- | ext/openssl/tests/bug60632.phpt | 10 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_csr_get_public_key_basic.phpt | 2 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_csr_get_subject_basic.phpt | 2 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_decrypt_ccm.phpt | 6 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_decrypt_gcm.phpt | 6 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_error_string_basic.phpt | 22 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_pkcs7_verify_basic.phpt | 12 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_pkey_new_basic.phpt | 2 | ||||
-rw-r--r-- | ext/openssl/tests/openssl_pkey_new_error.phpt | 2 | ||||
-rw-r--r-- | ext/openssl/tests/sni_server_key_cert.phpt | 46 | ||||
-rw-r--r-- | ext/openssl/tests/stream_security_level.phpt | 38 |
13 files changed, 78 insertions, 78 deletions
diff --git a/ext/openssl/tests/bug28382.phpt b/ext/openssl/tests/bug28382.phpt index f64e77dbd2..3d8cb528ba 100644 --- a/ext/openssl/tests/bug28382.phpt +++ b/ext/openssl/tests/bug28382.phpt @@ -10,9 +10,9 @@ $cert = file_get_contents(__DIR__ . "/bug28382cert.txt"); $ext = openssl_x509_parse($cert); var_dump($ext['extensions']); /* openssl 1.0 prepends the string "Full Name:" to the crlDistributionPoints array key. - For now, as this is the one difference only between 0.9.x and 1.x, it's handled with - placeholders to not to duplicate the test. When more diffs come, a duplication would - be probably a better solution. + For now, as this is the one difference only between 0.9.x and 1.x, it's handled with + placeholders to not to duplicate the test. When more diffs come, a duplication would + be probably a better solution. */ ?> --EXPECTF-- diff --git a/ext/openssl/tests/bug55646.phpt b/ext/openssl/tests/bug55646.phpt index a7e4152779..9de5359008 100644 --- a/ext/openssl/tests/bug55646.phpt +++ b/ext/openssl/tests/bug55646.phpt @@ -36,7 +36,7 @@ $csr_res = openssl_csr_new( if (!$csr_res) { while ($e = openssl_error_string()) { $err = $e; - } + } die("Failed; last error: $err"); } openssl_csr_export($csr_res, $csr); diff --git a/ext/openssl/tests/bug60632.phpt b/ext/openssl/tests/bug60632.phpt index eb51276fa5..5993229a00 100644 --- a/ext/openssl/tests/bug60632.phpt +++ b/ext/openssl/tests/bug60632.phpt @@ -8,11 +8,11 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded"); <?php $pkey = openssl_pkey_new(array( - 'digest_alg' => 'sha256', - 'private_key_bits' => 1024, - 'private_key_type' => OPENSSL_KEYTYPE_RSA, - 'encrypt_key' => false, - 'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf', + 'digest_alg' => 'sha256', + 'private_key_bits' => 1024, + 'private_key_type' => OPENSSL_KEYTYPE_RSA, + 'encrypt_key' => false, + 'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf', )); $details = openssl_pkey_get_details($pkey); $test_pubkey = $details['key']; 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 866eeae169..185e46539e 100644 --- a/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt +++ b/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt @@ -13,7 +13,7 @@ $phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' . '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( diff --git a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt index 87ab824f35..8ebc51cc50 100644 --- a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt +++ b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt @@ -13,7 +13,7 @@ $phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' . '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( diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt index a5f01b87ce..87b6d4b264 100644 --- a/ext/openssl/tests/openssl_decrypt_ccm.phpt +++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt @@ -22,13 +22,13 @@ foreach ($tests as $idx => $test) { // no IV var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - NULL, $test['tag'], $test['aad'])); + NULL, $test['tag'], $test['aad'])); // failed because no AAD var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $test['tag'])); + $test['iv'], $test['tag'])); // failed because wrong tag var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], str_repeat('x', 10), $test['aad'])); + $test['iv'], str_repeat('x', 10), $test['aad'])); ?> --EXPECTF-- diff --git a/ext/openssl/tests/openssl_decrypt_gcm.phpt b/ext/openssl/tests/openssl_decrypt_gcm.phpt index f03c4d2468..5c243a8fad 100644 --- a/ext/openssl/tests/openssl_decrypt_gcm.phpt +++ b/ext/openssl/tests/openssl_decrypt_gcm.phpt @@ -22,13 +22,13 @@ foreach ($tests as $idx => $test) { // no IV var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - NULL, $test['tag'], $test['aad'])); + NULL, $test['tag'], $test['aad'])); // failed because no AAD var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], $test['tag'])); + $test['iv'], $test['tag'])); // failed because wrong tag var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA, - $test['iv'], str_repeat('x', 16), $test['aad'])); + $test['iv'], str_repeat('x', 16), $test['aad'])); ?> --EXPECTF-- diff --git a/ext/openssl/tests/openssl_error_string_basic.phpt b/ext/openssl/tests/openssl_error_string_basic.phpt index 3e3bbd03af..12875392f4 100644 --- a/ext/openssl/tests/openssl_error_string_basic.phpt +++ b/ext/openssl/tests/openssl_error_string_basic.phpt @@ -9,15 +9,15 @@ function expect_openssl_errors($name, $expected_error_codes) { $expected_errors = array_fill_keys($expected_error_codes, false); $all_errors = array(); while (($error_string = openssl_error_string()) !== false) { - if (preg_match(",.+:([0-9A-F]+):.+,", $error_string, $m) > 0) { + if (preg_match(",.+:([0-9A-F]+):.+,", $error_string, $m) > 0) { $error_code = $m[1]; if (isset($expected_errors[$error_code])) { $expected_errors[$error_code] = true; } - $all_errors[$error_code] = $error_string; + $all_errors[$error_code] = $error_string; } else { - $all_errors[] = $error_string; - } + $all_errors[] = $error_string; + } } $fail = false; @@ -31,12 +31,12 @@ function expect_openssl_errors($name, $expected_error_codes) { if (!$fail) { echo "$name: ok\n"; } else { - echo "$name: uncaught errors\n"; - foreach ($all_errors as $code => $str) { - if (!isset($expected_errors[$code]) || !$expected_errors[$code]) { - echo "\t", $code, ": ", $str, "\n"; - } - } + echo "$name: uncaught errors\n"; + foreach ($all_errors as $code => $str) { + if (!isset($expected_errors[$code]) || !$expected_errors[$code]) { + echo "\t", $code, ": ", $str, "\n"; + } + } } } @@ -78,7 +78,7 @@ var_dump($enc_error); var_dump(openssl_error_string()); // internally OpenSSL ERR won't save more than 15 (16 - 1) errors so lets test it for ($i = 0; $i < 20; $i++) { - openssl_encrypt($data, $method, $enc_key); + openssl_encrypt($data, $method, $enc_key); } $error_queue_size = 0; while (($enc_error_new = openssl_error_string()) !== false) { diff --git a/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt b/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt index 699253f789..63b181e588 100644 --- a/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt @@ -6,12 +6,12 @@ openssl_pkcs7_verify() tests <?php $outfile = tempnam(sys_get_temp_dir(), "ssl"); if ($outfile === false) { - die("failed to get a temporary filename!"); + die("failed to get a temporary filename!"); } $contentfile = tempnam(sys_get_temp_dir(), "ssl"); if ($contentfile === false) { - die("failed to get a temporary filename!"); + die("failed to get a temporary filename!"); } $pkcsfile = __DIR__ . "/openssl_pkcs7_verify__pkcsfile.tmp"; @@ -30,13 +30,13 @@ var_dump(openssl_pkcs7_verify($eml, PKCS7_NOVERIFY, $outfile, $cainfo, $outfile, var_dump(file_get_contents($pkcsfile)); if (file_exists($outfile)) { - echo "true\n"; - unlink($outfile); + echo "true\n"; + unlink($outfile); } if (file_exists($contentfile)) { - echo "true\n"; - unlink($contentfile); + echo "true\n"; + unlink($contentfile); } ?> --CLEAN-- diff --git a/ext/openssl/tests/openssl_pkey_new_basic.phpt b/ext/openssl/tests/openssl_pkey_new_basic.phpt index 41e67b2a04..b2c37f6a87 100644 --- a/ext/openssl/tests/openssl_pkey_new_basic.phpt +++ b/ext/openssl/tests/openssl_pkey_new_basic.phpt @@ -5,7 +5,7 @@ openssl_pkey_new() basic usage tests --FILE-- <?php function openssl_pkey_test_cmp($expected, $bin_key) { - var_dump(strcasecmp(ltrim($expected, '0'), bin2hex($bin_key))); + var_dump(strcasecmp(ltrim($expected, '0'), bin2hex($bin_key))); } // RSA diff --git a/ext/openssl/tests/openssl_pkey_new_error.phpt b/ext/openssl/tests/openssl_pkey_new_error.phpt index 9249f252d8..7fada8239a 100644 --- a/ext/openssl/tests/openssl_pkey_new_error.phpt +++ b/ext/openssl/tests/openssl_pkey_new_error.phpt @@ -5,7 +5,7 @@ openssl_pkey_new() error tests --FILE-- <?php /* openssl_pkey_get_details() segfaults when getting the information - from openssl_pkey_new() with an empty sub-array arg */ + from openssl_pkey_new() with an empty sub-array arg */ $rsa = array("rsa" => array()); $dsa = array("dsa" => array()); diff --git a/ext/openssl/tests/sni_server_key_cert.phpt b/ext/openssl/tests/sni_server_key_cert.phpt index 58cf3d741d..77a9d39f44 100644 --- a/ext/openssl/tests/sni_server_key_cert.phpt +++ b/ext/openssl/tests/sni_server_key_cert.phpt @@ -8,31 +8,31 @@ if (!function_exists("proc_open")) die("skip no proc_open"); --FILE-- <?php $serverCode = <<<'CODE' - $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; - $ctx = stream_context_create(['ssl' => [ - 'local_cert' => __DIR__ . '/domain1.pem', - 'SNI_server_certs' => [ - "cs.php.net" => [ - 'local_cert' => __DIR__ . "/sni_server_cs_cert.pem", - 'local_pk' => __DIR__ . "/sni_server_cs_key.pem" - ], - "uk.php.net" => [ - 'local_cert' => __DIR__ . "/sni_server_uk_cert.pem", - 'local_pk' => __DIR__ . "/sni_server_uk_key.pem" - ], - "us.php.net" => [ - 'local_cert' => __DIR__ . "/sni_server_us_cert.pem", - 'local_pk' => __DIR__ . "/sni_server_us_key.pem" - ], - ] - ]]); + $flags = STREAM_SERVER_BIND|STREAM_SERVER_LISTEN; + $ctx = stream_context_create(['ssl' => [ + 'local_cert' => __DIR__ . '/domain1.pem', + 'SNI_server_certs' => [ + "cs.php.net" => [ + 'local_cert' => __DIR__ . "/sni_server_cs_cert.pem", + 'local_pk' => __DIR__ . "/sni_server_cs_key.pem" + ], + "uk.php.net" => [ + 'local_cert' => __DIR__ . "/sni_server_uk_cert.pem", + 'local_pk' => __DIR__ . "/sni_server_uk_key.pem" + ], + "us.php.net" => [ + 'local_cert' => __DIR__ . "/sni_server_us_cert.pem", + 'local_pk' => __DIR__ . "/sni_server_us_key.pem" + ], + ] + ]]); - $server = stream_socket_server('tls://127.0.0.1:64321', $errno, $errstr, $flags, $ctx); - phpt_notify(); + $server = stream_socket_server('tls://127.0.0.1:64321', $errno, $errstr, $flags, $ctx); + phpt_notify(); - for ($i=0; $i < 3; $i++) { - @stream_socket_accept($server, 3); - } + for ($i=0; $i < 3; $i++) { + @stream_socket_accept($server, 3); + } CODE; $clientCode = <<<'CODE' diff --git a/ext/openssl/tests/stream_security_level.phpt b/ext/openssl/tests/stream_security_level.phpt index b47ab97adc..ebb21c5d1a 100644 --- a/ext/openssl/tests/stream_security_level.phpt +++ b/ext/openssl/tests/stream_security_level.phpt @@ -18,33 +18,33 @@ $certFile = __DIR__ . DIRECTORY_SEPARATOR . 'stream_security_level.pem.tmp'; $cacertFile = __DIR__ . DIRECTORY_SEPARATOR . 'stream_security_level-ca.pem.tmp'; $serverCode = <<<'CODE' - $serverUri = "ssl://127.0.0.1:64322"; - $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; - $serverCtx = stream_context_create(['ssl' => [ - 'local_cert' => '%s' - ]]); + $serverUri = "ssl://127.0.0.1:64322"; + $serverFlags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; + $serverCtx = stream_context_create(['ssl' => [ + 'local_cert' => '%s' + ]]); - $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx); - phpt_notify(); + $server = stream_socket_server($serverUri, $errno, $errstr, $serverFlags, $serverCtx); + phpt_notify(); - @stream_socket_accept($server, 1); + @stream_socket_accept($server, 1); CODE; $serverCode = sprintf($serverCode, $certFile); $clientCode = <<<'CODE' - $serverUri = "ssl://127.0.0.1:64322"; - $clientFlags = STREAM_CLIENT_CONNECT; - $clientCtx = stream_context_create(['ssl' => [ - 'security_level' => %d, - 'verify_peer' => true, - 'cafile' => '%s', - 'verify_peer_name' => false - ]]); + $serverUri = "ssl://127.0.0.1:64322"; + $clientFlags = STREAM_CLIENT_CONNECT; + $clientCtx = stream_context_create(['ssl' => [ + 'security_level' => %d, + 'verify_peer' => true, + 'cafile' => '%s', + 'verify_peer_name' => false + ]]); - phpt_wait(); - $client = stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx); + phpt_wait(); + $client = stream_socket_client($serverUri, $errno, $errstr, 1, $clientFlags, $clientCtx); - var_dump($client); + var_dump($client); CODE; $clientCode = sprintf($clientCode, $securityLevel, $cacertFile); |