Crypt/Base: fix bug with openssl non-continuous CTR mode

This commit is contained in:
terrafrost 2014-12-31 23:38:55 -06:00
parent dffde1fffc
commit 7b58268d58

View File

@ -1335,8 +1335,9 @@ class Crypt_Base
} }
} else if (!strlen($buffer['ciphertext'])) { } else if (!strlen($buffer['ciphertext'])) {
$ciphertext.= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); $ciphertext.= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV);
$temp = $this->_string_pop($ciphertext, $block_size);
if ($this->continuousBuffer) { if ($this->continuousBuffer) {
$encryptIV = $this->_string_pop($ciphertext, $block_size); $encryptIV = $temp;
} }
} }
if ($this->continuousBuffer) { if ($this->continuousBuffer) {