Skip to content

Commit 3433070

Browse files
committed
yet two test fixes in openssl in 5.6
1 parent 974dea5 commit 3433070

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ext/openssl/tests/bug60632.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ $pkey = openssl_pkey_new(array(
1010
'digest_alg' => 'sha256',
1111
'private_key_bits' => 1024,
1212
'private_key_type' => OPENSSL_KEYTYPE_RSA,
13-
'encrypt_key' => false
13+
'encrypt_key' => false,
14+
'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf',
1415
));
1516
$details = openssl_pkey_get_details($pkey);
1617
$test_pubkey = $details['key'];

ext/openssl/tests/openssl_pkey_export_basic.phpt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ if (!defined('OPENSSL_KEYTYPE_EC')) die("skip no EC available");
1010
$key = openssl_pkey_get_private('file://' . dirname(__FILE__) . '/private_ec.key');
1111
var_dump($key);
1212

13-
var_dump(openssl_pkey_export($key, $output));
13+
$config_arg = array("config" => __DIR__ . DIRECTORY_SEPARATOR . "openssl.cnf");
14+
15+
var_dump(openssl_pkey_export($key, $output, NULL, $config_arg));
1416
echo $output;
1517

1618
// Load the private key from the exported pem string
1719
$details = openssl_pkey_get_details(openssl_pkey_get_private($output));
1820
var_dump(OPENSSL_KEYTYPE_EC === $details['type']);
1921

2022
// Export key with passphrase
21-
openssl_pkey_export($key, $output, 'passphrase');
23+
openssl_pkey_export($key, $output, 'passphrase', $config_arg);
2224

2325
$details = openssl_pkey_get_details(openssl_pkey_get_private($output, 'passphrase'));
2426
var_dump(OPENSSL_KEYTYPE_EC === $details['type']);
@@ -32,7 +34,7 @@ var_dump($details === openssl_pkey_get_details($pKey));
3234

3335
// Export to file
3436
$tempname = tempnam(sys_get_temp_dir(), 'openssl_ec');
35-
var_dump(openssl_pkey_export_to_file($key, $tempname));
37+
var_dump(openssl_pkey_export_to_file($key, $tempname, NULL, $config_arg));
3638
$details = openssl_pkey_get_details(openssl_pkey_get_private('file://' . $tempname));
3739
var_dump(OPENSSL_KEYTYPE_EC === $details['type']);
3840

0 commit comments

Comments
 (0)