summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/bug60632.phpt
blob: a4b473112ba304cc692ad2cb54594d57770f059e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--TEST--
Bug #60632: openssl_seal fails with AES
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
?>
--FILE--
<?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',
));
$details = openssl_pkey_get_details($pkey);
$test_pubkey = $details['key'];
$pubkey = openssl_pkey_get_public($test_pubkey);
$encrypted = null;
$ekeys = array();
$result = openssl_seal('test phrase', $encrypted, $ekeys, array($pubkey), 'AES-256-CBC');
echo "Done";
?>
--EXPECTF--
Warning: openssl_seal(): Ciphers with modes requiring IV are not supported in %s on line %d
Done