mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 11:37:33 +00:00
Crypt/Base: stream ciphers cannot be run in continuous mode with OpenSSL
This commit is contained in:
parent
e3487c8adb
commit
be168e262f
@ -1498,6 +1498,8 @@ class Crypt_Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->continuousBuffer = true;
|
$this->continuousBuffer = true;
|
||||||
|
|
||||||
|
$this->_setEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1520,6 +1522,8 @@ class Crypt_Base
|
|||||||
|
|
||||||
$this->continuousBuffer = false;
|
$this->continuousBuffer = false;
|
||||||
$this->changed = true;
|
$this->changed = true;
|
||||||
|
|
||||||
|
$this->_setEngine();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1534,6 +1538,9 @@ class Crypt_Base
|
|||||||
{
|
{
|
||||||
switch ($engine) {
|
switch ($engine) {
|
||||||
case CRYPT_ENGINE_OPENSSL:
|
case CRYPT_ENGINE_OPENSSL:
|
||||||
|
if ($this->mode == CRYPT_MODE_STREAM && $this->continuousBuffer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
$this->openssl_emulate_ctr = false;
|
$this->openssl_emulate_ctr = false;
|
||||||
$result = $this->cipher_name_openssl &&
|
$result = $this->cipher_name_openssl &&
|
||||||
extension_loaded('openssl') &&
|
extension_loaded('openssl') &&
|
||||||
|
@ -1166,11 +1166,12 @@ class Net_SSH2
|
|||||||
//'none' // OPTIONAL no encryption; NOT RECOMMENDED
|
//'none' // OPTIONAL no encryption; NOT RECOMMENDED
|
||||||
);
|
);
|
||||||
|
|
||||||
if (extension_loaded('openssl')) {
|
if (extension_loaded('openssl') && !extension_loaded('mcrypt')) {
|
||||||
// OpenSSL does not support arcfour256
|
// OpenSSL does not support arcfour256 in any capacity and arcfour128 / arcfour support is limited to
|
||||||
|
// instances that do not use continuous buffers
|
||||||
$encryption_algorithms = array_diff(
|
$encryption_algorithms = array_diff(
|
||||||
$encryption_algorithms,
|
$encryption_algorithms,
|
||||||
array('arcfour256')
|
array('arcfour256', 'arcfour128', 'arcfour')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user