SSH2: rm unsupported algorithms if OpenSSL is being used

This commit is contained in:
terrafrost 2014-12-29 22:10:26 -06:00
parent cf17141930
commit 5a91539148

View File

@ -1091,7 +1091,9 @@ class Net_SSH2
$identifier = 'SSH-2.0-phpseclib_0.3';
$ext = array();
if (extension_loaded('mcrypt')) {
if (extension_loaded('openssl')) {
$ext[] = 'openssl';
} elseif (extension_loaded('mcrypt')) {
$ext[] = 'mcrypt';
}
@ -1164,6 +1166,14 @@ class Net_SSH2
//'none' // OPTIONAL no encryption; NOT RECOMMENDED
);
if (extension_loaded('openssl')) {
// OpenSSL does not support arcfour256
$encryption_algorithms = array_diff(
$encryption_algorithms,
array('arcfour256')
);
}
if (phpseclib_resolve_include_path('Crypt/RC4.php') === false) {
$encryption_algorithms = array_diff(
$encryption_algorithms,