com php-src: rely on provided openssl.cnf to avoid possible failure with system defaults: ext/openssl/tests/001.phpt ext/openssl/tests/o
penssl_free_key.phpt
| From: | Remi Collet | Date: | Mon, 13 Mar 2017 07:17:42 +0000 |
| Subject: | com php-src: rely on provided openssl.cnf to avoid possible failure with system defaults: ext/openssl/tests/001.phpt ext/openssl/tests/o penssl_free_key.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97291@lists.php.net to get a copy of this message | ||
Commit: 1ffb1b95974e1eb3b0aedfb7a4278a89fc7a6326
Author: Remi Collet <remi@php.net> Mon, 13 Mar 2017 08:17:42 +0100
Parents: fbf0e0587f8455525466e6d4ab2c1f0fc24bfe26
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1ffb1b95974e1eb3b0aedfb7a4278a89fc7a6326
Log:
rely on provided openssl.cnf to avoid possible failure with system defaults
Changed paths:
M ext/openssl/tests/001.phpt
M ext/openssl/tests/openssl_free_key.phpt
Diff:
diff --git a/ext/openssl/tests/001.phpt b/ext/openssl/tests/001.phpt
index d62612b..2d0aa90 100644
--- a/ext/openssl/tests/001.phpt
+++ b/ext/openssl/tests/001.phpt
@@ -18,7 +18,8 @@ for ($z = "", $i = 0; $i < 1024; $i++) {
usleep($i);
}
-$privkey = openssl_pkey_new();
+$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR .
'openssl.cnf');
+$privkey = openssl_pkey_new($conf);
if ($privkey === false)
die("failed to create private key");
@@ -30,7 +31,7 @@ if ($key_file_name === false)
echo "Export key to file\n";
-openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase) or die("failed to export to
file $key_file_name");
+openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to
export to file $key_file_name");
echo "Load key from file - array syntax\n";
diff --git a/ext/openssl/tests/openssl_free_key.phpt b/ext/openssl/tests/openssl_free_key.phpt
index 816f7cf..ea79ce7 100644
--- a/ext/openssl/tests/openssl_free_key.phpt
+++ b/ext/openssl/tests/openssl_free_key.phpt
@@ -22,7 +22,8 @@ for ($z = "", $i = 0; $i < 1024; $i++) {
usleep($i);
}
-$privkey = openssl_pkey_new();
+$conf = array('config' => dirname(__FILE__) . DIRECTORY_SEPARATOR .
'openssl.cnf');
+$privkey = openssl_pkey_new($conf);
if ($privkey === false)
die("failed to create private key");
@@ -34,7 +35,7 @@ if ($key_file_name === false)
echo "Export key to file\n";
-openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase) or die("failed to export to
file $key_file_name");
+openssl_pkey_export_to_file($privkey, $key_file_name, $passphrase, $conf) or die("failed to
export to file $key_file_name");
echo "Load key from file - array syntax\n";