SSH2: add setCryptoEngine() function

This commit is contained in:
terrafrost 2014-10-11 23:26:46 -05:00
parent ff4d563f4f
commit 959c0cefae

View File

@ -840,6 +840,16 @@ class Net_SSH2
*/
var $windowRows = 24;
/**
* Crypto Engine
*
* @see Net_SSH2::setCryptoEngine()
* @see Net_SSH2::_key_exchange()
* @var Integer
* @access private
*/
var $crypto_engine = false;
/**
* Default Constructor.
*
@ -941,6 +951,20 @@ class Net_SSH2
$this->connectionTimeout = $timeout;
}
/**
* Set Crypto Engine Mode
*
* Possible $engine values:
* CRYPT_MODE_INTERNAL, CRYPT_MODE_MCRYPT
*
* @param Integer $engine
* @access private
*/
function setCryptoEngine($engine)
{
$this->crypto_engine = $engine;
}
/**
* Connect to an SSHv2 server
*
@ -1646,6 +1670,9 @@ class Net_SSH2
$keyBytes = pack('Na*', strlen($keyBytes), $keyBytes);
if ($this->encrypt) {
if ($this->crypto_engine) {
$this->encrypt->setEngine($this->crypto_engine);
}
$this->encrypt->enableContinuousBuffer();
$this->encrypt->disablePadding();
@ -1663,6 +1690,9 @@ class Net_SSH2
}
if ($this->decrypt) {
if ($this->crypto_engine) {
$this->decrypt->setEngine($this->crypto_engine);
}
$this->decrypt->enableContinuousBuffer();
$this->decrypt->disablePadding();