summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/tests/bug28382.phpt2
-rw-r--r--ext/openssl/tests/bug37820.phpt2
-rw-r--r--ext/openssl/tests/bug39217.phpt2
-rw-r--r--ext/openssl/tests/bug41033.phpt4
-rw-r--r--ext/openssl/tests/bug70438.phpt4
-rw-r--r--ext/openssl/tests/bug71917.phpt4
-rw-r--r--ext/openssl/tests/bug73711.phpt2
-rw-r--r--ext/openssl/tests/bug74022.phpt2
-rw-r--r--ext/openssl/tests/openssl_csr_export_to_file_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_csr_get_public_key_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_csr_get_subject_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_csr_new_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_csr_sign_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_free_key.phpt2
-rw-r--r--ext/openssl/tests/openssl_open_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_pkcs12_export_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt10
-rw-r--r--ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt10
-rw-r--r--ext/openssl/tests/openssl_pkcs12_read_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_pkcs7_read_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_pkcs7_sign_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_pkcs7_verify_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_pkey_export_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_pkey_get_details_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_private_decrypt_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_private_encrypt_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_public_decrypt_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_public_encrypt_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_seal_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_sign_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_spki_export_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_spki_export_challenge_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_spki_new_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_spki_verify_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_verify_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_x509_check_private_key_basic.phpt8
-rw-r--r--ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt10
-rw-r--r--ext/openssl/tests/openssl_x509_export_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_x509_export_to_file_basic.phpt6
-rw-r--r--ext/openssl/tests/openssl_x509_fingerprint_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_x509_free_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_x509_parse_basic.phpt2
-rw-r--r--ext/openssl/tests/openssl_x509_read_basic.phpt4
-rw-r--r--ext/openssl/tests/openssl_x509_verify.phpt10
46 files changed, 95 insertions, 95 deletions
diff --git a/ext/openssl/tests/bug28382.phpt b/ext/openssl/tests/bug28382.phpt
index 1ff839bf4c..f64e77dbd2 100644
--- a/ext/openssl/tests/bug28382.phpt
+++ b/ext/openssl/tests/bug28382.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
-$cert = file_get_contents(dirname(__FILE__) . "/bug28382cert.txt");
+$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.
diff --git a/ext/openssl/tests/bug37820.phpt b/ext/openssl/tests/bug37820.phpt
index 9eb27fa0f0..e5a0fd599a 100644
--- a/ext/openssl/tests/bug37820.phpt
+++ b/ext/openssl/tests/bug37820.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
-$dir = dirname(__FILE__);
+$dir = __DIR__;
$file_pub = $dir . '/bug37820cert.pem';
$file_key = $dir . '/bug37820key.pem';
diff --git a/ext/openssl/tests/bug39217.phpt b/ext/openssl/tests/bug39217.phpt
index b9c5e50a73..a1b20233e9 100644
--- a/ext/openssl/tests/bug39217.phpt
+++ b/ext/openssl/tests/bug39217.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
-$dir = dirname(__FILE__);
+$dir = __DIR__;
$certs = array('bug39217cert2.txt', 'bug39217cert1.txt');
foreach($certs as $cert) {
$res = openssl_x509_parse(file_get_contents($dir . '/' . $cert));
diff --git a/ext/openssl/tests/bug41033.phpt b/ext/openssl/tests/bug41033.phpt
index 6f8ebc64c3..d4b372f8c0 100644
--- a/ext/openssl/tests/bug41033.phpt
+++ b/ext/openssl/tests/bug41033.phpt
@@ -6,8 +6,8 @@ if (!extension_loaded("openssl")) die("skip, openssl required");
?>
--FILE--
<?php
-$prv = 'file://' . dirname(__FILE__) . '/' . 'bug41033.pem';
-$pub = 'file://' . dirname(__FILE__) . '/' . 'bug41033pub.pem';
+$prv = 'file://' . __DIR__ . '/' . 'bug41033.pem';
+$pub = 'file://' . __DIR__ . '/' . 'bug41033pub.pem';
$prkeyid = openssl_get_privatekey($prv, "1234");
diff --git a/ext/openssl/tests/bug70438.phpt b/ext/openssl/tests/bug70438.phpt
index e25c37168b..44d5338264 100644
--- a/ext/openssl/tests/bug70438.phpt
+++ b/ext/openssl/tests/bug70438.phpt
@@ -11,8 +11,8 @@ if (!in_array('AES-128-CBC', openssl_get_cipher_methods(true))) {
<?php
$data = "openssl_seal() test";
$cipher = 'AES-128-CBC';
-$pub_key = "file://" . dirname(__FILE__) . "/public.key";
-$priv_key = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$pub_key = "file://" . __DIR__ . "/public.key";
+$priv_key = "file://" . __DIR__ . "/private_rsa_1024.key";
openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key), $cipher);
openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key), 'sparkles', $iv);
diff --git a/ext/openssl/tests/bug71917.phpt b/ext/openssl/tests/bug71917.phpt
index c7f91dbb55..a68cf0162c 100644
--- a/ext/openssl/tests/bug71917.phpt
+++ b/ext/openssl/tests/bug71917.phpt
@@ -7,8 +7,8 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded");
--FILE--
<?php
function test($envkey) {
- $publicKey = "file://" . dirname(__FILE__) . "/public.key";
- $privateKey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+ $publicKey = "file://" . __DIR__ . "/public.key";
+ $privateKey = "file://" . __DIR__ . "/private_rsa_1024.key";
openssl_public_encrypt($envkey, $envelope, $publicKey);
$sealed = openssl_encrypt(
'plaintext',
diff --git a/ext/openssl/tests/bug73711.phpt b/ext/openssl/tests/bug73711.phpt
index 791eec99c6..c5f5575e2c 100644
--- a/ext/openssl/tests/bug73711.phpt
+++ b/ext/openssl/tests/bug73711.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded");
?>
--FILE--
<?php
-$cnf = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'bug73711.cnf';
+$cnf = __DIR__ . DIRECTORY_SEPARATOR . 'bug73711.cnf';
var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DSA, 'config' => $cnf]));
var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DH, 'config' => $cnf]));
echo "DONE";
diff --git a/ext/openssl/tests/bug74022.phpt b/ext/openssl/tests/bug74022.phpt
index e3ec128fdf..1bd2116241 100644
--- a/ext/openssl/tests/bug74022.phpt
+++ b/ext/openssl/tests/bug74022.phpt
@@ -6,7 +6,7 @@ if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
-$pfx = dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug74022.pfx";
+$pfx = __DIR__ . DIRECTORY_SEPARATOR . "bug74022.pfx";
$cert_store = file_get_contents($pfx);
var_dump(openssl_pkcs12_read($cert_store, $cert_info, "csos"));
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 ccbd00f49a..7404bd28e3 100644
--- a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt
+++ b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt
@@ -4,7 +4,7 @@ openssl_csr_export_to_file() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$csrfile = dirname(__FILE__) . "/openssl_csr_export_to_file_csr.tmp";
+$csrfile = __DIR__ . "/openssl_csr_export_to_file_csr.tmp";
$wrong = "wrong";
$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
$phex = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61e' .
@@ -32,7 +32,7 @@ $args = array(
"config" => $config,
);
-$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key';
+$privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key';
$csr = openssl_csr_new($dn, $privkey_file, $args);
var_dump(openssl_csr_export_to_file($csr, $csrfile));
var_dump(file_get_contents($csrfile));
@@ -43,7 +43,7 @@ var_dump(openssl_csr_export_to_file($csr, $csrfile, false));
?>
--CLEAN--
<?php
-$csrfile = dirname(__FILE__) . "/openssl_csr_export_to_file_csr.tmp";
+$csrfile = __DIR__ . "/openssl_csr_export_to_file_csr.tmp";
if (file_exists($csrfile)) {
unlink($csrfile);
}
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 1958350dfb..866eeae169 100644
--- a/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt
+++ b/ext/openssl/tests/openssl_csr_get_public_key_basic.phpt
@@ -32,9 +32,9 @@ $args = array(
"config" => $config,
);
-$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key';
+$privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key';
$csr = openssl_csr_new($dn, $privkey_file, $args);
-$csr_file = file_get_contents(dirname(__FILE__) . '/cert.csr');
+$csr_file = file_get_contents(__DIR__ . '/cert.csr');
var_dump(openssl_csr_get_public_key($csr));
var_dump(openssl_csr_get_public_key($csr_file));
diff --git a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt
index eba4a7ac8d..87ab824f35 100644
--- a/ext/openssl/tests/openssl_csr_get_subject_basic.phpt
+++ b/ext/openssl/tests/openssl_csr_get_subject_basic.phpt
@@ -32,9 +32,9 @@ $args = array(
"config" => $config,
);
-$privkey_file = 'file://' . dirname(__FILE__) . '/private_rsa_2048.key';
+$privkey_file = 'file://' . __DIR__ . '/private_rsa_2048.key';
$csr = openssl_csr_new($dn, $privkey_file, $args);
-$csr_file = file_get_contents(dirname(__FILE__) . '/cert.csr');
+$csr_file = file_get_contents(__DIR__ . '/cert.csr');
var_dump(openssl_csr_get_subject($csr_file));
var_dump(openssl_csr_get_subject($csr, false));
diff --git a/ext/openssl/tests/openssl_csr_new_basic.phpt b/ext/openssl/tests/openssl_csr_new_basic.phpt
index 816c6f9d90..83a056b061 100644
--- a/ext/openssl/tests/openssl_csr_new_basic.phpt
+++ b/ext/openssl/tests/openssl_csr_new_basic.phpt
@@ -10,7 +10,7 @@ var_dump(openssl_csr_new(1,$a));
var_dump(openssl_csr_new(1,$a,1,1));
$a = array();
-$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf');
+$conf = array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf');
var_dump(openssl_csr_new(array(), $a, $conf, array()));
// this leaks
diff --git a/ext/openssl/tests/openssl_csr_sign_basic.phpt b/ext/openssl/tests/openssl_csr_sign_basic.phpt
index 57c9e75c0e..969a8e1073 100644
--- a/ext/openssl/tests/openssl_csr_sign_basic.phpt
+++ b/ext/openssl/tests/openssl_csr_sign_basic.phpt
@@ -4,10 +4,10 @@ openssl_csr_sign() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$cert = "file://" . dirname(__FILE__) . "/cert.crt";
-$priv = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$cert = "file://" . __DIR__ . "/cert.crt";
+$priv = "file://" . __DIR__ . "/private_rsa_1024.key";
$wrong = "wrong";
-$pub = "file://" . dirname(__FILE__) . "/public.key";
+$pub = "file://" . __DIR__ . "/public.key";
$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
$config_arg = array('config' => $config);
diff --git a/ext/openssl/tests/openssl_free_key.phpt b/ext/openssl/tests/openssl_free_key.phpt
index aa4a3a8a35..0c8bdd92de 100644
--- a/ext/openssl/tests/openssl_free_key.phpt
+++ b/ext/openssl/tests/openssl_free_key.phpt
@@ -21,7 +21,7 @@ for ($z = "", $i = 0; $i < 1024; $i++) {
usleep($i);
}
-$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'openssl.cnf');
+$conf = array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf');
$privkey = openssl_pkey_new($conf);
if ($privkey === false)
diff --git a/ext/openssl/tests/openssl_open_basic.phpt b/ext/openssl/tests/openssl_open_basic.phpt
index 55bb9eb0e3..d564bcf8e8 100644
--- a/ext/openssl/tests/openssl_open_basic.phpt
+++ b/ext/openssl/tests/openssl_open_basic.phpt
@@ -5,8 +5,8 @@ openssl_open() tests
--FILE--
<?php
$data = "openssl_open() test";
-$pub_key = "file://" . dirname(__FILE__) . "/public.key";
-$priv_key = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$pub_key = "file://" . __DIR__ . "/public.key";
+$priv_key = "file://" . __DIR__ . "/private_rsa_1024.key";
$wrong = "wrong";
openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key, $pub_key));
diff --git a/ext/openssl/tests/openssl_pkcs12_export_basic.phpt b/ext/openssl/tests/openssl_pkcs12_export_basic.phpt
index 65692cfe92..08e56d92a5 100644
--- a/ext/openssl/tests/openssl_pkcs12_export_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs12_export_basic.phpt
@@ -4,17 +4,17 @@ openssl_pkcs12_export() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$cert_file = dirname(__FILE__) . "/public.crt";
+$cert_file = __DIR__ . "/public.crt";
$cert = file_get_contents($cert_file);
$cert_path = "file://" . $cert_file;
-$priv_file = dirname(__FILE__) . "/private.crt";
+$priv_file = __DIR__ . "/private.crt";
$priv = file_get_contents($priv_file);
$priv_path = "file://" . $priv_file;
$cert_res = openssl_x509_read($cert);
$priv_res = openssl_pkey_get_private($priv);
$pass = "test";
$invalid = "";
-$invalid_path = dirname(__FILE__) . "/invalid_path";
+$invalid_path = __DIR__ . "/invalid_path";
$opts = [];
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass)); // read certs as a string
diff --git a/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt b/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt
index a360591b12..ccc9104d34 100644
--- a/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt
@@ -4,19 +4,19 @@ openssl_pkcs12_export_to_file() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
+$pkcsfile = __DIR__ . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
-$cert_file = dirname(__FILE__) . "/public.crt";
+$cert_file = __DIR__ . "/public.crt";
$cert = file_get_contents($cert_file);
$cert_path = "file://" . $cert_file;
-$priv_file = dirname(__FILE__) . "/private.crt";
+$priv_file = __DIR__ . "/private.crt";
$priv = file_get_contents($priv_file);
$priv_path = "file://" . $priv_file;
$cert_res = openssl_x509_read($cert);
$priv_res = openssl_pkey_get_private($priv);
$pass = "test";
$invalid = "";
-$invalid_path = dirname(__FILE__) . "/invalid_path";
+$invalid_path = __DIR__ . "/invalid_path";
$opts = [];
var_dump(openssl_pkcs12_export_to_file($cert, $pkcsfile, $priv, $pass));
@@ -34,7 +34,7 @@ var_dump(openssl_pkcs12_export_to_file($priv_res, $pkcsfile, $cert_res, $pass));
?>
--CLEAN--
<?php
-$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
+$pkcsfile = __DIR__ . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
if (file_exists($pkcsfile)) {
unlink($pkcsfile);
}
diff --git a/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt b/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt
index f1e72d358e..407eb3aacd 100644
--- a/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt
+++ b/ext/openssl/tests/openssl_pkcs12_export_to_file_error.phpt
@@ -4,14 +4,14 @@ openssl_pkcs12_export_to_file() error tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
+$pkcsfile = __DIR__ . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
-$cert_file = dirname(__FILE__) . "/public.crt";
+$cert_file = __DIR__ . "/public.crt";
$cert = file_get_contents($cert_file);
$cert_path = "file://" . $cert_file;
-$priv_file = dirname(__FILE__) . "/private.crt";
+$priv_file = __DIR__ . "/private.crt";
$priv = file_get_contents($priv_file);
-$wrong_priv_file = dirname(__FILE__) . "/private_rsa_1024.key";
+$wrong_priv_file = __DIR__ . "/private_rsa_1024.key";
$wrong_priv = file_get_contents($wrong_priv_file);
$pass = 'test';
@@ -21,7 +21,7 @@ var_dump(openssl_pkcs12_export_to_file($cert, '.', $priv, $pass));
?>
--CLEAN--
<?php
-$pkcsfile = dirname(__FILE__) . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
+$pkcsfile = __DIR__ . "/openssl_pkcs12_export_to_file__pkcsfile.tmp";
if (file_exists($pkcsfile)) {
unlink($pkcsfile);
}
diff --git a/ext/openssl/tests/openssl_pkcs12_read_basic.phpt b/ext/openssl/tests/openssl_pkcs12_read_basic.phpt
index 24d038970d..b81b4d9dac 100644
--- a/ext/openssl/tests/openssl_pkcs12_read_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs12_read_basic.phpt
@@ -4,7 +4,7 @@ openssl_pkcs12_read() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$p12_file = dirname(__FILE__) . "/p12_with_extra_certs.p12";
+$p12_file = __DIR__ . "/p12_with_extra_certs.p12";
$p12 = file_get_contents($p12_file);
$certs = array();
$pass = "qwerty";
diff --git a/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt b/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt
index 623126fc59..937180a22e 100644
--- a/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs7_decrypt_basic.phpt
@@ -4,8 +4,8 @@ openssl_pkcs7_decrypt() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$infile = dirname(__FILE__) . "/cert.crt";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$infile = __DIR__ . "/cert.crt";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
$encrypted = tempnam(sys_get_temp_dir(), "ssl");
if ($encrypted === false)
die("failed to get a temporary filename!");
@@ -15,7 +15,7 @@ if ($outfile === false) {
die("failed to get a temporary filename!");
}
-$single_cert = "file://" . dirname(__FILE__) . "/cert.crt";
+$single_cert = "file://" . __DIR__ . "/cert.crt";
$headers = array("test@test", "testing openssl_pkcs7_encrypt()");
$wrong = "wrong";
$empty = "";
diff --git a/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt b/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt
index 2132b402aa..f823462f9e 100644
--- a/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs7_encrypt_basic.phpt
@@ -4,7 +4,7 @@ openssl_pkcs7_encrypt() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$infile = dirname(__FILE__) . "/cert.crt";
+$infile = __DIR__ . "/cert.crt";
$outfile = tempnam(sys_get_temp_dir(), "ssl");
if ($outfile === false)
die("failed to get a temporary filename!");
@@ -12,8 +12,8 @@ $outfile2 = tempnam(sys_get_temp_dir(), "ssl");
if ($outfile2 === false)
die("failed to get a temporary filename!");
-$single_cert = "file://" . dirname(__FILE__) . "/cert.crt";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$single_cert = "file://" . __DIR__ . "/cert.crt";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
$multi_certs = array($single_cert, $single_cert);
$assoc_headers = array("To" => "test@test", "Subject" => "testing openssl_pkcs7_encrypt()");
$headers = array("test@test", "testing openssl_pkcs7_encrypt()");
diff --git a/ext/openssl/tests/openssl_pkcs7_read_basic.phpt b/ext/openssl/tests/openssl_pkcs7_read_basic.phpt
index 64c7c2c130..ac3f1ad34f 100644
--- a/ext/openssl/tests/openssl_pkcs7_read_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs7_read_basic.phpt
@@ -4,8 +4,8 @@ openssl_pkcs7_read() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$infile = file_get_contents(dirname(__FILE__) . "/cert.p7b");
-$certfile = file_get_contents(dirname(__FILE__) . "/cert.crt");
+$infile = file_get_contents(__DIR__ . "/cert.p7b");
+$certfile = file_get_contents(__DIR__ . "/cert.crt");
$result = [];
var_dump(openssl_pkcs7_read());
diff --git a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt
index 0e29901c7e..c11e5135f9 100644
--- a/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs7_sign_basic.phpt
@@ -4,14 +4,14 @@ openssl_pkcs7_sign() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$infile = dirname(__FILE__) . "/cert.crt";
+$infile = __DIR__ . "/cert.crt";
$outfile = tempnam(sys_get_temp_dir(), "ssl");
if ($outfile === false) {
die("failed to get a temporary filename!");
}
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
-$single_cert = "file://" . dirname(__FILE__) . "/cert.crt";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
+$single_cert = "file://" . __DIR__ . "/cert.crt";
$assoc_headers = array("To" => "test@test", "Subject" => "testing openssl_pkcs7_sign()");
$headers = array("test@test", "testing openssl_pkcs7_sign()");
$empty_headers = array();
diff --git a/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt b/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt
index f3572491a1..925c28b34c 100644
--- a/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt
+++ b/ext/openssl/tests/openssl_pkcs7_verify_basic.phpt
@@ -14,10 +14,10 @@ if ($contentfile === false) {
die("failed to get a temporary filename!");
}
-$pkcsfile = dirname(__FILE__) . "/openssl_pkcs7_verify__pkcsfile.tmp";
+$pkcsfile = __DIR__ . "/openssl_pkcs7_verify__pkcsfile.tmp";
-$infile = dirname(__FILE__) . "/cert.crt";
-$eml = dirname(__FILE__) . "/signed.eml";
+$infile = __DIR__ . "/cert.crt";
+$eml = __DIR__ . "/signed.eml";
$wrong = "wrong";
$empty = "";
$cainfo = array();
diff --git a/ext/openssl/tests/openssl_pkey_export_basic.phpt b/ext/openssl/tests/openssl_pkey_export_basic.phpt
index 4346b5a6d3..d71f8da9a3 100644
--- a/ext/openssl/tests/openssl_pkey_export_basic.phpt
+++ b/ext/openssl/tests/openssl_pkey_export_basic.phpt
@@ -9,7 +9,7 @@ if (!defined('OPENSSL_KEYTYPE_EC'))
?>
--FILE--
<?php
-$key = openssl_pkey_get_private('file://' . dirname(__FILE__) . '/private_ec.key');
+$key = openssl_pkey_get_private('file://' . __DIR__ . '/private_ec.key');
var_dump($key);
$config_arg = array("config" => __DIR__ . DIRECTORY_SEPARATOR . "openssl.cnf");
@@ -28,7 +28,7 @@ $details = openssl_pkey_get_details(openssl_pkey_get_private($output, 'passphras
var_dump(OPENSSL_KEYTYPE_EC === $details['type']);
// Read public key
-$pKey = openssl_pkey_get_public('file://' . dirname(__FILE__) . '/public_ec.key');
+$pKey = openssl_pkey_get_public('file://' . __DIR__ . '/public_ec.key');
var_dump($pKey);
// The details are the same for a public or private key, expect the private key parameter 'd
$detailsPKey = openssl_pkey_get_details($pKey);
diff --git a/ext/openssl/tests/openssl_pkey_get_details_basic.phpt b/ext/openssl/tests/openssl_pkey_get_details_basic.phpt
index 3c239af2a2..47147436dd 100644
--- a/ext/openssl/tests/openssl_pkey_get_details_basic.phpt
+++ b/ext/openssl/tests/openssl_pkey_get_details_basic.phpt
@@ -7,7 +7,7 @@ if (!defined("OPENSSL_KEYTYPE_EC")) die("skip no EC available");
?>
--FILE--
<?php
-$key = openssl_pkey_get_private("file://" . dirname(__FILE__) . "/private_ec.key");
+$key = openssl_pkey_get_private("file://" . __DIR__ . "/private_ec.key");
print_r(openssl_pkey_get_details($key));
?>
diff --git a/ext/openssl/tests/openssl_private_decrypt_basic.phpt b/ext/openssl/tests/openssl_private_decrypt_basic.phpt
index 76a08b8d55..c318fe89b1 100644
--- a/ext/openssl/tests/openssl_private_decrypt_basic.phpt
+++ b/ext/openssl/tests/openssl_private_decrypt_basic.phpt
@@ -5,8 +5,8 @@ openssl_private_decrypt() tests
--FILE--
<?php
$data = "Testing openssl_public_decrypt()";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
-$pubkey = "file://" . dirname(__FILE__) . "/public.key";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
+$pubkey = "file://" . __DIR__ . "/public.key";
$wrong = "wrong";
openssl_public_encrypt($data, $encrypted, $pubkey);
diff --git a/ext/openssl/tests/openssl_private_encrypt_basic.phpt b/ext/openssl/tests/openssl_private_encrypt_basic.phpt
index 968537c3c3..573e581f22 100644
--- a/ext/openssl/tests/openssl_private_encrypt_basic.phpt
+++ b/ext/openssl/tests/openssl_private_encrypt_basic.phpt
@@ -5,8 +5,8 @@ openssl_private_encrypt() tests
--FILE--
<?php
$data = "Testing openssl_private_encrypt()";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
-$pubkey = "file://" . dirname(__FILE__) . "/public.key";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
+$pubkey = "file://" . __DIR__ . "/public.key";
$wrong = "wrong";
class test {
diff --git a/ext/openssl/tests/openssl_public_decrypt_basic.phpt b/ext/openssl/tests/openssl_public_decrypt_basic.phpt
index 42d72b9cd4..6c6fdc90f8 100644
--- a/ext/openssl/tests/openssl_public_decrypt_basic.phpt
+++ b/ext/openssl/tests/openssl_public_decrypt_basic.phpt
@@ -5,8 +5,8 @@ openssl_public_decrypt() tests
--FILE--
<?php
$data = "Testing openssl_public_decrypt()";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
-$pubkey = "file://" . dirname(__FILE__) . "/public.key";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
+$pubkey = "file://" . __DIR__ . "/public.key";
$wrong = "wrong";
openssl_private_encrypt($data, $encrypted, $privkey);
diff --git a/ext/openssl/tests/openssl_public_encrypt_basic.phpt b/ext/openssl/tests/openssl_public_encrypt_basic.phpt
index 69650a65d9..9db3883b55 100644
--- a/ext/openssl/tests/openssl_public_encrypt_basic.phpt
+++ b/ext/openssl/tests/openssl_public_encrypt_basic.phpt
@@ -5,8 +5,8 @@ openssl_public_encrypt() tests
--FILE--
<?php
$data = "Testing openssl_public_encrypt()";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
-$pubkey = "file://" . dirname(__FILE__) . "/public.key";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
+$pubkey = "file://" . __DIR__ . "/public.key";
$wrong = "wrong";
class test {
diff --git a/ext/openssl/tests/openssl_seal_basic.phpt b/ext/openssl/tests/openssl_seal_basic.phpt
index 1899ebac3b..111bf6f094 100644
--- a/ext/openssl/tests/openssl_seal_basic.phpt
+++ b/ext/openssl/tests/openssl_seal_basic.phpt
@@ -17,7 +17,7 @@ var_dump(openssl_seal($b, $b, $b, ""));
// tests with cert
$data = "openssl_open() test";
-$pub_key = "file://" . dirname(__FILE__) . "/public.key";
+$pub_key = "file://" . __DIR__ . "/public.key";
$wrong = "wrong";
var_dump(openssl_seal($data, $sealed, $ekeys, array($pub_key))); // no output
diff --git a/ext/openssl/tests/openssl_sign_basic.phpt b/ext/openssl/tests/openssl_sign_basic.phpt
index 0200e5ba6e..bb2c403903 100644
--- a/ext/openssl/tests/openssl_sign_basic.phpt
+++ b/ext/openssl/tests/openssl_sign_basic.phpt
@@ -5,7 +5,7 @@ openssl_sign() tests
--FILE--
<?php
$data = "Testing openssl_sign()";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
$wrong = "wrong";
var_dump(openssl_sign($data, $sign, $privkey)); // no output
diff --git a/ext/openssl/tests/openssl_spki_export_basic.phpt b/ext/openssl/tests/openssl_spki_export_basic.phpt
index 8871c1016d..4085d2d5d8 100644
--- a/ext/openssl/tests/openssl_spki_export_basic.phpt
+++ b/ext/openssl/tests/openssl_spki_export_basic.phpt
@@ -12,7 +12,7 @@ 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";
+ $key_file = "file://" . __DIR__ . "/private_rsa_" . $key_size . ".key";
$pkeys[] = openssl_pkey_get_private($key_file);
}
diff --git a/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt b/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt
index 2b947221bb..f44e60ec62 100644
--- a/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt
+++ b/ext/openssl/tests/openssl_spki_export_challenge_basic.phpt
@@ -14,7 +14,7 @@ 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";
+ $key_file = "file://" . __DIR__ . "/private_rsa_" . $key_size . ".key";
$pkeys[] = openssl_pkey_get_private($key_file);
}
diff --git a/ext/openssl/tests/openssl_spki_new_basic.phpt b/ext/openssl/tests/openssl_spki_new_basic.phpt
index 7f9e023618..cb54747fe0 100644
--- a/ext/openssl/tests/openssl_spki_new_basic.phpt
+++ b/ext/openssl/tests/openssl_spki_new_basic.phpt
@@ -11,7 +11,7 @@ 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";
+ $key_file = "file://" . __DIR__ . "/private_rsa_" . $key_size . ".key";
$pkeys[] = openssl_pkey_get_private($key_file);
}
diff --git a/ext/openssl/tests/openssl_spki_verify_basic.phpt b/ext/openssl/tests/openssl_spki_verify_basic.phpt
index 4abfc1798c..c760d0cb83 100644
--- a/ext/openssl/tests/openssl_spki_verify_basic.phpt
+++ b/ext/openssl/tests/openssl_spki_verify_basic.phpt
@@ -13,7 +13,7 @@ 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";
+ $key_file = "file://" . __DIR__ . "/private_rsa_" . $key_size . ".key";
$pkeys[] = openssl_pkey_get_private($key_file);
}
diff --git a/ext/openssl/tests/openssl_verify_basic.phpt b/ext/openssl/tests/openssl_verify_basic.phpt
index a21dfedb01..84d69502bf 100644
--- a/ext/openssl/tests/openssl_verify_basic.phpt
+++ b/ext/openssl/tests/openssl_verify_basic.phpt
@@ -5,8 +5,8 @@ openssl_verify() tests
--FILE--
<?php
$data = "Testing openssl_verify()";
-$privkey = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
-$pubkey = "file://" . dirname(__FILE__) . "/public.key";
+$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
+$pubkey = "file://" . __DIR__ . "/public.key";
$wrong = "wrong";
openssl_sign($data, $sign, $privkey);
diff --git a/ext/openssl/tests/openssl_x509_check_private_key_basic.phpt b/ext/openssl/tests/openssl_x509_check_private_key_basic.phpt
index ca6eac948d..be56ef3066 100644
--- a/ext/openssl/tests/openssl_x509_check_private_key_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_check_private_key_basic.phpt
@@ -4,16 +4,16 @@ openssl_x509_check_private_key() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$fp = fopen(dirname(__FILE__) . "/cert.crt","r");
+$fp = fopen(__DIR__ . "/cert.crt","r");
$a = fread($fp, 8192);
fclose($fp);
-$fp = fopen(dirname(__FILE__) . "/private_rsa_1024.key","r");
+$fp = fopen(__DIR__ . "/private_rsa_1024.key","r");
$b = fread($fp, 8192);
fclose($fp);
-$cert = "file://" . dirname(__FILE__) . "/cert.crt";
-$key = "file://" . dirname(__FILE__) . "/private_rsa_1024.key";
+$cert = "file://" . __DIR__ . "/cert.crt";
+$key = "file://" . __DIR__ . "/private_rsa_1024.key";
var_dump(openssl_x509_check_private_key($cert, $key));
var_dump(openssl_x509_check_private_key("", $key));
diff --git a/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt b/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt
index 9634663556..99b4f0bdff 100644
--- a/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_checkpurpose_basic.phpt
@@ -8,11 +8,11 @@ if (OPENSSL_VERSION_NUMBER < 0x10000000) die("skip Output requires OpenSSL 1.0")
?>
--FILE--
<?php
-$cert = "file://" . dirname(__FILE__) . "/cert.crt";
-$bert = "file://" . dirname(__FILE__) . "/bug41033.pem";
-$sert = "file://" . dirname(__FILE__) . "/san-cert.pem";
-$cpca = dirname(__FILE__) . "/san-ca.pem";
-$utfl = dirname(__FILE__) . "/sni_server_uk.pem";
+$cert = "file://" . __DIR__ . "/cert.crt";
+$bert = "file://" . __DIR__ . "/bug41033.pem";
+$sert = "file://" . __DIR__ . "/san-cert.pem";
+$cpca = __DIR__ . "/san-ca.pem";
+$utfl = __DIR__ . "/sni_server_uk.pem";
$rcrt = openssl_x509_read($cert);
/* int openssl_x509_checkpurpose ( mixed $x509cert , int $purpose); */
diff --git a/ext/openssl/tests/openssl_x509_export_basic.phpt b/ext/openssl/tests/openssl_x509_export_basic.phpt
index 94cb4fa48c..aecf569489 100644
--- a/ext/openssl/tests/openssl_x509_export_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_export_basic.phpt
@@ -4,7 +4,7 @@ openssl_x509_export() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$cert_file = dirname(__FILE__) . "/cert.crt";
+$cert_file = __DIR__ . "/cert.crt";
$a = file_get_contents($cert_file);
$b = "file://" . $cert_file;
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 04e6d9e565..7fb6c02168 100644
--- a/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt
@@ -4,8 +4,8 @@ openssl_x509_export_to_file() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$outfilename = dirname(__FILE__) . "/openssl_x509_export_to_file__outfilename.tmp";
-$cert_file = dirname(__FILE__) . "/cert.crt";
+$outfilename = __DIR__ . "/openssl_x509_export_to_file__outfilename.tmp";
+$cert_file = __DIR__ . "/cert.crt";
$a = file_get_contents($cert_file);
$b = "file://" . $cert_file;
@@ -23,7 +23,7 @@ var_dump($exists = file_exists($outfilename));
?>
--CLEAN--
<?php
-$outfilename = dirname(__FILE__) . "/openssl_x509_export_to_file__outfilename.tmp";
+$outfilename = __DIR__ . "/openssl_x509_export_to_file__outfilename.tmp";
if (file_exists($outfilename)) {
unlink($outfilename);
}
diff --git a/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt b/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt
index ceaafc2234..bc6715f375 100644
--- a/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_fingerprint_basic.phpt
@@ -5,7 +5,7 @@ openssl_x509_fingerprint() tests
--FILE--
<?php
-$cert = "file://" . dirname(__FILE__) . "/cert.crt";
+$cert = "file://" . __DIR__ . "/cert.crt";
echo "** Testing with no parameters **\n";
var_dump(openssl_x509_fingerprint());
diff --git a/ext/openssl/tests/openssl_x509_free_basic.phpt b/ext/openssl/tests/openssl_x509_free_basic.phpt
index 663adccc2c..378b0e5e0a 100644
--- a/ext/openssl/tests/openssl_x509_free_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_free_basic.phpt
@@ -4,7 +4,7 @@ openssl_x509_free() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-var_dump($res = openssl_x509_read("file://" . dirname(__FILE__) . "/cert.crt"));
+var_dump($res = openssl_x509_read("file://" . __DIR__ . "/cert.crt"));
openssl_x509_free($res);
var_dump($res);
openssl_x509_free(false);
diff --git a/ext/openssl/tests/openssl_x509_parse_basic.phpt b/ext/openssl/tests/openssl_x509_parse_basic.phpt
index 8c04b791fc..b80c1f71f1 100644
--- a/ext/openssl/tests/openssl_x509_parse_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_parse_basic.phpt
@@ -4,7 +4,7 @@ openssl_x509_parse() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$cert = "file://" . dirname(__FILE__) . "/cert.crt";
+$cert = "file://" . __DIR__ . "/cert.crt";
$parsedCert = openssl_x509_parse($cert);
var_dump($parsedCert === openssl_x509_parse(openssl_x509_read($cert)));
diff --git a/ext/openssl/tests/openssl_x509_read_basic.phpt b/ext/openssl/tests/openssl_x509_read_basic.phpt
index 062c6bf1cb..f7579c7e81 100644
--- a/ext/openssl/tests/openssl_x509_read_basic.phpt
+++ b/ext/openssl/tests/openssl_x509_read_basic.phpt
@@ -4,11 +4,11 @@ openssl_x509_read() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$fp = fopen(dirname(__FILE__) . "/cert.crt","r");
+$fp = fopen(__DIR__ . "/cert.crt","r");
$a = fread($fp,8192);
fclose($fp);
-$b = "file://" . dirname(__FILE__) . "/cert.crt";
+$b = "file://" . __DIR__ . "/cert.crt";
$c = "invalid cert";
$d = openssl_x509_read($a);
$e = array();
diff --git a/ext/openssl/tests/openssl_x509_verify.phpt b/ext/openssl/tests/openssl_x509_verify.phpt
index 293c004b90..f93a1eab0e 100644
--- a/ext/openssl/tests/openssl_x509_verify.phpt
+++ b/ext/openssl/tests/openssl_x509_verify.phpt
@@ -4,17 +4,17 @@ openssl_x509_verify() tests
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
-$fp = fopen(dirname(__FILE__) . "/cert.crt","r");
+$fp = fopen(__DIR__ . "/cert.crt","r");
$a = fread($fp, 8192);
fclose($fp);
-$fp = fopen(dirname(__FILE__) . "/public.key","r");
+$fp = fopen(__DIR__ . "/public.key","r");
$b = fread($fp, 8192);
fclose($fp);
-$cert = "file://" . dirname(__FILE__) . "/cert.crt";
-$key = "file://" . dirname(__FILE__) . "/public.key";
-$wrongKey = "file://" . dirname(__FILE__) . "/public_rsa_2048.key";
+$cert = "file://" . __DIR__ . "/cert.crt";
+$key = "file://" . __DIR__ . "/public.key";
+$wrongKey = "file://" . __DIR__ . "/public_rsa_2048.key";
var_dump(openssl_x509_verify($cert, $key));
var_dump(openssl_x509_verify("", $key));