mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +00:00
SSH2: add setCryptoEngine() function
This commit is contained in:
parent
ff4d563f4f
commit
959c0cefae
@ -840,6 +840,16 @@ class Net_SSH2
|
|||||||
*/
|
*/
|
||||||
var $windowRows = 24;
|
var $windowRows = 24;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Crypto Engine
|
||||||
|
*
|
||||||
|
* @see Net_SSH2::setCryptoEngine()
|
||||||
|
* @see Net_SSH2::_key_exchange()
|
||||||
|
* @var Integer
|
||||||
|
* @access private
|
||||||
|
*/
|
||||||
|
var $crypto_engine = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default Constructor.
|
* Default Constructor.
|
||||||
*
|
*
|
||||||
@ -941,6 +951,20 @@ class Net_SSH2
|
|||||||
$this->connectionTimeout = $timeout;
|
$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
|
* Connect to an SSHv2 server
|
||||||
*
|
*
|
||||||
@ -1646,6 +1670,9 @@ class Net_SSH2
|
|||||||
$keyBytes = pack('Na*', strlen($keyBytes), $keyBytes);
|
$keyBytes = pack('Na*', strlen($keyBytes), $keyBytes);
|
||||||
|
|
||||||
if ($this->encrypt) {
|
if ($this->encrypt) {
|
||||||
|
if ($this->crypto_engine) {
|
||||||
|
$this->encrypt->setEngine($this->crypto_engine);
|
||||||
|
}
|
||||||
$this->encrypt->enableContinuousBuffer();
|
$this->encrypt->enableContinuousBuffer();
|
||||||
$this->encrypt->disablePadding();
|
$this->encrypt->disablePadding();
|
||||||
|
|
||||||
@ -1663,6 +1690,9 @@ class Net_SSH2
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($this->decrypt) {
|
if ($this->decrypt) {
|
||||||
|
if ($this->crypto_engine) {
|
||||||
|
$this->decrypt->setEngine($this->crypto_engine);
|
||||||
|
}
|
||||||
$this->decrypt->enableContinuousBuffer();
|
$this->decrypt->enableContinuousBuffer();
|
||||||
$this->decrypt->disablePadding();
|
$this->decrypt->disablePadding();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user