mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
openssl.c: Fix EVP_Cipher interface change in openssl 3 #463
File:
openssl.c
Notes:
Fixes building with OpenSSL 3, #463.
The change is described there:
f7397f0d58
Credit:
Laurent Stacul, reported by Sergei
This commit is contained in:
@@ -427,10 +427,19 @@ _libssh2_cipher_crypt(_libssh2_cipher_ctx * ctx,
|
|||||||
#else
|
#else
|
||||||
ret = EVP_Cipher(ctx, buf, block, blocksize);
|
ret = EVP_Cipher(ctx, buf, block, blocksize);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
|
||||||
|
if(ret != -1) {
|
||||||
|
#else
|
||||||
if(ret == 1) {
|
if(ret == 1) {
|
||||||
|
#endif
|
||||||
memcpy(block, buf, blocksize);
|
memcpy(block, buf, blocksize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
|
||||||
|
return ret != -1 ? 0 : 1;
|
||||||
|
#else
|
||||||
return ret == 1 ? 0 : 1;
|
return ret == 1 ? 0 : 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LIBSSH2_AES_CTR && !defined(HAVE_EVP_AES_128_CTR)
|
#if LIBSSH2_AES_CTR && !defined(HAVE_EVP_AES_128_CTR)
|
||||||
|
|||||||
Reference in New Issue
Block a user