mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-11 10:56:17 +08:00
Add PHP Extension for GmSSL
View http://gmssl.org/docs/php-api.html for more info.
This commit is contained in:
20
php/ext/openssl/tests/bug74099.phpt
Normal file
20
php/ext/openssl/tests/bug74099.phpt
Normal file
@@ -0,0 +1,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);
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(0) ""
|
||||
Reference in New Issue
Block a user