Skip to content

Commit

Permalink
SSH2: when building algo list look at if crypto engine is set
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Jul 31, 2020
1 parent c7d7b36 commit 40b4f1d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions phpseclib/Net/SSH2.php
Expand Up @@ -4610,11 +4610,15 @@ function getSupportedEncryptionAlgorithms()
//'none' // OPTIONAL no encryption; NOT RECOMMENDED
);

$engines = array(
CRYPT_ENGINE_OPENSSL,
CRYPT_ENGINE_MCRYPT,
CRYPT_ENGINE_INTERNAL
);
if ($this->crypto_engine) {
$engines = array($this->crypto_engine);
} else {
$engines = array(
CRYPT_ENGINE_OPENSSL,
CRYPT_ENGINE_MCRYPT,
CRYPT_ENGINE_INTERNAL
);
}

$ciphers = array();
foreach ($engines as $engine) {
Expand Down

1 comment on commit 40b4f1d

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1500

Please sign in to comment.