php-src/ext/openssl/tests/bug74099.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

21 lines
393 B
PHP

--TEST--
Bug #74099 Memory leak with openssl_encrypt()
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$aad = random_bytes(32);
$iv = random_bytes(16);
$key = random_bytes(32);
$plaintext = '';
$tag = null;
$ciphertext = openssl_encrypt($plaintext, 'aes-256-gcm', $key, \OPENSSL_RAW_DATA, $iv, $tag, $aad);
var_dump($ciphertext);
?>
--EXPECT--
string(0) ""