summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/bug74099.phpt
blob: 6d111052ce9519d7ad0c8f4eeddd22df0b715921 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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) ""