xref: /PHP-8.0/ext/openssl/tests/bug74099.phpt (revision ded3d984)
1--TEST--
2Bug #74099 Memory leak with openssl_encrypt()
3--SKIPIF--
4<?php
5if (!extension_loaded("openssl")) die("skip");
6?>
7--FILE--
8<?php
9$aad = random_bytes(32);
10$iv = random_bytes(16);
11$key = random_bytes(32);
12
13$plaintext = '';
14$tag = null;
15
16$ciphertext = openssl_encrypt($plaintext, 'aes-256-gcm', $key, \OPENSSL_RAW_DATA, $iv, $tag, $aad);
17var_dump($ciphertext);
18?>
19--EXPECT--
20string(0) ""
21