mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-29 03:45:43 +00:00
Merge branch 'PHP-7.0'
This commit is contained in:
commit
cc5bb8cb8d
2 files changed
+21
No files matched your search
@@ -1218,6 +1218,10 @@ static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size) /*
|
||||
{
|
||||
if (mcrypt_enc_mode_has_iv(td) == 1) {
|
||||
int expected_iv_size = mcrypt_enc_get_iv_size(td);
|
||||
if (expected_iv_size == 0) {
|
||||
/* Algorithm does not use IV, even though mode supports it */
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
if (!iv) {
|
||||
php_error_docref(NULL, E_WARNING,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #70625: mcrypt_encrypt() : won't return data when no IV was specified under RC4
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded("mcrypt")) print "skip"; ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$key = 'secretkey';
|
||||
$ciphertext = mcrypt_encrypt(MCRYPT_ARCFOUR, $key, 'payload', MCRYPT_MODE_STREAM);
|
||||
var_dump(bin2hex($ciphertext));
|
||||
$plaintext = mcrypt_decrypt(MCRYPT_ARCFOUR, $key, $ciphertext, MCRYPT_MODE_STREAM);
|
||||
var_dump($plaintext);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(14) "d5c9a57023d0f1"
|
||||
string(7) "payload"
|
||||
Reference in new issue
Block a user