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

Attempted to call an undefined method named "setEngine" of class "phpseclib\Crypt\RC4" #1294

Closed
adrienHoareau opened this issue Sep 5, 2018 · 3 comments

Comments

@adrienHoareau
Copy link

adrienHoareau commented Sep 5, 2018

Hello,

In a sftp connexion, I want to use the internal crypto engine instead of the mcrypt engine.
So I do :
$client = new SFTP($myHost, $myPort);
$client->setCryptoEngine(1);// method in SSH2 class
$client->login($username, $password);

And then I got the error :
Attempted to call an undefined method named "setEngine" of class "phpseclib\Crypt\RC4"

I think it is because of this :
$this->encrypt->setEngine($this->crypto_engine); // in SSH2 class at line 1823

There is no method setEngine in the project, only _setEngine which is private, so I think It should be replace by :
$this->encrypt->setPreferredEngine($this->crypto_engine);

I'm not confortable with git so I don't know how to do this change by myself. Can someone do the fix ?

@adrienHoareau
Copy link
Author

By the way I would like to know if someone knows how to set the cipher to use when using the SFTP class ?

@terrafrost
Copy link
Member

This should work better as of the latest commit.

By the way I would like to know if someone knows how to set the cipher to use when using the SFTP class ?

There's not really a good way to do this atm. I do intend to significantly revamp the SSH2 API at some point but my priorities atm are on updating phpseclib's underlying cryptographic primitives.

@adrienHoareau
Copy link
Author

thank you very much, it works great !

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

2 participants