Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function mcrypt_list_algorithms() is deprecated #1500

Closed
mark-ambrazhevich-spiral opened this issue Jul 27, 2020 · 4 comments
Closed

Function mcrypt_list_algorithms() is deprecated #1500

mark-ambrazhevich-spiral opened this issue Jul 27, 2020 · 4 comments

Comments

@mark-ambrazhevich-spiral

I have the following error "Function mcrypt_list_algorithms() is deprecated".
Environment: docker alpine, php7.2, mcript installed.

I've tried $sftp->setCryptoEngine(Base::ENGINE_INTERNAL); but still at some point it checks every engine and fails with error.

"version": "2.0.28"

@terrafrost
Copy link
Member

mcrypt is utilized for speed purposes:

#1028 (comment)

It is weird, tho, that it's trying to call it even tho you're setting the crypto engine to be Base::ENGINE_INTERNAL.

What's the line number you're getting the error on?

Thanks!

@mark-ambrazhevich-spiral
Copy link
Author

mark-ambrazhevich-spiral commented Jul 27, 2020

I saw that topic, put didn't find the solution there.
This is the stack track

·    [0] = string(112) #0 /var/www/stat/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(4626): phpseclib\Crypt\Base->isValidEngine(2)
·    [1] = string(128) #1 /var/www/stat/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(1354): phpseclib\Net\SSH2->getSupportedEncryptionAlgorithms()
·    [2] = string(109) #2 /var/www/stat/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(1288): phpseclib\Net\SSH2->_key_exchange()
·    [3] = string(104) #3 /var/www/stat/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(2150): phpseclib\Net\SSH2->_connect()
·    [4] = string(109) #4 /var/www/stat/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php(2128): phpseclib\Net\SSH2->_login('username')
·    [5] = string(75) #5 [internal function]: phpseclib\Net\SSH2->login('username', 'pass')

So in SSH2 4606 it iterate over all engines and call isValidEngine

        $engines = array(
            Base::ENGINE_OPENSSL,
            Base::ENGINE_MCRYPT,
            Base::ENGINE_INTERNAL
        );
...
        foreach ($engines as $engine) {}

@terrafrost
Copy link
Member

The mcrypt_list_algorithms call in isValidEngine() has the error suppression operator before it so idk how errors are showing up.

Anyway, 40b4f1d should make it so that mcrypt_list_algorithms isn't called when $sftp->setCryptoEngine(Base::ENGINE_INTERNAL); is set.

@ogbofjnr
Copy link

ogbofjnr commented Aug 3, 2020

Cool, thank you, waiting for release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants