xref: /PHP-5.6/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$pkey = openssl_pkey_new(array(
10	'digest_alg' => 'sha256',
11	'private_key_bits' => 1024,
12	'private_key_type' => OPENSSL_KEYTYPE_RSA,
13	'encrypt_key' => false,
14	'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf',
15));
16$details = openssl_pkey_get_details($pkey);
17$test_pubkey = $details['key'];
18$pubkey = openssl_pkey_get_public($test_pubkey);
19$encrypted = null;
20$ekeys = array();
21$result = openssl_seal('test phrase', $encrypted, $ekeys, array($pubkey), 'AES-256-CBC');
22echo "Done";
23?>
24--EXPECTF--
25Warning: openssl_seal(): Ciphers with modes requiring IV are not supported in %s on line %d
26Done
27