mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-29 04:23:34 +00:00
RC4: keys were never being set in continuous mode
This commit is contained in:
parent
e7336e6b54
commit
d774476bcf
@ -212,6 +212,8 @@ class Crypt_RC4 {
|
||||
$this->key = $key;
|
||||
|
||||
if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) {
|
||||
mcrypt_generic_init($this->encryptStream, $this->key, '');
|
||||
mcrypt_generic_init($this->decryptStream, $this->key, '');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -352,10 +354,10 @@ class Crypt_RC4 {
|
||||
if ( CRYPT_RC4_MODE == CRYPT_RC4_MODE_MCRYPT ) {
|
||||
$keyStream = $mode == CRYPT_RC4_ENCRYPT ? 'encryptStream' : 'decryptStream';
|
||||
|
||||
if ($this->continuousBuffer) {
|
||||
return mcrypt_generic($this->$keyStream, $text);
|
||||
if (!$this->continuousBuffer) {
|
||||
mcrypt_generic_init($this->$keyStream, $this->key, '');
|
||||
}
|
||||
mcrypt_generic_init($this->$keyStream, $this->key, '');
|
||||
|
||||
return mcrypt_generic($this->$keyStream, $text);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user