bug74099.phpt 349 B

123456789101112131415161718
  1. --TEST--
  2. Bug #74099 Memory leak with openssl_encrypt()
  3. --EXTENSIONS--
  4. openssl
  5. --FILE--
  6. <?php
  7. $aad = random_bytes(32);
  8. $iv = random_bytes(16);
  9. $key = random_bytes(32);
  10. $plaintext = '';
  11. $tag = null;
  12. $ciphertext = openssl_encrypt($plaintext, 'aes-256-gcm', $key, \OPENSSL_RAW_DATA, $iv, $tag, $aad);
  13. var_dump($ciphertext);
  14. ?>
  15. --EXPECT--
  16. string(0) ""