mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 02:35:10 +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);
|
||||
}
|
||||
|
||||
@ -515,4 +517,4 @@ class Crypt_RC4 {
|
||||
}
|
||||
|
||||
// vim: ts=4:sw=4:et:
|
||||
// vim6: fdl=1:
|
||||
// vim6: fdl=1:
|
Loading…
Reference in New Issue
Block a user