xref: /PHP-7.1/ext/openssl/tests/bug60632.phpt (revision 34330700)
1--TEST--
2Bug #60632: openssl_seal fails with AES
3--SKIPIF--
4<?php
5if (!extension_loaded("openssl")) die("skip openssl not loaded");
6?>
7--FILE--
8<?php
9
10$pkey = openssl_pkey_new(array(
11	'digest_alg' => 'sha256',
12	'private_key_bits' => 1024,
13	'private_key_type' => OPENSSL_KEYTYPE_RSA,
14	'encrypt_key' => false,
15	'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf',
16));
17$details = openssl_pkey_get_details($pkey);
18$test_pubkey = $details['key'];
19$pubkey = openssl_pkey_get_public($test_pubkey);
20$encrypted = null;
21$ekeys = array();
22$result = openssl_seal('test phrase', $encrypted, $ekeys, array($pubkey), 'AES-256-CBC');
23echo "Done";
24?>
25--EXPECTF--
26Warning: openssl_seal(): Cipher algorithm requires an IV to be supplied as a sixth parameter in %s on line %d
27Done
28