1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

Revert usage of EVP_CipherUpdate #764 #739 (#765)

Revert usage of EVP_CipherUpdate from wolfSSL PR to fix #764 #739.
This commit is contained in:
Will Cosgrove
2022-11-02 09:28:45 -07:00
committed by GitHub
parent 0ba6e74bec
commit 0986fee58b

View File

@@ -473,20 +473,28 @@ _libssh2_cipher_crypt(_libssh2_cipher_ctx * ctx,
{
unsigned char buf[EVP_MAX_BLOCK_LENGTH];
int ret;
int outlen;
int rc = 1;
(void) algo;
(void) encrypt;
#ifdef HAVE_OPAQUE_STRUCTS
ret = EVP_CipherUpdate(*ctx, buf, &outlen, block, blocksize);
ret = EVP_Cipher(*ctx, buf, block, blocksize);
#else
ret = EVP_CipherUpdate(ctx, buf, &outlen, block, blocksize);
ret = EVP_Cipher(ctx, buf, block, blocksize);
#endif
if(ret == 1) {
#if (defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3) || \
defined(LIBSSH2_WOLFSSL)
if(ret != -1)
#else
if(ret == 1)
#endif
{
rc = 0;
memcpy(block, buf, blocksize);
}
return ret == 1 ? 0 : 1;
return rc;
}
#if LIBSSH2_AES_CTR && !defined(HAVE_EVP_AES_128_CTR)