You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EVP_CipherUpdate breaks support for private keys encrypted with aes256-cbc #764
@haydenroche5 looks like #629 (comment) is having some fallout given this and #739 both are pointing to that change. Any chance you'd be willing to tweak this and ensure it works with wolfSSL while keeping the original EVP_Cipher call?
If I'm reading the docs correctly, it would seem that EVP_CipherUpdate needs to be followed by EVP_CipherFinal_ex, but I'm not sure where that should go in the code.
Calling final means you will no longer call update which doesn't seem like the correct solution here. Looking at the OpenSSL code, both EVP_Cipher() and EVP_CipherUpdate() eventually call into ctx->cipher->do_cipher(). The later doing a lot more legwork before calling do_cipher(). It seems like there may be a slight incompatibility in how they work.
Using EVP_CipherUpdate() requires a call to EVP_CipherFinal() but the way libssh2 is currently built there is no concept of final function on the LIBSSH2_CRYPT_METHOD struct so using the modern API will not work as a drop in replacement.
@haydenroche5 looks like #629 (comment) is having some fallout given this and #739 both are pointing to that change. Any chance you'd be willing to tweak this and ensure it works with wolfSSL while keeping the original EVP_Cipher call?
I'm sorry if I came here without fully understanding the context.
It seems that an issue about using ed25519 keys is propagating to a Python module (ssh2-python) that is based on libssh2. ParallelSSH/ssh2-python#178 - here it mentions that the issue might be related to libssh2.
Can someone tell me if it is somehow related to this issue or if a new issue has to be created? As i mentioned earlier, the technical details might be over my knowledge, especially when C code is involved.
Activity
willco007 commentedon Oct 28, 2022
@haydenroche5 looks like #629 (comment) is having some fallout given this and #739 both are pointing to that change. Any chance you'd be willing to tweak this and ensure it works with wolfSSL while keeping the original
EVP_Ciphercall?jakob commentedon Oct 28, 2022
If I'm reading the docs correctly, it would seem that
EVP_CipherUpdateneeds to be followed byEVP_CipherFinal_ex, but I'm not sure where that should go in the code.willco007 commentedon Oct 28, 2022
Calling
finalmeans you will no longer call update which doesn't seem like the correct solution here. Looking at the OpenSSL code, bothEVP_Cipher()andEVP_CipherUpdate()eventually call intoctx->cipher->do_cipher(). The later doing a lot more legwork before callingdo_cipher(). It seems like there may be a slight incompatibility in how they work.willco007 commentedon Oct 28, 2022
Using
EVP_CipherUpdate()requires a call toEVP_CipherFinal()but the way libssh2 is currently built there is no concept of final function on theLIBSSH2_CRYPT_METHODstruct so using the modern API will not work as a drop in replacement.Revert usage of EVP_CipherUpdate #764 #739
haydenroche5 commentedon Oct 31, 2022
Sure. I will look at this this week.
willco007 commentedon Oct 31, 2022
@haydenroche5 I went ahead and submitted a PR here 3fdcff2, please make sure it works for you with wolfSSL.
ionutbaltariu commentedon Nov 2, 2022
I'm sorry if I came here without fully understanding the context.
It seems that an issue about using ed25519 keys is propagating to a Python module (ssh2-python) that is based on libssh2. ParallelSSH/ssh2-python#178 - here it mentions that the issue might be related to libssh2.
Can someone tell me if it is somehow related to this issue or if a new issue has to be created? As i mentioned earlier, the technical details might be over my knowledge, especially when C code is involved.
willco007 commentedon Nov 2, 2022
@xeno-john you're probably looking for the fix in 3fdcff2
ionutbaltariu commentedon Nov 3, 2022
@willco007 "This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository."
willco007 commentedon Nov 3, 2022
@xeno-john That's because I landed it on
mastershortly after I replied to you and deleted the MR branch.Revert usage of EVP_CipherUpdate libssh2#764 libssh2#739 (libssh2#765)